text
stringlengths
226
34.5k
Integration issue with PyObjC and TKinter Question: The following simple code: from PyObjCTools import AppHelper import AppKit import Tkinter class App(AppKit.NSApplication): def finishLaunching(self): self.root=Tkinter.Tk() _=App.sharedApplication() ...
How to Calculate the number of days in the year(s) between 2 dates in python Question: I'll try to explain what I need with an example: date 1 : 1 january 2000 date 2 : 17 november 2006 -> now I want to know how many days there are between date 1 and date 2 in the year 2000, 2001, ..., 2006 so I need something th...
Threading issue with instance variables Question: So it seems I'm misunderstanding some basic stuff about Python. Passing an instance variable into a function should only pass a reference to the object itself, so in case the object is immutable doing something like `self.var = "something"; foo(self.var)` shouldn't chan...
building executable using python,vtk and py2exe Question: Is it possible to create a binary executable with py2exe for vtk? Could someone provide a minimum working example or at least some hints? Py2exe is not necessary. If there is a working solution on other similar programs (bbfreeze etc) I am intrested too. Answ...
Does haskell have a splat operator like python/ruby? Question: In python / ruby (and others, I'm sure). you can prefix an enumerable with * ("splat") to use it as an argument list. e.g in python: >>> def foo(a,b): return a + b >>> foo(1,2) 3 >>> tup = (1,2) >>> foo(*tup) 3 Is th...
Retrieve plain text JSON, insert into JavaScript Question: I have a URL `http://myapp.com/get_data` that returns an `application/json` `Content-Type`. When I browse to that URL, I'd get a plain-text JSON array in my browser window [[key, value], [key, value], [key, value], ...] I als...
wxPython: Disable a notebook tab? Question: Is there anyway to disable a notebook tab? Like you can with the Widgets themselves? I have a long process I kick off, and while it should be pretty self-explanatory for those looking at it, I want to be able to prevent the user from mucking around in other tabs until the pro...
Accessing an RFID reader via a computer from a server Question: On a computer I want to run a web-based application which is served by a server and this application have to access an RFID reader. I have set this computer to connect to the server via wireless LAN and connect to the RFID reader via an Ethernet cable (tr...
Given two python lists of same length. How to return the best matches of similar values? Question: Given are two python lists with strings in them (names of persons): list_1 = ['J. Payne', 'George Bush', 'Billy Idol', 'M Stuart', 'Luc van den Bergen'] list_2 = ['John Payne', 'George W. Bush', 'Billy ...
Eclipse - interactive shell for python not working Question: I've installed and configured Pydev with Eclipse but when I try to use interactive shell I get errors. Can someone have a look and advise? Code for two functions: def convert_milage(t): # t - number of miles per 1 gallon litersPer100K...
Perl Compatible Regular Expression (PCRE) in Python Question: I have to parse some strings based on PCRE in Python and I've no idea how to do that. Strings I want to parse looks like : match mysql m/^.\0\0\0\n(4\.[-.\w]+)\0...\0/s p/MySQL/ i/$1/ In this example, I have to get this different items ...
cannot urlencode() after storing QueryDict in session Question: I tried to post this to django-users group ( <http://groups.google.com/group/django- users/browse_thread/thread/8572d7f4075cfe0e> ) but got no responses. Maybe here I will get more help. I store `request.GET` in session: request.session['qu...
webapp2 + jinja2: How can i get uri_for() working in jinja2-views Question: How can i add pass Model-Specific urls to the Template. Let's say, i want to build an edit-link. I would guess, using the uri_for() function would be an easy approach. But the following gives me "UndefinedError: 'webapp2' is undefined" ...
rpy2 plot problem Question: I use rpy2-2.0.8, R-2.11.1, Python-2.6.2 on Windows XP. When I run this script, output image is filled with text message. I suppose this message is function definition of clusplot. [test.py] #!/usr/bin/env python # -*- mode: python -*- -*- coding: utf-8 -*- impo...
How do closures work in runpy? Question: I get unexpected behaviour when I try to run methods defined in a file loaded using the [runpy](http://docs.python.org/library/runpy.html) module. The methods do not see any variables (including imported modules) defined outside of that method. Here is how I am doing it: ...
django-haystack problem when saving query in session Question: I want to save the user input in my view, I don't know how to do it redefining the searchview so I did this: request.session['q']=request.GET.get('q') from haystack.views import SearchView search_view = SearchView(template = tem...
Add django model manager code-completion to Komodo Question: I have been using ActiveState Komodo for a while and while most of the code- completion is spot on it lacks the code completion from Django's model manager. I have included the Django directory in my `PYTHONPATH` and get most of the code completion, the nota...
Using PIL to fill empty image space with nearby colors (aka inpainting) Question: I create an image with PIL: ![example image](http://i.stack.imgur.com/uEPqc.png) I need to fill in the empty space (depicted as black). I could easily fill it with a static color, but what I'd like to do is fill the pixels in with nearb...
Repeatedly extract a line between two delimiters in a text file, Python Question: I have a text file in the following format: DELIMITER1 extract me extract me extract me DELIMITER2 I'd like to extract every block of `extract me`s between DELIMITER1 and DELIMITER2 in the .txt file T...
Create PDF with (resized) PNG images using Pycairo - rescaling Surface issue Question: I have som PNG image links that I want to download, "convert to thumbnails" and save to PDF using Python and Cairo. Now, I have a working code, but I don't know how to control image size on paper. Is there a way to resize a PyCairo ...
PyQt4: Interrupt QThread exec when GUI is closed Question: I have a PyQt4 GUI that has three threads. One thread is a data source, it provides numpy arrays of data. The next thread is a calculation thread, it takes the numpy array (or multiple numpy arrays) via a Python `Queue.Queue` and calculates what will be display...
PYTHON: How to take a .txt file as input from user using raw_input in Python and then read that file row wise? Question: I want to take a .txt file as input from user through `raw_input`. Once the input is taken, I want the txt file name given by user to be accessed and the contents from it written into another file (...
Windows - running .py directly vs running python blah.py behaves differently Question: I have a python script that uses subprocess: import subprocess print "Running stuff" subprocess.check_call(["do_stuff.bat"]) print "Stuff run" If this was named blah.py, and I run (from a command prom...
Easy_install and Pip doesn't work Question: Easy_install and Pip doesn't work anymore on python 2.7, when I try to do: sudo easy_install pip I get: Traceback (most recent call last): File "/usr/bin/easy_install", line 5, in <module> from pkg_resources import load_entry_...
Python Read Formatted String Question: I have a file with a number of lines formatted with the following syntax: FIELD POSITION DATA TYPE ------------------------------ COOP ID 1-6 Character LATITUDE 8-15 Real LONGITUDE 17-25 Real ELEVATION 27-32 Real ...
Can't access collection from the shell - SyntaxError: missing ; before statement (shell):1 Question: I wrote a script that uses mongoimport to load csv files into mongodb. When I run this for two similar csv files (of the same type) both upload fine, however I can only access one of them from the mongodb shell. Here is...
NotImplementedException in Silverlight and IronPython Question: i'm hosting IronPython Scripts in one Silverlight Application and i want to run the script and get one System.Windows.Controls.TextBlock object. so i use this ironPython code: import clr clr.AddReferenceByName("System.Windows.Controls, ...
Python dictionary get method in assignment Question: All, I'm looping over a dictionary and counting the values that occur. To do this, I'm using the get method in the assignment statement for another dictionary. This returns a syntax error "can't assign to function call" counts = {} mydict = {'a':[...
In Python, how can I get the file system of a given file path Question: In python, given a directory or file path like /usr/local, I need to get the file system where its available. In some systems it could be / (root) itself and in some others it could be /usr. I tried os.statvfs it doesnt help. Do I have to run the ...
python "help" function: printing docstrings Question: Is there an option to print the output of help('myfun'). The behaviour I'm seeing is that output is printed to std.out and the script waits for user input (i.e. type 'q' to continue). There must be a setting to set this to just dump docstrings. Alternatively, if I...
Appending various strings between two delimeters in one string. python Question: I've been stuck here a day. So I thought to ask the experts. I am reading contents from a file which has data in form |something| |something else| |something_1 something_2 someting_3| |something blah bl...
Python search and replace not replacing properly Question: I have this script that needs to replace a file extension and it is not doing so properly: import os import sys #directory is the directory we will work from directory = "C:\\Users\\joe\\Desktop" os.chdir(directory) ...
python: unpack IBM 32-bit float point Question: I was reading a binary file in python like this: from struct import unpack ns = 1000 f = open("binary_file", 'rb') while True: data = f.read(ns * 4) if data == '': break unpacked = unpack(">%sf" % ns...
Standard error in non-linear regression Question: I have been doing some Monte Carlo physics simulations with Python and I am in unable to determine the standard error for the coefficients of a non-linear least square fit. Initially, I was using SciPy's `scipy.stats.linregress` for my model since I thought it would be...
Text similarity algorithm, optimization concerns Question: I have a django blog, and I am writing a simple similiar text algorithm for it. The code below is the code that I tested with a copy of my blog's database. (Note: code was originally in Turkish, I changed variable names to English for convenience. Therefore, th...
BeautifulSoup installed but not recognized when dev_appserver runs Question: **Update** By adding BeautifulSoup.py to my app source, this error was gone :) Thanks @Ned Deily, that took along time, but was fruitful _**Ignore from here_** I have just one instance of python 2.5 installed with Bea...
Python For Loop Slowing With Time Question: So I'm having a little trouble dealing with for loops in Python - as far as I can tell, they're getting slower with time. I'm looping over a range inside of a range, and as time passes, the loop noticeably slows. This is done inside of a game engine, if it matters. Could anyo...
Average of large number of Dice Rolls in Haskell Question: In an attempt to learn Haskell better, I'm trying to write a program that displays the average value of the sum of 2 die, rolled X number of times. This is fairly simple in C, Java, Python... but I'm stuck in Haskell. Here's a naive attempt: impo...
Python win32com - Read text in a text box to a cell? Question: I would like to read the text from a text box in an Excel File and save that value to a variable. The problem I am having is with the reading of the TextBox. I have tried several methods, this one showed the most promise, as it does not generate an error, b...
program timeout in windows for python Question: Hi I've seen a bunch of questions here on SE that deal with similar issues but I find much of the answers to be unclear and confusing. My question is very simple. How on a Windows platform can I kill a running function after a certain amount of time using Python v2.6? If ...
using python subprocess call to invoke python script Question: I have a python script that needs to invoke another python script in the same directory. I did this: from subprocess import call call('somescript.py') I get the following error call('somescript.py') ...
Help calculating Avg and std for excel files saved as CSV Question: I have about 20 excel files saved as CSV in a single folder. Each excel file has numbers saved in the first, second and third columns. I was trying to read the first column for all of the files, second column for all of the file, and third column for a...
Problem importing matplotlib.mlab and .pyplot in python 2.7 on Mac OSX 10.6 Question: I am trying to plot a histogram using matplotlib in Python 2.7 on OSX 10.6 I have verified that I can import numpy, scipy, and matplotlib into python. A sample script on the matplotlib website does #!/usr/bin/env pytho...
Renaming filenames using python Question: I need to simply add the word "_Manual" onto the end of all the files i have in a specific directory Here is the script i am using at the moment - i have no experience with python so this script is a frankenstine of other scripts i had lying around! It doesn't give any error m...
pass session cookies in http header with python urllib2? Question: I'm trying to write a simple script to log into Wikipedia and perform some actions on my user page, using the Mediawiki api. However, I never seem to get past the first login request (from this page: <https://secure.wikimedia.org/wikipedia/en/wiki/Wikip...
Using Python Iterparse For Large XML Files Question: I need to write a parser in Python that can process some extremely large files ( > 2 GB ) on a computer without much memory (only 2 GB). I wanted to use iterparse in lxml to do it. My file is of the format: <item> <title>Item 1</title> <de...
pyodbc returns SQL Server DATE fields as strings Question: I'm using pyodbc to query a SQL Server 2008 database table with columns of DATE type. The resulting rows of data contain date strings rather than python datetime.date or datetime.datetime instances. **This only appears to be an issue for columns of type DATE;...
Python mail: encoded attachments are truncated Question: I'm using the following function to send an email message with two attachments in my python script: import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText ...
Using python datetime.datetime.strptime on windows with BST timezone Question: I need to parse many different dates in many different formats. I am having trouble with the following and wondered if anyopne could explain why; The following works on a linux system: from datetime import datetime dateti...
Deploying Django app using passenger Question: I can get through everything on their wiki - and then I'm lost. <http://wiki.dreamhost.com/Django> I have a blank Django template, and whenever I try to change anything I get a 500 internal server error. I have completely developed my django app locally and just want to ...
psycopg2.ProgrammingError, running script to serialize data of django app from postgres Question: I have a `djano web app` which stores the data about some entries to `postgres db`.To copy the data in db to `json file`s ,I generally use the `python manage.py shell` and use the serialization api as mentioned i django tu...
Can modules with a common package hierarchy mentioned multiple times in my PYTHONPATH? Question: I have two separate projects that share a package name. They run OK as long as they are not both on the PYTHONPATH, but as soon as they both appear one of them cannot find imports in its own project. Example, two projects ...
Python dir() not displaying all modules in a package Question: I'm using python 2.6 and I'm seeing somewhat weird behavior with the `dir()` function. I'm trying to import all the modules from a directory/package for a unittest but when I do a `dir()` on on the folder, I don't get _all_ the modules in that directory. *...
speeding up numpy kronecker products Question: I am working on my first large python project. I have one function which has the following code in it: # EXPAND THE EXPECTED VALUE TO APPLY TO ALL STATES, # THEN UPDATE fullFnMat EV_subset_expand = np.kron(EV_subse...
In Python App Engine How Do I Uniquely Identify An Instance Of My App Running On The Dev SDK? Question: My application relies on an external service that it communicates with using urlfetch. I have multiple developers each running their own instance of my application on their development computers while they add featur...
hasattr(obj, '__iter__') vs collections Question: I've seen a couple posts recommending `isinstance(obj, collections.Sequence)` instead of `hasattr(obj, '__iter__')` to determine if something is a list. [len(object) or hasattr(object, __iter__)?](http://stackoverflow.com/questions/1763507/lenobject-or- hasattrobject-i...
I don't even know what infile > outfile means. How am I supposed to use it? Question: I don't know how to use Python, and I'm trying to use a script on a document. I have no idea how to tell it do this! If I just run the script, this is the message I get: Use: C:\Python27\hun2html.py infile > outfile ...
Python URL variable int add to string Question: pgno = 1 while pgno < 4304: result = urllib.urlopen("http://www.example.comtraderesourcespincode.aspx?" + "&GridInfo=Pincode0"+ pgno) print pgno html = result.read() parser = etree.HTMLParser() ...
Python create/import custom module in same directory Question: I'm trying to create a simple python script and import a couple of custom classes. I'd like to do this as one module. Here is what I have: point/point.py class Point: """etc.""" point/pointlist.py class PointList:...
How to generate a Cocoa-recognized plot using matplotlib in Python on OS X (Leopard preferably) Question: I'm not sure exactly what is going on under the hood, but here is my setup, example code, and problem: ## setup: * snow leopard (10.6.8) * Python 2.7.2 (provide by EPD 7.1-2) * iPython 0.11 (provided by EPD...
Caught DatabaseError while rendering: no such column: bookmarks_bookmark.title Question: Learning django from "learning website development using django". In chapter 3, building a bookmark data model, I followed the instructions and code given except for-- from django.contrib.auth.models import User ...
parallel recursive function in python? Question: How do I parallelize a recursive function in Python? My function looks like this: def f(x, depth): if x==0: return ... else : return [x] + map(lambda x:f(x, depth-1), list_of_values(x)) def list_of_values(x...
Running pdb in daemon mode with WSGI Question: I am running a Python script on Apache 2.2 with mod wsgi. Is it possible to run pdb.set_trace() in a python script using daemon mode in wsgi? **Edit** The reason I want to use daemon mode instead of embedded mode is to have the capability to reload code without having to...
Invalid Python syntax using file.write Question: Trying to learn some geospatial python. More or less following the class notes [here](http://www.gis.usu.edu/~chrisg/python/2009/lectures/ospy_slides1.pdf). [My Code](http://pastebin.com/pp2b0CvF) #!/usr/bin/python # import modules import ogr...
Getting Beaker working with GAE Question: I'm trying to port an app I've been running locally to GAE. The app uses the Bottle.py framework. I use Beaker for session management. I'm a bit of a noob and am having trouble getting Beaker imported properly. Help greatly appreciated. I'm running the ported app using GoogleA...
Django management task won't work on CentOS in crontab or outside project directory Question: On my local machine (Mac OSX 10.6) I wrote a django custom admin command which works great. I can use it both within and outside my project directory just fine. For some reason on my CentOS 5.6 server, it won't work from outsi...
Python List: Is this the best way to remove duplicates while preserving order? Question: > **Possible Duplicates:** > [How do you remove duplicates from a list in Python whilst preserving > order?](http://stackoverflow.com/questions/480214/how-do-you-remove- > duplicates-from-a-list-in-python-whilst-preserving-order...
Total Python Noob: why doesn't this work? Question: I'm working through Learn Python the Hard Way, and trying to _understand_ it rather than just hammer away. I got stuck on Exercise 16, as discussed already on SO here: [Very basic Python question (strings, formats and escapes)](http://stackoverflow.com/questions/6394...
csh stdin to Python stdin? Question: How do you redirect the stdin of a csh script to the stdin of a python script? I have a cgi script I'm writing in csh that runs on a Solaris machine. This csh script is a wrapper to a python script that reads from the stdin (I know, scripting in csh is bad but I'm forced to in this...
HTTPS to HTTP using CherryPy Question: Is it possible for CherryPy to redirect HTTP to HTTPS. Lets for example say the code below is <http://example.com> if someone visits via <https://example.com> I want them to be redirected to the plain HTTP URL (301 redirect maybe?) how do I accomplish this? #!/usr/b...
Scaling embedded matplotlib widget in qt application written in python problem Question: I am writing a simple digital image processing program. To do this I have embedded a mpl widget in my qt application. The user can perform some simple analysis on the image such as box car filter, FFT etc. Every thing is working fi...
How can I use xml.sax module on an executable made with PyInstaller? Question: I want to have my application read a document using xml.sax.parse. Things work fine but when I move the executable to a Windows server 2008 machine things break down. I get an SAXReaderNotAvailable exception with "No parsers found" message. ...
Download file from web in Python 3 Question: I am creating a program that will download a .jar (java) file from a web server, by reading the URL that is specified in the .jad file of the same game/application. I'm using Python 3.2.1 I've managed to extract the URL of the JAR file from the JAD file (every JAD file cont...
regex result filter in python Question: I am working on a program with regexes, I have to filter them but I can't find out how. I want to match every red,xxxx or xxxx,red expression in my string and put the colors xxxx into a group. Here is my code: string = "blue,red red,yellow blue,yellow red,gre...
How to build debian package with CPack to execute setup.py? Question: Until now, my project had only **.cpp** files that were compiled into different binaries and I managed to configure **CPack** to build a proper **debian package** without any problems. Recently I wrote a couple of python applications and added them ...
Problem with C library linked to Python interpreter, on Mac OS X Question: I'm trying to use a C library that is supposed to be available from Python. The library compiles fine on Mac OS X (10.6.0, i386) with GCC (version: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659). When I try to import the pyth...
Why aren't breakpoints working on the Swing Event Dispatch Thread in PyDev? Question: I'm using Jython, Swing, and PyDev (Eclipse). Breakpoints are not being hit on any code that runs on the EDT (aka AWT Event Queue?). This includes: * Functions that are invoked from a Swing event (eg JButton click) * Functions ...
Instantiate all functions in Python Question: Is there a way to do something like this: util.py contains: def add def subtract instantiate.py contains: def instantiate where instantiate does: import util def instantiate(): add = util.add subtr...
Regular expressions - C# behaves differently than Perl / Python Question: Under Python: ttsiod@elrond:~$ python >>> import re >>> a='This is a test' >>> re.sub(r'(.*)', 'George', a) 'George' Under Perl: ttsiod@elrond:~$ perl $a="This is a test"; $a=~s/(.*)/Geo...
How do I get a reference for the current class object? Question: In Python, how do I get a reference to the current class object within a class statement? Example: def setup_class_members(cls, prefix): setattr(cls, prefix+"_var1", "hello") setattr(cls, prefix+"_var2", "goodbye") ...
'No module named' error in Python while importing outside /home directory Question: Probably this is a silly issue, but I haven't been able to figure it out. I'm getting `ImportError: No module named etree.ElementTree` when I write: #!/usr/bin/python3.2 import xml.etree.ElementTree as etree tree...
Convert sslsocket python code to ruby Question: I have such code on python connect to some software by socket: import socket, ssl host = '127.0.0.1' port = 8963 sert_key = '../keys/key.pem' sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_S...
Set up Scrapy framework to run on Python 2.7 Question: Is it possible to select which version of Python is used by Scrapy? I am running Scrapy on Ubuntu 10.04 which ships with Python 2.6. I have Python 2.7 installed on my machine and would like to take advantage of some of the features of this later version but do not ...
Django exception bugging me, don't know how to debug it Question: I recently upgraded to python2.7 and django1.3 and since then Unhandled exception in thread started by <bound method Command.inner_run of <django.core.management.commands.runserver.Command object at 0x109c57490>> Traceback (most recent...
How to clear stdout in Python subprocess? Question: this snippet will ping an ip address in windows and get output line each 2 seconds, however, I found there's a very slowly memory increasement of ping.exe process after run it, if I deploy it to ping 1000 ip parallel, soon it will cause server hang, I think it may bec...
mutagen: how to detect and embed album art in mp3, flac and mp4 Question: I'd like to be able to detect whether an audio file has embedded album art and, if not, add album art to that file. I'm using mutagen 1) Detecting album art. Is there a simpler method than this pseudo code: from mutagen import Fil...
What does a . in an import statement in Python mean? Question: I'm looking over the code for Python's `multiprocessing` module, and it contains this line: from ._multiprocessing import win32, Connection, PipeConnection instead of from _multiprocessing import win32, Connection, PipeCo...
Python dynamic class names Question: > **Possible Duplicate:** > [Dynamic loading of python > modules](http://stackoverflow.com/questions/951124/dynamic-loading-of- > python-modules) > [python: How to add property to a class > dynamically?](http://stackoverflow.com/questions/1325673/python-how-to-add- > property-...
In Python, how do you find the index of the first value greater than a threshold in a sorted list? Question: In Python, how do you find the index of the first value greater than a threshold in a sorted list? I can think of several ways of doing this (linear search, hand-written dichotomy,..), but I'm looking for a cle...
Control a specific pin on the Arduino Uno board using pyserial Question: I have a python code that sends in a pattern, in which a light has to blink in. (say eg. 101010. pattern may vary every time the code is run). when it is executing this infinitely i want an interrupt( again sent by the python code )to save the pre...
Python regex: how to replace each instance of an occurrence with a different value? Question: Suppose I have this string: `s = "blah blah blah"` Using Python regex, how can I replace each instance of "blah" with a different value (e.g. I have a list of values `v = ("1", "2", "3")` Answer: You could use a [`re.sub` c...
Django South ignoring my custom rules Question: I am using a custom Django model field to and widget to render a GoogleMap widget in my admin, i also want to use South with my project to handle database migrations. However after much effort i am unable to generate a custom South rule that fits, this are my custom model...
print redirected to file SOMETIMES results in incomplete printout in python Question: I want to save list to a file so I cycle through it and write it to file. Everything's fine. But SOMETIMES(!?!?) the list is not written entirely, it stops rendering in the middle of the item. No error is raised, it silently continues...
Python: How can I parse { apple: "1" , orange: "2" } into Dictionary? Question: I have received an output , it likes this. { orange: '2', apple: '1', lemon: '3' } I know it is not a standard JSON format, but is it still possible to parse into Python Dictionary type? Is i...
for loop ignores some elements of my list Question: > **Possible Duplicate:** > [Remove items from a list while iterating in > Python](http://stackoverflow.com/questions/1207406/remove-items-from-a-list- > while-iterating-in-python) I want to remove all the dates in a list which are later than a given date. I can't...
python asynchronization Question: Imagine a text file of 20 mb. I am reading char by char and extracting the useful information. I have actually 2 main functions, one is reading the file and the second is extracting the info. Something like this: def reader(path): f = open(path, 'r') sour...
How should I handle working with celeryd_multi from code? Question: So far, I've been working only with `python manage.py celeryd`, starting it like this: `python manage.py celeryd -l info --settings=settings` The code from my view, does this: BinaryExecTask.delay(request.POST["binary_path"]) And...
Iterating a loop with a pause Question: I am working to integrate with an API that has a limit on the number of requests per second. Is there a way, when running a `for` loop in python to delay each cycle? Conceptually, something like -- def function(request): for x in [a,b,c,d,...]: ...
Python pytz Converting a timestamp (string format) from one timezone to another Question: I have a timestamp with timezone information in string format and I would like to convert this to display the correct date/time using my local timezone. So for eg... I have timestamp1 = 2011-08-24 13:39:00 +0800 ...
Python to parse non-standard XML file Question: My input file is actually multiple XML files appending to one file. (It's from [Google Patents](http://commondatastorage.googleapis.com/patents/grantbib/2011/ipgb20110104_wk01.zip)). It has below structure: <?xml version="1.0" encoding="UTF-8"?> <!DOCTY...