Python is a dynamically and strongly typed programming language that encourages readability.

learn more… | top users | synonyms

1
vote
3answers
2k views

Best PGP/GPG Encrypt/Decrypt Script

Is there are good default python or simple shell script that I can use to encrypt and decrypt files via PGP/GPG? I would be running this script every 5 minutes.
1
vote
2answers
203 views

Best FTP Transfer Script

I am looking for a robust FTP transfer script that I can use with cron, any recommendations? I would love a script in Python that could run in the background.
1
vote
2answers
234 views

Starting all mod_wsgi processes

mod_wsgi processes seems to be lazily started i.e. on request. However, I prefer to start all the processes from the beginning because the process start up time is long. Is there a configuration ...
1
vote
3answers
757 views

Reloading mod_wsgi processes safely in production

Is there a way to safely restart mod_wsgi processes on demand, possibly running on multiple machines? I'm serving a django app with mod_wsgi in daemon mode with apache: WSGIDaemonProcess myapp ...
0
votes
1answer
1k views

Delete files older than X days from remote FTP server

My backups are stored on remote FTP server. I'm looking for a universal way to clean-up the FTP directory using bash or python. Any help would be appreciated. Edited: I have only FTP access to the ...
0
votes
5answers
3k views

In CentOS, how do I update Python 2.4.3 to 2.5?

I want Python 2.5, not 3.0. Can I use yum update for this?
0
votes
2answers
505 views

CherryPy (or other Python framework) with FastCGI on shared host

I am trying to configure the Python mini-framework CherryPy with FastCGI (actually fcgid) on Apache. I am on a shared host, so I don't have access to httpd.conf, just htaccess. I have followed these ...
2
votes
5answers
2k views

How to copy /etc/hosts to all my machines?

import os, sys, time servers = ['dev','admin','db1'] for s in servers: cmd = 'scp /etc/hosts regular_user@%s:/etc/hosts' % s print cmd os.system(cmd) I have written this script to copy ...
3
votes
3answers
6k views

PYTHONPATH environment variable…how do I make every subdirectory afterwards?

I currently do this: PYTHONPATH=/home/$USER:/home/$USER/respository:/home/$USER/repository/python-stuff How can I make it so that the PYTHONPATH can include everything subdirectory? PYTHONPATH = ...
0
votes
1answer
94 views

server datetime value jumps

would anyone give insight on this datetime issue: My web-application (on centos/apache/wsgi/django) shows different current time (datetime.datetime.now()) from call to call - I'm not asking why the ...
2
votes
1answer
837 views

Running Web.py as an IIS CGI Script

I recently wrote a web.py-based stand alone web service. Due to unforeseen circumstances, the service has to run through IIS. I've heard that it's possible to run web.py as a CGI in IIS, but I'm ...
2
votes
2answers
4k views

How would you set up wildcard subdomains with nginx and tornado web server?

How would someone go about setting up wildcard sub-domains with the suggested Tornado deployment? Specifically for SaaS apps that would allow users to have http://username.example.com/ As well as ...
2
votes
1answer
225 views

Correcting “Python support for SSL and HTTPS is not installed”

I was working with mercurial tonight on Apple's OS X (10.5), and received this error message while attempting to clone from a repository over SSL: Python support for SSL and HTTPS is not installed ...
0
votes
1answer
7k views

/usr/bin/env: python2.5: No such file or directory

I'm trying to play with Cloudera's Distribution for Hadoop on my EC2 account. For configuring it i'm using THIS tutorial. Everything seems to me fine but when I'm trying to run hadoop-ec2 I'm ...
4
votes
2answers
6k views

easy_install'ing under different Python version

I'm trying to easy_install a Python 2.5 package, but I've also got Python 3.1 installed, so I get a syntax error: except pkg_resources.VersionConflict, e: ...
0
votes
1answer
467 views

Why doesn't memcache work?

from django.core.cache import cache def testcache(): cache.set('test','I am putting this message in',3333) print cache.get('test') It just prints "None" This is in "ps aux": ...
4
votes
3answers
2k views

Scheduling tasks with Django

