sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread gmax2006
Hi, I use RedHat linux. How can I find where exactly the current python script is running? I use this code: #test.py import os,sys print sys.argv os.chdir(os.path.dirname(sys.argv[0])) It doesn't work when I run this command from the directory that test.py is located: python test.py That me

Re: Search within running python scripts

2006-07-24 Thread gmax2006
Simon Forman wrote: > gmax2006 wrote: > > Hi, > > > > Is it possible that a python script finds out whether another instance > > of it is currently running or not? > > > > Thank you, > > Max > > Yes, there are several ways. What OS are you

Search within running python scripts

2006-07-24 Thread gmax2006
Hi, Is it possible that a python script finds out whether another instance of it is currently running or not? Thank you, Max -- http://mail.python.org/mailman/listinfo/python-list

ImportError: libclntsh.so.10.1: cannot open shared object file: Permission denied

2006-07-20 Thread gmax2006
Hi, I am using RedHat Linux 4. and I developed an oracle 10g based application by using cx_Oracle (cx_Oracle-4.1-10g-py23-1.i386.rpm) and Python 2.3.4. When I run the application through direct console connection, It works perfect. But, when I schedule a crontab job to run the application, It lo

Should this be added to MySQLdb FAQ?

2006-07-18 Thread gmax2006
Hi, I went through couple of wrong paths to install MySQLdb on my RedHat box. I was trying to download MySQL client from MySQL.com and also mySQLdb from SourceForge. After some challenges with compile errors and also searching for pre-required RPMs, I found RedHat distribution already contains all

Hard time with installing MySQLdb for Python on Linux

2006-07-14 Thread gmax2006
Hi, I am having hard time with installing MySQLdb on Linux. My Python version is 2.3. I have downloaded "MySQL-python-1.2.1_p2.tar.gz" from sourceforge. The README file asks for MySQL installation. My MySql server is on another box. That is why I think I should to install just the MySql client (a

Re: RedHat: Easiest way to upgrade from Python 2.3 to 2.4

2006-07-13 Thread gmax2006
Fredrik Lundh wrote: > DO NOT do a full install; you'll most likely break RedHat stuff if you > do that. I was expecting an rpm to do the update. This is a sensitive production box. I think I should just continue with Python 2.3. Regards, -- http://mail.python.org/mailman/listinfo/python-list

RedHat: Easiest way to upgrade from Python 2.3 to 2.4

2006-07-13 Thread gmax2006
Hi, My RedHat Linux installation already has Python 2.3 on it. What is the easiest way to upgrade it to 2.4? I use ActiveState python in Windows. Is it the best distribution for Linux as well? Thank you, Max -- http://mail.python.org/mailman/listinfo/python-list

Multiplatform scripts: Can I avoid os.sep?

2006-07-13 Thread gmax2006
Hi, I am developing scripts that must run on both Linux and windows. My scripts contain lots of relative paths (such as log\\log.txt or ctl\\table.ctl) If I use os.sep, it makes the code ugly. Is there any tips or techniques to have Python automatically converts \\ to / when the script runs on Li