Startup with Python

2009-04-11 Thread Strato
Hello, I am a beginner in Python , i am not able to set the
environment variable in windows so that i can execute python script
through command prompt , and also i am not able to male *.py as
executable i.e. whenever i double click the file it should run it.
Please help and reply me at [email protected] . Its urgent brother ,
i will wait for your reply.
--
http://mail.python.org/mailman/listinfo/python-list


maybe a stupid question

2008-08-08 Thread Strato

Hi,

I suppose this has already been asked in the list, but I ask anyway:

I want to determine from where my python app is executed, but I want to 
determine the path of the real script file, not the path of the command 
being executed (in case of symlink in a *bin dir in the system).


I explain:

I have an app installed in /usr/lib/python2.5/site-package/MyApp

I have a symlink in /usr/local/bin that points to 
/usr/lib/python2.5/site-package/MyApp/myscript.py


Then, when I launch my script from anywhere using the symlink, how to 
determine that the script is located in 
/usr/lib/python2.5/site-package/MyApp ?


Regards,
Strato


--
http://mail.python.org/mailman/listinfo/python-list


testing if another instance of a script is already running

2008-09-12 Thread Strato

Hi folks,

I want to write some kind of test to check at startup if another 
instance of my script is already running.


I don't want to handle writing of a PID file because it is too 
Unix/Linux specific way to do this, and I need to keep the code to be 
cross-platform.


I think the better way to achieve this is to use some process control, 
but I'm a neebie and I don't see how to do this in a safe and clean way.


Any idea ?

Best regards,
Strato
--
http://mail.python.org/mailman/listinfo/python-list


ConfigParser subclass problem

2008-09-26 Thread Strato

Hi folks,

I think I do something wrong, but I don't see why it doesn't work, so I 
will explain:


I've searched in the list archive and found this thread, that explain 
exactly what I want to have: the options strings returned by 
ConfigParser without being lower cased.


I tryed to reproduce this, by subclassing the SafeConfigParser class, 
like this:


* in my main script:

from MyConfigParser import *

* in the MyConfigParser.py file:
from ConfigParser import SafeConfigParser

class MyConfigParser(SafeConfigParser):
   def optionxform(self, optionstr):
   print "Called the modified version of the class"
   return optionstr

then, when I run the script, every time a calls to my own class is done, 
the print statment is shown in the console, so this may work, but when I 
use the .items() method of the class, I got a lower cased result !


(In my test, using the .items() method is my only try to test the new class)

Does anybody has an idea of what I'm doing wrong ?

Thanks,
Strato

--
http://mail.python.org/mailman/listinfo/python-list