Most voted "python" questions
Python is a dynamic and heavily typed programming language whose design philosophy emphasizes usability. Two similar but incompatible versions of Python are in use (2 and 3). Please mention the version you are using when asking a question about Python.
Learn more…8,642 questions
Sort by count of
-
0
votes1
answer119
viewsSublimerepl does not run the code
I’m using Sublime to write some codes in Python and Sublime REPL to "run" the codes. Anyway, I installed by package control, until then nothing strange, but when I put to run by REPL it gives "file…
-
0
votes1
answer251
viewsProblem with Django authentication
I’m having trouble validating the login, I’m using a legacy bank Firebird 2.5. Could someone help me?…
-
0
votes1
answer2285
viewsText position in Tkinter
Hello. I am working with Tkinter and I am at an impasse. I have nine buttons and each one prints a number. How can I make it so that after I press a button, no matter what button I press, a number…
-
0
votes1
answer697
viewsDjango Legacy Database Authentication
I am developing a project with a legacy database (Firebird), and I was able to configure Settings.py and it is working with the database. When creating a login using Forms, I am not able to create…
-
0
votes1
answer2613
viewsQuery and download Nfe
I am wanting to make a program to query and download from NF-e and would like to know which Web Services I would connect to get my application running.
-
0
votes1
answer35
viewsExtract everything using Libarchive
How do I extract all content from a compressed file to the current directory? P.S.: The file has folders and files. import libarchive def unpack(file): #?
pythonasked 10 years ago Gabriel Sales 1,257 -
0
votes2
answers525
viewsConvert search with Pymongo: Dictionary in JSON
I’m using Pymongo to make a search: resultado = db.find_one({'nome':'xpto'}) The result of this search is a Python dictionary, but I need to convert it to a JSON. What’s the best way to do it?…
-
0
votes1
answer429
viewsControl whether a Tkinter. Text is empty
I’m trying to create a simple notepad, but I have a little problem: when I try to see if the text of an object Text is or is not empty: if text_area.get(0.0, tkinter.END) != "": print("Text não…
-
0
votes1
answer229
viewsuwsgi configuration for high traffic
I have a Django application and I’m having trouble configuring my server for high traffic. It’s very slow with few accesses. see my setup: [uwsgi] chdir =…
-
0
votes1
answer758
viewsFreeze Windows clock
It would be possible to freeze the Windows clock with Python? If so, which library does it?
-
0
votes3
answers913
viewsMultiple of 10 closest to a sum
def multiplo(x): somamulti= somaImpares(x) + somaPares(x) if somamulti/10==0: return somamulti/10 else: return In this function I did what happens is the following: the somamulti sum 2 values, in…
-
0
votes1
answer43
viewsFormat characters do not need to be specified?
Format characters have to be specified? for example: x = "Get rekt m8" print "Eu disse: %r." % x So why didn’t I need to specify this and it worked anyway? hilarious = False joke_evaluation = "Isn't…
-
0
votes1
answer91
viewsProxy problem (enterprise) using dev_appserver.py - GAE
Hello, I’m having a problem using the Google App Engine and would like to know if anyone can help me. In my machine I have installed: Windows XP Python 2.7.6 Google App Engine 1.9.17 (is the newest)…
-
0
votes1
answer318
viewsPython mobile app development
How do I develop mobile operating systems with Python (Android, Windows Phone, and iOS)? How do I start this? Software to use etc. My main focus is Windows Phone.
-
0
votes0
answers564
views -
0
votes1
answer70
viewsFor x in range(y) does not return right
I have a problem with a def x() in python. the problem is "inside" it. Even if I put it right, it returns Isis, no matter. I’ve tried everything but I can’t figure out why he doesn’t return right.…
-
0
votes2
answers1771
viewsPython - take data from file . txt with regex
hello, I am trying to make a program but I am not able to remove the data from the file . txt, would be more or less these in bold. PokerStars Hand #135235596385: Tournament #1228747530, $0.23+$0.02…
-
0
votes1
answer646
viewsHow to convert a "Sqlite3 Object cursor" to a list (Python)
In a cell of a table in my database I have a list of pairs. I have a module in Python that I want you to fetch that list from the database and read it as a list. I tried to run this: interpretation…
-
0
votes1
answer235
viewsScroll through the entire record
I wonder if there is a way I can go through the entire registry (keys and subkeys, do not need the value of them) of the operating system to find the name of a key in specific? If so, could someone…
-
0
votes2
answers68
viewsLinux running average
I need to take the average running time and consumption of CPU de 30 execuções of a program made in Python. I have to use the remote time of Linux. Like I’ve never worked with Linux before I’m…
-
0
votes2
answers1649
viewsAuto-start
I have a program in Python and I need it to start automatically along with Windows, I could not find any material related to it on the internet.
-
0
votes1
answer274
viewsReturn values in Foreignkey and Manytomanyfield in Django
I have the following Models: Restaurant with a Foreignkey for Cardapio, Cardapio with a Manytomany for Product, Product with a Manytomany for Diapromocao, and I need in the template, display some…
-
0
votes1
answer196
viewsHow to run a video inside a GUI
good evening, I’m having a problem. I need to run a youtube video inside a GUI interface (with Python). A community user helped me by providing the following code:…
-
0
votes0
answers103
viewsUnicodedecodeerror - unicodedecodeerror 'ascii' codec can’t Decode byte 0xc3
Hello! I’m having trouble installing the pip (package manager python). The installation should occur at the same time as the python installation is done (I used: brew install python => installs…
-
0
votes1
answer455
viewsCan I become a programmer studying Python using Qpython?
For example, if possible make money. I have version Qpython 2.7 and 3
-
0
votes1
answer210
viewsSearch with OR in Django
Hello I’m developing my 1° application in Django and I’m having difficulty with more complex research in DB. Here is my MODEL: class Tag(models.Model): objects = GChartsManager() idtag =…
-
0
votes0
answers100
viewsGchart with Django
Hi I am developing a Django application that creates graphics. And I have implemented a line chart using Gcharts insert link description here but it only has one line, and in the example I’ve seen…
-
0
votes1
answer114
viewsCommunication between database and the Python app - mini password-taking system
Hello, I am learning python and I decided to do a mini project, a simple system of chips, while I thought about the subject came me some doubts and I could not find anything about. The program would…
-
0
votes1
answer377
viewsHow do you install kivy in the anaconda environment on mac os X10.9?
I tried to install as instructed: https://github.com/kivy/kivy/wiki/Connecting-Kivy-with-Anaconda-(OSX) Error: (Most recent call last): File ", line 1, in File…
-
0
votes1
answer381
viewsWorking with multiple databases from the same class model
I am new in Python and I need to implement a solution that every system user should have a separate database, briefly what I need is something like db1 = Persistencia('mysql',…
-
0
votes0
answers76
viewsHow to read a . Kar file in python?
I’m trying to read a file. Kar and then print the letters on the screen, how would I do that in Python3? I tried to use Karapython, but it does not work in Python3, some help?
-
0
votes1
answer201
viewsSpyder can’t read serial port
I created the following test program: import serial porta = '/dev/ttyUSB0' baud_rate = 9600 try: Obj_porta = serial.Serial(porta, baud_rate) valor = Obj_porta.read() print valor Obj_porta.close()…
-
0
votes1
answer108
viewsUsing python and Django, querys problem
I’m using Python with the Django framework. This method must return a resulting query, to send e-mail to the corresponding emails from the database. However, the method works for some cases and for…
-
0
votes2
answers552
viewsI cannot print a variable that receives the value of a list position
Listing exercise. Select the largest and smallest element of a vector. import os os.system("clear") vetor=[] #declara o vetor #solicita o n° de elementos n = int(input("Digite a quantidade de…
pythonasked 9 years, 2 months ago Alex Pinho 19 -
0
votes1
answer57
viewsHow to add new python encodings?
I’m trying to install the pybraces but I can’t. How do I install it ? I’m using python 2.7 and windows 10
-
0
votes1
answer373
viewsRemove value from an array
My array is mounted as follows: obstacles = [[x, y], [x, y], ...] I am wanting to remove a position [x, y from the array] But the function obstacles.remove() is turning off the server when run, if I…
-
0
votes1
answer1219
viewsFacebook API Python
Personal is it possible to list ALL groups of a friend on the face? Like show the groups he is in? I found this code but it’s not what I want, it just shows friends: import urllib2 import json url =…
-
0
votes1
answer3982
viewsError: "in module named xxxx"
I have Python installed on my Pcs (Windows 7 and 8) but I can’t run any script that contains import. Error message always appears: import error: no module named xxxx.…
-
0
votes1
answer230
viewsDifference between tuple and set
I’m working with python and I was wondering what would be the difference between a set(set()) and a tuple(tuple()). I know that both are delimited with '()'. But I tried to assign a set attribute to…
-
0
votes1
answer56
viewsError "Can not update Identity column 'order'"
Due to an old need of a project, the developer of the time created a field in the table that is not a primary key but is auto incrementable, however, Django returns an error for not being able to…
-
0
votes0
answers146
viewsDjango error: Invalid block tag: expected 'endblock'
In the development environment works normally, already in the production server I have the following error: Invalid block tag: 'ultimos_produtos', expected 'endblock' Follow the code excerpt: {%…
-
0
votes1
answer198
viewsHow to run a code outside a directory in Python?
I tried to run the code saved on desktop. However, Python Shell showed Could you help me? Thank you, Marcos Miotti…
-
0
votes0
answers175
viewsHow to enable vertical scrollbar in python qwebview?
I need to enable the scrollbar in a widget qwebview, and put the automatic scrolling, but I couldn’t find any information on how to do this in python. I tried to do so:…
-
0
votes1
answer189
viewsHow to extract data from simple non-standard texts?
I would like to extract fields for a database from text files. However the fields are positioned in different ways in each text being difficult to obtain the values by common methods, for example:…
-
0
votes1
answer105
viewspsycopg2.pool.Simpleconnectionpool, Operationalerror exception takes time to launch
I ran a test, shut down the server and called the method psycopg2.pool.SimpleConnectionPool, the method is waiting for a response for a very long time, about a minute, only then it raises the…
-
0
votes1
answer502
viewsPython and Selenium: Syntaxerror: invalid syntax
I am trying to log automatically on facebook with the code below, from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait import unittest class LoginTest…
-
0
votes1
answer256
viewsIs reading files in Python updated in real time?
I am developing an application where I will create a multithreading that will read a file .json and based on a key from this file (status: 'pending' or status: 'completed') I will perform an action…
-
0
votes1
answer130
viewsError installing goslate API for python on Windows
I’m getting this result when I try to install the goslate API, which is a more optimized Google Api to mess with translations and other things. C:\Users\chris\Documents\PyCharm…
-
0
votes1
answer1323
viewsClick on button does not work
I have a button made on ext, that he should open a window when Selenium clicked, but that doesn’t happen, I’m doing it this way. from selenium import webdriver from selenium.webdriver.support.ui…
-
0
votes1
answer154
viewsFind element that the ID is generated randomly
I have a situation that id, always updating randomly.. and without an apparent order making it possible for me to use find_element_by_id the component is as follows:: <table…