On Jul 9, 6:31 pm, brad <[EMAIL PROTECTED]> wrote: > When I use idle or a shell to execute a python script, the script > executes in the directory it is currently in (in this case, my desktop). > However, when using GNOME and right clicking the py script and selecting > 'open with python', the execution occurs in my home directory, not my > desktop. > > Is there a way to force py scripts to always run within the directory > that they reside in? > > Thanks > > Brad > > /home/brad/Desktop/output - python from shell > /home/brad/Desktop/output - python from idle > /home/brad/output - python from Gnome 'right click' open with menu
Interesting. I was wondering about the opposit: being in the parent dir, how can I run a module from a package. (the current behavior when running python dir_name\module.py is to consider the dir_name the current dir and this breaks all imports). I am pretty sure this is answered somewhere, but I must confess that so far I haven't been able to find it :-(. TIA, ./alex -- .w( the_mindstorm )p. -- http://mail.python.org/mailman/listinfo/python-list