Parsing problems: A journey from a text file to a directory tree

2007-09-16 Thread Martin M.
Hi everybody, Some of my colleagues want me to write a script for easy folder and subfolder creation on the Mac. The script is supposed to scan a text file containing directory trees in the following format: [New client] |-Invoices |-Offers |--Denied |--Accepted |-Delivery notes As you can see,

Re: Self-awareness of imported modules? Do they know where they live?

2005-12-15 Thread Martin M.
) results in: martin% python main.py /Volumes/CodeIsland/Projects/glashaus/glashaus0.1a/lib/being.pyc Now I can use os.path.split() to get the parent directory and os.path.join() to target my AppleScript file. Thanks again! Martin M. -- http://mail.python.org/mailman/listinfo/python-list

Self-awareness of imported modules? Do they know where they live?

2005-12-14 Thread Martin M.
Hi, I have the following question: How can an imported module see/find the path to itself? Background: From my main script I import a module which needs a file (AppleScript) located in the same directory as the imported module. What I do not want is to tell the module the location of the AppleScr