[IPython-user] cluster file syntax

Fernando Perez Fernando.Perez at colorado.edu
Thu Mar 16 13:11:01 CST 2006


Brian Granger wrote:
> Do you think we should have it first look in the cwd?

The right thing to do is:

if os.path.isfile(filename):
   load(filename)
else:
   try:
     load(ipythondir+filename)
   except file_not_found:
     print error_msg

This means that a bare name will be looked up in cwd automatically, and if 
it's a fully qualified path name, it will also work.  ipythondir (which is 
properly computed by ipython on all platforms, honoring user reconfigurations 
and whatnot) will be a fallback.

Cheers,

f




More information about the IPython-user mailing list