python python python

Python
python python pythonpython python pythonpython python pythonpython python python
6 months ago

Python - Concatenate Python query

Python
I'm using the python-google-places script but I'm facing a problem when integrating the code into a function called with two parameters: "MyLocation" ...
10 months ago

Django TemplateTags not compiling

Python
I am trying to create custom django templatetags for my project. I followed the guides available and created the tags. But the tags are not being pick...
1 year ago

integer division in python 3 - strange result with negative number

Python
I am newbie in python and I am learning operators right now. I understood that / operator is used for floating point division and // for integer divis...
1 year ago

(Simple Python) CSV input to usernames

Python
I have a CSV file names.csv First_name, Last_name Mike, Hughes James, Tango , Stoke Jack, ....etc What I want is to be able to take the first lett...
1 year ago

Scripting the Keyframe Inserts for Opacity and Volume

Python
Having added, trimmed and arranged my home video recordings within the Video Sequence Editor under Blender 2.74. My next goal is to automate the fadin...
1 year ago

Is it possible to align a print statement to the center in Python?

Python
I was wondering if it was possible to align a print statement in Python (newest version). For example: print ("hello world") would appear on the us...
1 year ago

What would be a good Python data structure that can store lists of data that all have a common index and some minor metadata?

Python
I have a set of lists, each for storing certain characteristics of events. I also have an index that corresponds to event numbers. So, for a particula...
1 year ago

How can I speed up fetching pages with urllib2 in python?

Python
I have a script that fetches several web pages and parses the info. (An example can be seen at http://bluedevilbooks.com/search/?DEPT=MATH&CLASS=...
1 year ago

Python dictionary key length not same as rows returning for the query in mysql

Python
So i am trying to fetch data from the mysql into a python dictionary here is my code. def getAllLeadsForThisYear(): charges={} cur.execute("select l...
1 year ago

Better handling of KeyboardInterrupt in cmd.Cmd command line interpreter

Python
While using python's cmd.Cmd to create a custom CLI, how do I tell the handler to abort the current line and give me a new prompt? Here is a minimal ...
1 year ago

if statement in a hybrid_property expression

Python
I have a hybrid_property that performs some conditional and returns a response. I'd like to be able to query against this field so I've created an ex...
1 year ago

Saving data with pickle and tkinter for later use

Python
This is my code: import pickle from tkinter import * from tkinter.messagebox import * Game = Tk() Gold = 0 Multiply = 1 def Save(): with open(...
1 year ago

Remove duplicates from a string so that it appears once

Python
Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. I must make sure your r...
1 year ago

Determine if 2 lists have the same elements, regardless of order?

Python
Sorry for the simple question, but I'm having a hard time finding the answer. When I compare 2 lists, I want to know if they are "equal" in that they...
1 year ago

Should I open a file outside or inside a function?

Python
Maybe this question makes no sense, but I was wondering if there was a "recommended practice" on how to pass a file to a function in Python. Should I...
1 year ago

Flask / Eve: Internal GET request with parameters

Python
I am using a flask webserver (part of an eve api) and need to do an internal GET-request. For an external request I use this code: url = 'http://127...
1 year ago

Example program of Cython as Python to C Converter

Python
I found here and here that one can use Cython to convert Python to C, but I cannot find any step-by-step example. Let's say I have a simple function: ...
1 year ago

Generate a list of random string of fixed length in python

Python
I need to generate a list which will have random alphanumeric string of fixed length. It will be something like: list = ['ag5','5b9','c85'] I can make...
1 year ago

How do I access the request object or any other variable in a form's clean() method?

Python
I am trying to request.user for a form's clean method, but how can I access the request object? Can I modify the clean method to allow variables input...
1 year ago