I have a Django website, and I want to have a certain piece of Python code run at regular intervals. What would be a good way to do that? I know I can cron, but I would prefer the solution to be ...
-1
votes
1answer
185 views

Memcache and Python

I installed Memcache doing this: gunzip memcached-1.2.1.tar.gz tar -xvf memcached-1.2.1.tar cd memcached-1.2.1 ./configure make make install Now, what exactly is the next step? (for Python) I know ...
4
votes
3answers
127 views

Openerp wIth Ubuntu 9.04

I had Ubuntu 8.10. I upgrade it to 9.04. I have Openerp5.0 server/client/web. It worked on 8.10 but not with 9.04. Now when I try to launch my server using: ./openerp-server.py I have this error: ...
1
vote
1answer
89 views

Getting waaay too many “Spawning Local” fastcgi messages

I've got Lighttpd running 7 Python apps via fastcgi on an Ubuntu server. I turned on fastcgi debugging in the Lighttpd configuration and noticed something very weird in the logs: Normally, when you ...
0
votes
3answers
3k views

Compile Python 3.1.1 with --enable-shared

This is a two pronged question... The context of the question is getting a good Python 3.1.1 build to use with building and running mod_wsgi. See this document for more information on why a shared ...
2
votes
5answers
1k views

Why doesn't my python script keep running when I use &

I have my gameServer.py script running remotely through PuTTy. gameServer.py looks like this: while True : (( listen for packets )) (( send all packets to all clients )) WHEN I execute the ...
0
votes
2answers
214 views

Why doesn't my python process die?

I have a simple python game script on my server which runs a loop like: while True : (( listen for packets )) (( send packets back to all connected clients )) I launch this script with ...
0
votes
2answers
576 views

nginx and Server-Side Scripting/CGI

Hey all, I've read up on the wonders of nginx the last few days and recently downloaded it....they only question I have is how exactly do you run files on it? I went to localhost in my browser, and ...
0
votes
1answer
2k views

mod_fcgid + Python + Apache 2.2 / RHEL 5 : output to error_log, not browser

I'm trying to get a Django + mod_fcgid setup working (mod_wsgi is tricky as I have a statically-linked Python. Don't ask.) While this was trivial on my Mac OS X development box, getting it running on ...
1
vote
1answer
773 views

configuring default PYTHONPATH

I have Django application and few Django commands that I would execute through cronjobs on CentOS 5. Recently I updated my python-setuptools package, which in-turn update python-devel packages. ...
4
votes
2answers
2k views

Better webserver performance for Python Django: Apache mod_wsgi or Lighttpd fastcgi

I am currently running a high-traffic python/django website using Apache and mod_wsgi. I'm hoping that there's a faster webserver configuration out there, and I've heard a fair number of ...
2
votes
3answers
1k views

Temporarily set ENV variable for just one shell command?

Is it possible to set an ENV variable for just one shell command (ie make it expire right after the command executes)? For example: export VERSIONER_PYTHON_PREFER_32_BIT=yes winpdb I'd like to set ...
0
votes
3answers
1k views

How to remove a Python service in Windows?

I have a custom Python package which we are installing to several Windows platforms (XP, 2003, 2008). During setup, this command is run which registers a service: python.exe setup.py install What ...
1
vote
1answer
1k views

Installing the MySQLdb Python package

I'm trying to install the MySQLdb Python package on my CentOS 5.1 machine, without success. At first I tried using easy_install, but the version it installed was 1.2.1, which was too old for Django, ...
1
vote
2answers
821 views

Is there a work around for the “Permission denied” error from urllib2.urlopen?

