python

Free Python decompiler that is not an online service?

Is there a library or application that can decompile Python 2.4+ bytecode to obtain the source code? A search revealed: http://depython.net - an online service that you need to upload a pyc or pyo file to the dis module - allows you to disassemble, but not decompile bytecode decompile.py - works only for 1.5.2 or 2.0 decompyle - an d...

Project structure for Google App Engine

Hi all. I started an application in Google App Engine right when it came out, to play with the technology and work on a pet project that I had been thinking about for a long time but never gotten around to starting. The result is BowlSK. However, as it has grown, and features have been added, it has gotten really difficult to keep thi...

How do I implement a pre-commit hook script in SVN that calls dos2unix to validate checked-in file

I was wondering if anyone here had some experience writing this type of script and if they could give me some pointers. Thanks. ...

Pros/Cons of Django vs Pylons

I'm begining a new webapp in Python. I've narrowed my choices down to Django and Pylons. What are the pros/cons of each? ...

Python: No module named core.exceptions

I'm trying to get Google AppEngine to work on my Debian box and am getting the following error when I try to access my page: <type 'exceptions.ImportError'>: No module named core.exceptions The same app works fine for me when I run it on my other Ubuntu box, so I know it's not a problem with the app itself. However, I need to get it w...

Amazon API library for Python?

What Python libraries do folks use for querying Amazon product data? (Amazon Associates Web Service - used to be called E-Commerce API, or something along those lines). Based on my research, PyAWS (http://pyaws.sourceforge.net/) seems okay, but still pretty raw (and hasn't been updated in a while). Wondering if there's an obvious canon...

Calling python from a c++ program for distribution

I would like to call python script files from my c++ program. I am not sure that the people I will distribute to will have python installed. Basically I'm looking for a .lib file that I can use that has an Apache like distribution license. ...

What is the best way to make an EXE file from a Python program?

I've used several modules to make EXEs for Python. Which options/library is best? It has been some time since I've done this and I'm curious if there are any new options, etc. ...

How do I turn a python program into an .egg file?

How do I turn a python program into an .egg file? ...

What language should i learn as a bridge to C (and derivatives)

The first language i learnt was PHP, but i have more recently picked up python. As these are all 'high-level' languages, i have found them a bit difficult to pick up. I tried a bit of objective-c, and i just gave up. So, what language should i learn to bridge between python to C ...

Can parallel traversals be done in MATLAB just as in Python?

Using the zip function, Python allows for loops to traverse multiple sequences in parallel. for (x,y) in zip(List1, List2): Does MATLAB have an equivalent syntax? If not, what is the best way to iterate over two parallel arrays at the same time using MATLAB? ...

How does one decrypt a PDF with an owner password, but no user password?

Although the PDF specification is available from Adobe, it's not exactly the simplest document to read through. PDF allows documents to be encrypted so that either a user password and/or an owner password is required to do various things with the document (display, print, etc). A common use is to lock a PDF so that end users can read i...

Java -> Python?

Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa? ...

Open source alternative to MATLAB's fmincon function?

Is there an open-source alternative to MATLAB's fmincon function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / NumPy / SciPy and this is the only function I haven't found an equivalent to. A NumPy-based solution would be ideal, but any language will do. ...

What Python way would you suggest to check whois database records?

Hey, I'm trying to get a webservice up and running that actually requires to check whois databases. What I'm doing right now is ugly and I'd like to avoid it as much as I can: I call gwhois command and parse its output. Ugly. I did some search to try to find a pythonic way to do this task. Generally I got quite much nothing - this old ...

In Python, how do I get the path and name of the file that is currently executing?

I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process. For example, let's say I have three files. Using 'execfile', script_1.py calls script_2.py. In turn, script_2.py calls script_3.py. How can I get the file name and path of script_3.py *from code within scrip...

Django Sessions

I'm looking at sessions in Django, and by default they are stored in the database. What are the benefits of filesystem and cache sessions and when should I use them? ...

How do you create a weak reference to an object in Python?

How do you create a weak reference to an object in Python? ...

What is the simplest way to find the difference between 2 times in python?

I have 2 time values which have the type datetime.time. I want to find their difference. The obvious thing to do is t1 - t2, but this doesn't work. It works for objects of type datetime.datetime but not for datetime.time. So what is the best way to do this? ...

How to write a download progress indicator in Python?

I am writing a little application to download files over http (as, for example, described here). I also want to include a little download progress indicator showing the percentage of the download progress. Here is what I came up with: sys.stdout.write(rem_file + "...") urllib.urlretrieve(rem_file, loc_file, reporthook=dlP...