Questions tagged as 'python-3.x'

1
answer

socket-python syntax error

except socket.error, (errno, msg): if errno == 1: # Operation not permitted msg = msg + ( " - Note that ICMP messages can only be sent from processes" " running...
asked by 05.04.2017 / 21:36
1
answer

How do I solve an alternative power problem?

I need help solving a power problem in an alternate way. The purpose is to show the result of the potentiation and the number of characters (or numbers) that appear in the result. The code I'll put next I got put to work through some conversi...
asked by 10.04.2017 / 18:16
1
answer

Change coding in pd.to_datetime

I wanted to know if there is a possibility to change the encoding of an element returned by the to_datetime function of pandas. I need to change to ISO-8859-1 encoding to compare the date with others that are stored in an external file (T...
asked by 22.05.2017 / 19:18
1
answer

Reference and Parameter in Python

I have a class in Python that has a function that returns a triple (3 information together) and I wanted to create 4 different objects because I need 4 different triples. The point is that the values are accumulating and the 4th object has the i...
asked by 12.04.2017 / 00:16
2
answers

Installation Cartopy

I'm trying to install the cartopy library. But I can not. Can someone help me? I tried for pypi and returned the following error: C:\Users\Rafa>pip install cartopy Collecting cartopy Using cached Cartopy-0.15.1.tar.gz Exception: Tracebac...
asked by 20.10.2017 / 21:38
1
answer

How to keep a fixed value inside a recursive function?

I'd like to create a variable with the first value passed as a parameter in a function, but every time a recursive call is made the variable receives the value of the new passed parameter. For example: def fatorial(n) print(n) if n <...
asked by 28.05.2017 / 20:21
1
answer

Why can not tkinter execute a 'simple command'?

I would like to understand why in the code below the tikinter (I think that's the problem) can not do something simple like     'c = c + 1' ? Code: from tkinter import * import pygame.mixer sounds = pygame.mixer sounds.init() c = 0 e...
asked by 08.03.2017 / 05:02
1
answer

ReportLab - Python - Doubt with date writing (date)

I am having problems with reportlab. Python 3 / Django application I have a Pessoa model that contains a data de nascimento field that is of type DateTimeField . I am trying to write the date of birth in the PDF but the...
asked by 26.10.2016 / 23:10
1
answer

Create a new function with scrapy

I'm starting to learn scrapy and created the following function: import scrapy class ModelSpider(scrapy.Spider): name = "model" start_urls = [ 'http://www.icarros.com/' ] def parse(self, response): with open('brands....
asked by 06.09.2016 / 19:03
1
answer

progress bar in python 3

I'm trying to set up a progress bar to tell the percentage of running my Python script with varying different functions, but without success how would I create such a progress bar?     
asked by 30.08.2016 / 22:43