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
- 
		1 votes1 answer1837 viewsSelect Rows in a Postgresql arrayI am using the Postgresql and Python database to query it, I have the following modeling: I’m trying to make an appointment that will return all the OrderItems of a Order in a array, for that I made… 
- 
		1 votes1 answer65 viewsPython Open-ID FrameworkGuys, I got a problem. I don’t think the stack is the best place to ask but I don’t know exactly where to ask this. As you all know, Openid 2.0 will no longer be supported by google, which forces us… 
- 
		1 votes1 answer1714 viewsWrite to file, replace words/numbersI have this code that is supposed to read a file and delete all the numbers that are there, the file is like a list of words, Ex: "Ana n Bruno n 123 n 10 n ...". A line has letters or numbers, never… 
- 
		1 votes1 answer535 viewsAble to see through cubes - opengl - pyopenglContext: I’m using pyopengl 3.0.2 and python 2.7 to make 3ds drawings in opengl, Ubuntu 14.04 as OS and intel hd 3000 as video board. Problem: When executing any cube in opengl the cube becomes… 
- 
		1 votes2 answers599 viewsHow to request input data N times, and concatenate this dataFirst I asked the user to enter the amount of links that he wanted to add to the file (in this case a string), hence if for example he type 4, I want to ask the question "Download link: " four times… 
- 
		1 votes1 answer713 viewsError: IDLE crashes after closedI have a lab with 35 machines running Windows 8.1 Pro. After installing Python (version 2.7.9 64bits) on all machines, I come across the following problems: Some machines install normally, but it is… 
- 
		1 votes1 answer1893 views
- 
		1 votes2 answers2951 viewsCopy file content to clipboard on WindowsHello, I am making a software for a forum, where members consult the patterns of posts by the software, I am storing these patterns in files and asking Python to read these files and display them,… 
- 
		1 votes2 answers158 viewsHow to use Kivy with Python 3.4.3 on MacHow can I use Kivy with Python 3.4.3 on OS X? Only works with Python 2.7 
- 
		1 votes1 answer5597 viewsHow to remove a line from a text fileHello. I am creating a program that opens, stores or deletes links. However, although I can remove the selected item from the link list I cannot delete the file line that corresponds to the selected… 
- 
		1 votes2 answers428 viewsHow to insert an array into a variable?Realizing that it has a lot of repetitive code I decided to automate creating a looping of reading the cells of my excel file. #row cell fixa para o horario rows = ts[1].rows cells = rows[1].cells… 
- 
		1 votes2 answers5622 viewsAccess denied when updating PIPI am running the following command at the Windows prompt pip install --upgrade pip And I’m getting a mistake: Permissionerror: [Winerror 5] Access denied: 'd: Leonardo python Django-treinaweb env… 
- 
		1 votes1 answer639 viewsString error in a Python 3 functionWhen I try to rotate the def gives a mistake on the part of texto[x][y-1], giving the following: erro:TypeError: 'str' object does not support item assignment Could someone please help me? def… 
- 
		1 votes1 answer2951 viewsSort a second column matrixHow to order the following matrix according to the x-coordinate column? I want you not only to order the coordinates, but to change the lines so that the city coordinates are correct. What I have so… 
- 
		1 votes1 answer719 viewsCreate a dictionary in Python by receiving values from the databaseAfter accessing the database and have the desired query in case: ... c = conn.cursor() c.execute('SELECT `tb1`.`Nome`, `tb1`.`Apelido` FROM tb1') How to create a python dictionary for my command… 
- 
		1 votes3 answers512 viewsPython binary file saving errorI have a program in Python that receives a binary file via parameter and saves this file. However, when it saves the file, some characters it replaces with a series of numbers. Below the original… 
- 
		1 votes1 answer779 viewsLibrary for the issuance of electronic fiscal notesI’m in need of a Python library for the issuance of electronic invoices... Does anyone there have any experience? Would you know to tell me if I need to acquire any government certificates for the… 
- 
		1 votes1 answer410 viewsI want to learn how to programI want to learn how to program, what do you recommend I do first? I saw on several sites about python, which is a language to learn first, is good? Which should I leave after? Obg! 
- 
		1 votes1 answer112 viewsKeyboard function does not work PyopenglGuys I have the following code, I wanted to make a simple event to close the application but my function Keyboard does not work, I searched elsewhere and found similar versions. If you can help me,… 
- 
		1 votes1 answer140 viewsCheck random numbers (randint)I started learning python this week and I was asking some questions and in one I have several different answers more when I type them always returns the same thing as if the others did not exist… 
- 
		1 votes1 answer1855 viewsHow to clean the screen on Tkinter?There is a practical way to "clean" a screen by giving a destroy() in all the widgets at once, without having to do it one by one? 
- 
		1 votes2 answers399 viewsImport modules with PythonHow can I do import of libraries, for example, I was researching and found the Babel to internationalize dates, but I don’t know how to import this library?… 
- 
		1 votes1 answer154 viewsError searching in DjangoHello I am creating a project on Jango and performing a search for a Taginfo based on a tag that has foreignkey for Taginfo. I’m getting the following error on line 99 from view. TypeError at… 
- 
		1 votes2 answers686 viewshow to use exactly Sleep and wakeup in python3?(multithread)Hello I am trying to do in python3 the famous problem of the producer/consumer, transcribing from my book of S.O. however I have been facing a problem , apparently the Wait() Just put it to sleep… 
- 
		1 votes1 answer649 viewsHow to place the mouse cursor in a specific position of a text field?I’m trying to format a field like entry gtk I’m using for date entry and wanted to add the character / in certain positions confirm the user will typing.. And the only thing missing is positioning… 
