I am writing an queue processing application which uses threads for waiting on and responding to queue messages to be delivered to the app. For the main part of the application, it just needs to stay active. For a code example like:
while True:
pass
or
while True:
time.sleep(1)
Which one will have the least impact on a syst...
Hello,
I am a noob when it comes to python. I have a python script which gives me output like this:
[last] ZVZX-W3vo9I: Downloading video webpage
[last] ZVZX-W3vo9I: Extracting video information
[download] Destination: myvideo.flv
[download] 9.9% of 10.09M at 3.30M/s ETA 00:02
The last line keeps getting updated with new values ...
So I can start from len (collection) and end in collection[0].
EDIT: Also sorry forgot to mention, I also want to be able to access the loop index.
...
Is there a way to configure easy_install to avoid having to download the files again when an installation fails?
...
I looking for a GUI Builder for python
i know it exist, can see it in this image background
![http://i37.photobucket.com/albums/e84/rsauron/Picture5.png][1]
...
I'm a modest graduate student in a high energy particle physics department. With an unfounded distaste for C/C++ and a founded love of python, I have resorted to python for my data analysis so far (just the easy stuff) and am about to attempt backing python scripts against ROOT libraries and, particularly, utilize MINUIT for some paramet...
I have a Perl regular expression (shown here, though understanding the whole thing isn't hopefully necessary to answering this question) that contains the \G metacharacter. I'd like to translate it into Python, but Python doesn't appear to support \G. What can I do?
...
I know that you can prepopulate admin form fields based on other fields. For example, I have a slug field that is automatically populated based on the title field.
However, I would also like to make other automatic prepopulations based on the date. For example, I have an URL field, and I want it to automatically be set to http://www.mys...
Anyone could recommend a good guide/tutorial/article with tips/guidelines in how to organize and partition a large Django project?
I'm looking for advices in what to do when you need to start factorizing the initial unique files (models.py, urls.py, views.py) and working with more than a few dozens of entities.
...
In python, what does the 2nd % signifies?
print "%s" % ( i )
...
I'm writing a Python program with a lot of file access. It's running surprisingly slowly, so I used cProfile to find out what was taking the time.
It seems there's a lot of time spent in what Python is reporting as "{built-in method acquire}". I have no idea what this method is. What is it, and how can I speed up my program?
...
I am raising exceptions in two different places in my Python code:
holeCards = input("Select a hand to play: ")
try:
if len(holeCards) != 4:
raise ValueError(holeCards + ' does not represent a valid hand.')
AND (edited to correct raising code)
def __init__(self, card):
[...]
if self.cardFace == -1 or self.cardSuit ==...
I am trying to get a basic blue-channel website running through fcgi, I have a django.fcgi file. How do I do this.
Thank you
...
I can't seem to figure out how to access POST data using WSGI. I tried the example on the wsgi.org website and it didn't work. I'm using Python 3.0 right now. Please don't recommend a WSGI framework as that is not what I'm looking for.
I would like to figure out how to get it into a fieldstorage object.
...
The purpose of my question is to strengthen my knowledge base with Python and get a better picture of it, which includes knowing its faults and surprises. To keep things specific, I'm only interested in the CPython interpreter.
I'm looking for something similar to what learned from my PHP landmines
question where some of the answers we...
Is it possible to write a single Python regular expression that can be applied to a multi-line string and change all occurrences of "foo" to "bar", but only on lines beginning with "#"?
I was able to get this working in Perl, using Perl's \G regular expression sigil, which matches the end of the previous match. However, Python doesn't a...
Basically I am storing millions of vector3 values in a list. But right now the vector3s are defined like so:
[5,6,7]
which I believe is a list. The values will not be modified nor I need any vector3 functionality.
Is this the most performant way to do this?
...
I'm writing a python script that uses os.walk() to walk a directory tree. I'd like to give it the ability to skip subdirectories that are mounted to a different file system, the way find -xdev does. Checking through the documentation on os.walk(), I didn't see any argument to pass in for it to do that automatically. Is there something...
Is there a way of using python and win32com to copy and paste such that python scripts can run in the background and not mess up the "users" copy and paste ability?
from win32com.client import Dispatch
import win32com.client
xlApp = Dispatch("Excel.Application")
xlWb = xlApp.Workbooks.Open(filename_xls)
ws = xlWb.Worksheets(1)
xlApp.Vi...
I've got a django Form which contains a dictionary of strings. I've given the form a submit button and a preview button. When the preview button is pressed after entering some information, a POST is sent, and the strings in the dictionary are automagically recovered (I assume that it's done using session state or something). This is g...