Python is a dynamically and strongly typed programming language that encourages readability.
Questions tagged [python]
1743 questions
4
votes
2 answers
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:
^ …

agentofuser
- 557
- 3
- 6
- 14
4
votes
0 answers
What is “python -c import pty;pty.spawn(”bash“) ” doing?
There's a process running on a server I'm using, and lots of people have access to.
When I do top I see it taking up ~99% of the CPU.
with ps aux I can see that the command in question is:
python -c import pty;pty.spawn("bash")
I read the docs and…

Paul
- 173
- 2
- 2
- 9
4
votes
3 answers
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 within Django.
I know there's a module called celery…

Ram Rachum
- 5,231
- 7
- 34
- 46
4
votes
1 answer
Apache mod_wsgi installation error
I'm running CentOS 6.7, I'm trying to install mod_wsgi (https://code.google.com/p/modwsgi/)
Normally I'd just do:
yum install mod_wsgi
But since I need to make sure it compiles under Python 2.7 (as opposed to CentOS default Python 2.6 version), I…

Jorg Ancrath
- 249
- 4
- 9
4
votes
1 answer
What's the difference between running Python web applications in normal way and running them under wsgi?
I know that in order to run a Python web application(an application developed with frameworks such as Flask & Django) on the server, you need to deploy it using things such as uwsgi, wsgi.. gunicorn.. etc, and configure it to run with the web…

userofserver
- 43
- 4
4
votes
2 answers
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 recommendations for lighttpd and fastcgi. Is this setup faster…

BrainCore
- 161
- 1
- 3
4
votes
3 answers
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 my system to use 32bit Python for just this…

erikcw
- 697
- 14
- 22
4
votes
1 answer
SPF issue with SpamAssassin
I have an internal management app for a small company, written in Python and running on a Linode VPS, with which users can send occasional emails to their customers. The emails are quite straightforward: a text part (i.e. not HTML) with a PDF…

cjauvin
- 141
- 1
- 4
4
votes
2 answers
debian python2.6 as default?
is it possible to set the default python to 2.6 for debian lenny somehow?

chiggsy
- 1,586
- 1
- 15
- 20
4
votes
2 answers
Writing a fail2ban multiline regex
I've got some troublesome hosts trying it on with an SSH server I run, and I'm trying to ban them using fail2ban. Problem is, I haven't done much work with regexes, and even less with Python regexes.
Here are the troublesome lines in my…

ticktockhouse
- 731
- 1
- 10
- 18
4
votes
1 answer
Using collectd with Python 3
I'd like to use the Python 3 interpreter within collectd, but there's no (documented) option to set the path or the version of the interpreter, and it defaults to the Python 2 interpreter that's also installed on my system (at…
user186340
4
votes
1 answer
Python script succeeds manually but fails on crontab
So I'm currently trying to get a script working but it's behaving differently when I run it manually than when I run it from crontab. Basically, I have a reverse ssh tunnel set up from one server to another, and in order to verify that my tunnel is…

tparrott
- 185
- 1
- 3
- 9
4
votes
1 answer
Saltstack iterate through second level pillar data
I might be missing something or this might just be the wrong way to layout pillar data.
I want to iterate through the second level of pillar data.
Pillar example:
repo:
Option1:
version1:
display_name: "abcde"
…

Joseph Gardner
- 41
- 1
- 1
- 7
4
votes
1 answer
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 projects as well, we don't have time to build a nice…
whalesalad
4
votes
1 answer
Process monitoring and service manager for Python web application
We're setting up a Python web application using the CherryPy web server on a bunch of Linux servers (it's behind an nginx load balancer sending traffic to the various servers). We're in the process of switching from Windows servers to Linux servers,…

Ben Hoyt
- 143
- 1
- 7