Questions tagged as 'python'

1
answer

Access denied when updating PIP

I'm running the following command at the Windows prompt pip install --upgrade pip And I'm getting an error:    PermissionError: [WinError 5] Access Denied:   'd: \ leonardo \ python \ django-treinaweb \ env \ scripts \ pip.exe' Remem...
asked by 23.06.2015 / 14:14
2
answers

I can not delete key in dbm

I made a basic program to store some data and I am in trouble if the user chooses to delete some stored dictionary key. The function that deletes the data in my program is this: def EraseData(name): ''' Apaga uma chave do dicionário do banco d...
asked by 07.07.2015 / 20:43
1
answer

Error with the asyncio module

I'm trying to run the example below on IDLE (Python 3.43, Windows 7, 64bit) for days, but it always gives an error. I tried searching for the solution on the English version website, on google, and I did not find an answer. I can run on Anaconda...
asked by 06.07.2015 / 22:47
2
answers

Problems with JavaScript, urllib and BeautifulSoup

The idea of my code is to get the link of the video and run it directly into VLC, but I came up with a problem: apparently urllib does not execute the JavaScript code, player is placed on the page using JavaScript. See my code below:...
asked by 08.03.2015 / 03:09
1
answer

Encode Python ASCII

Hello, I'm not able to correctly encode the following string in Python:    Algorithm I have tried the following alternatives: u'algor\u00edtimo'.encode('utf-8') 'algor\u00edtimo'.decode('utf-8') u'algor\u00edtimo'.encode('ascii') u'algo...
asked by 25.02.2015 / 20:51
1
answer

How to register an array of data in Django

I have an array of data in my session storage related to products in a store, and I would like to register a sale as soon as the user registers all their products and clicks on the end of the sale. This array of products is gaining a line wit...
asked by 26.10.2015 / 13:27
1
answer

How to simulate the title function of Python [string.title ()] in Java?

In python, the string has a function called title, which causes a text to be like a title. Does it have such a function in Java? If not, how to do it? Example: "Hi, my name is goku" .title () - > "Hi, My Name Is Goku" I need this functi...
asked by 24.08.2014 / 22:46
1
answer

Ping - save positive results to a list

I have this code, it works fine, but the problem is that I would like to save the successes (ping with return) in a list , but I do not know how to do this trace successes / failures. > import subprocess import threading def pinger_menager():...
asked by 25.03.2015 / 19:43
1
answer

xml handling treat strings as if they were files

I'm getting a xml in the format of string in my response. I want to manipulate this xml and generate a list of the <item> tags of the xml returned by the web service. Here is the snippet of my code: if (op ==...
asked by 01.07.2014 / 19:27
1
answer

Global variable is not defined

I have investigated for hours why this error. I already used global and it did not work and other programs I created resulted. Error code: def editor(): texto = raw_input("digite o texto que quer que o menu principal imprima:") if texto...
asked by 11.06.2014 / 23:59