- 
		1 votes0 answers67 viewshow to use pyserial in pci modem interactionI am trying to create a program that dials for certain numbers call twice and change to the next number. I am using pyserial for communication with pci modem only the program occupies the port but… 
- 
		1 votes2 answers1817 viewsIs there any way to write code for the web without a python framework?I find python a very interesting language. And as I develop for web, I would like to use it for this purpose. I know there are good frameworks like Flask and Django. But if I wanted to write small… 
- 
		1 votes0 answers63 viewsError loading uwsgi - cannot be Loaded as Python moduleI made the settings to work Django with Apache, but always gives the following error: cannot be Loaded as Python module My file: import os import sys… 
- 
		1 votes1 answer1008 viewsHow to run a module in Python?have a question. A few days ago I am creating an application with GUI interface to show movie schedules. It was built in modules, for example, a module takes care of the images, searches the web and… 
- 
		1 votes2 answers1871 viewsAppend methods in a list - PythonI tried to add 4 methods to a list(methodList): def setVar(self, number): self.var = number methodList = list() for y in range(4): methodList.append(setVar(self, y)) and the function does not work:… 
- 
		1 votes3 answers1144 viewsIs there any way to use script as configuration files in python?In PHP, we can use a PHP script to just return values, which is very useful for creating configuration files for an application. Example DB.php return array( 'host' => 'localhost', 'username'… 
- 
		1 votes1 answer494 views
- 
		1 votes1 answer236 viewsConditionals and Control Flow (Codecademy Python 9/15)Hello, I’m performing an exercise of Codecademy and I have to solve the following conditions: Match bool_one to False or not True and True result Match bool_two to False and not True or True result… 
- 
		1 votes2 answers1570 viewsWhich PIP version should I use?My current question is: must I use pip3 for Python3.x or can I use Pip without any problem? What are the differences between Pip versions? 
- 
		1 votes1 answer491 viewsHow to get the contents of the selected cell in the Qtableview Python Grid?How can I get the contents of cell selected in a Grid of the kind QTableView in Python? Follow the code below: __author__ = 'Dener' from PyQt4.QtCore import * from PyQt4.QtGui import * import sys… 
- 
		1 votes1 answer332 viewsProblems installing numpy module in windows by PipI can install another module using the pip, except the numpy. I have tried other installation ways using the easy_install and installation by src, unsuccessful as well. See the exit of the… 
- 
		1 votes1 answer886 viewsCreate a list of python DictI have the following python function def playersID(self, listDetals): listPlayersID = [] tempDict = {} for x in listDetals: for y in x['result']['players']: tempDict.clear() tempDict['match_id'] =… 
- 
		1 votes1 answer398 viewspython request iugu returns status 400I’m testing the api of yugu. to generate boletus payments and I’m having problems returning json because there is no error in Dictionary items that is sent to the API (in php it would be an array)… 
- 
		1 votes1 answer1095 viewsTransform query into dataframe [sqlalchemy + pandas]I’m new to python and I want to create a function that will query the database[mysql] and convert it into a dataframe so that it can be sent by e-mail in format. csv. But I’m having problems in this… 
- 
		1 votes1 answer530 viewsIs Flask only used by beginners?Flask is only recommended for those who have no experience in web frameworks, i.e., for small projects (academic projects) or is recommended to develop large projects (industrial projects)? 
- 
		1 votes1 answer1948 viewsCan you kill a thread in Python?Is there any way to stop a python thread? And it’s a bad practice to do that? 
- 
		1 votes1 answer311 viewsPermission denied - LoggingI implemented the Logging python on several Flask projects successfully. But when I tried to re-implement Logging in a project it gives the following error:IOError: [Errno 13] Permission denied. To… 
- 
		1 votes1 answer59 viewsPython doubts syntaxGalera was studying python and saw on a site this line : self.brotcl.plugins.runCustumcomand() I know that self is referencing a class but and these three variables together as well ?… pythonasked 10 years ago alexsander 483
- 
		1 votes1 answer1141 viewsVariable with multiple lists for matrixGood night. I have a text file where I have already converted your content to lists. Each line in the file has become a list[], but now I need these lists to be all within an array. This way I can’t… 
- 
		1 votes1 answer65 viewsSet an analytic function in pythonI need to do some operations with matrices (very large), but the elements of it are analytical functions. There is a way to do this in Python? Ex: Matrix = [[x**2+3x,x+y+1]...[...].....[...]]… 
- 
		1 votes0 answers309 viewsImporterror: DLL load failed: %1 is not a Valid Win32 applicationWhen I run a Python script the following error occurs: Traceback (most recent call last): File "C:\Users\flemos\AppData\Local\Programs\Python\Python35-32\lib\pandas\__init__.py", line 7, in… pythonasked 10 years ago Felipe j.lemos 11
- 
		1 votes2 answers94 viewsRefactoring generation of random datetime (Python)accept suggestions to improve this code https://github.com/rg3915/django-orm/blob/master/fixtures/gen_random_values.py#L34-L45 import random import datetime def gen_timestamp(min_year=1915,… 
- 
		1 votes1 answer906 viewsHow to implement a linear regression algorithm in python?I am running a job in college and would like to implement a function that calculates a regressão linear. Given the points and the number of exponents desired, I want to return the coefficients of… 
- 
		1 votes1 answer1698 viewsAssigning values to dynamic variablesI’m trying to write a code that downloads the historical stock price series from yahoo Finance, then I need to separate the data. I want each variable to be named after the action. For example: I am… 
- 
		1 votes2 answers1119 viewsDeveloping a Webcrawler in PythonIs there any open source project of webcrawler simple, developed in Python, for study? I have been studying for some time / researching on the subject, but I can not find anything ready about it. My…