RE: How to read the directory which the actively running python file islocated in?

2006-12-01 Thread Michael Malinowski
Nevermind, I got it using the sys.argv[0] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Malinowski Sent: Friday, December 01, 2006 9:07 AM To: python-list@python.org Subject: How to read the directory which the actively running python file

How to read the directory which the actively running python file is located in?

2006-12-01 Thread Michael Malinowski
Is there a way to read the directory that the currently running python file is located in? Cheers Mike. -- http://mail.python.org/mailman/listinfo/python-list

forcing a definition to be called on attribute change

2006-10-24 Thread Michael Malinowski
Hey All, Apologies if this is a stupidly obvious or simple question. If I have a class with a series of attributes, is there a way to run a function definition in the class whenever a specific attribute is changed? Something like the following class cSphere() : def __init__(sel

dictionaries - returning a key from a value

2006-09-01 Thread Michael Malinowski
Appologies if this is a somewhat simple question, but currently I can return a value from a dictionary using its key by doing :    dDictionary.get( key )   However, I am curious to know if its possible to get the key from giving a value (basically the opposite of what I did above, inste