I'm running some Python code which uses urllib2.urlopen which works fine when run as the user, root (Linux). However, it doesn't work when run as user apache (we're running it through apache version ...
4
votes
2answers
5k views

debian python2.6 as default?

is it possible to set the default python to 2.6 for debian lenny somehow?
1
vote
5answers
4k views

How do I create subdomain names dynamically?

I would like to be able to create and remove subdomain name dynamically using scripting languages such as PHP, Python, Perl or others. I am using Apache as a web server Example: ...
1
vote
5answers
4k views

You don’t have permission to access /index.py on this server

I am setting up a simple test page in Python. I only have two files: .htaccess and index.py. (Permissions for both set to 755) I get a 403 Forbidden error when trying to view the page - how can I fix ...
1
vote
1answer
119 views

How do I migrate from Python virtualdev environment to a Apache mod-python environment?

How do I migrate from Python virtualdev environment to a Apache mod-python environment? I couldn't find a link anywhere on the internet that describes this. My config.py file is in the root of my ...
0
votes
2answers
3k views

fedora /usr/lib vs /usr/lib64

It seems i have two python2.6 folders located in /usr/lib vs /usr/lib64 respectively. Most python stuff (source) is in /usr/lib64/python2.6 but when in installed packages they have been put into ...
3
votes
1answer
790 views

Running fastcgi->php for a blog subfolder, while rest of site is fastcgi->django

Sort of an odd question but should be pretty easy to solve. I am developing a Django website right now and the client wants a Wordpress blog as well. Because we're under the gun and have other ...
1
vote
3answers
2k views

Downloading php files from python simple http server

I started python -m SimpleHTTPServer on one computer on lan and used wget to download php files from it to another. As far as i see, they seem to be downloaded correctly - i got php sources instead of ...
4
votes
2answers
1k views

Which Linux distro should I use for Apache, mod_wsgi, Python, Django, PostgreSQL deployment?

Currently we are running CentOS for our production servers. Wer're deploying Django projects with Apache 2.2, mod_wsgi and PostgreSQL. We are in the process of making Python 2.5 the default version. ...
0
votes
2answers
861 views

Perl script works with Apache piped logs but not Python script

I need to port my Perl log handling script to Python. Here is a simple example of a Perl script I can use: #!/usr/local/bin/perl $|=1; # Use unbuffered output while(<>) { system("beep"); } ...
0
votes
1answer
1k views

Ubuntu: reinstalling jpeg library

I do not know alot about linux so please take a bit longer time trying to figure out what i am asking for. background story can be read here : ...
3
votes
11answers
3k views

Cron job fails silently

I've got a python script that I want to run via crontab. My crontab looks like this: 5,20,35,50 * * * * /var/www/django-apps/callreport/util.py That script is set up to parse a bunch of flat files ...
0
votes
3answers
1k views

Extracting zope data.fs

I had a zope/plone site where I stored pictures and videos from several users, but I want to move the content to another site now. What is the easiest way to extract content of Zope's data.fs? I heard ...
0
votes
3answers
891 views

How to access git:// protocol from GitPython

I am writing an app to manage git repos using the GitPython module. It works fine for my local repos but I can't get it to work with the git:// protocol. It takes my git://address-to-repo as a ...
4
votes
3answers
5k views

Uninstall Python packages built from source

How do I uninstall Python packages that have been built from source and installed via... python setup.py build python setup.py install ?
1
vote
3answers
362 views

How to diagnose erratic disk behavior?

I have a web site with users lighttpd and CGI scripts. After upgrading to Fedora 11 (ext4) the disc access became erratic. The timing of python -c 'import cgi' varies between 0.1 to almost 10 ...
0
votes
2answers
250 views

How to Compile Mod_Python 3.3.1 for Python 2.6 and Apache 2.2 on Windows?

I have no experience compiling code other than using Visual Studio's Build command. I am hoping we can create a step by step guide for compiling mod_python on windows. Please be as descriptive as ...
2
votes
3answers
121 views

To know whether my Uni can run Python web applications

I am completing my first database project. I am going to set up mod_wsgi to Apache such that I can run Python webframework on my Uni's servers. I am not sure whether my Uni has those tools or not. My ...
0
votes
1answer
299 views

Launching a process on startup in ubuntu fails to start other processes

On Ubuntu Server I've written a c++ program which launches another process which is in python. The c++ process runs fine on startup but the python process never launches. It gets created and when I ...
0
votes
2answers
495 views

win32api.dll Missing

I am trying to start a Buildbot Buildslave on a Windows XP virtual machine: python buildbot start . ImportError: No module named win32api. Google tells me that win32api is win32api.dll. I ...