python python python

Python
python python pythonpython python pythonpython python pythonpython python python
2 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" ...
6 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

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

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

Flask - wtforms: Validation always false

Python
First, I'm new to python and Flask, so I'm sorry if my question is dumb. I search it but never found an answer (which should be an "easy" one I guess)...
1 year ago

Remove specific rows from CSV file in python

Python
I am trying to remove rows with a specific ID within particular dates from a large CSV file. The CSV file contains a column [3] with dates formatted...
1 year ago

How to import a module given the full path?

Python
How can I load a Python module given its full path? Note that the file can be anywhere in the filesystem, as it is a configuration option.
1 year ago