1 | initial version |
DSM's answer is good. Another option: from within Sage, you can also do
sage: from sage.misc.misc import sage_makedirs
sage: sage_makedirs('/tmp/new/directory/here')
This will create any intermediate directories as necessary. (This function runs os.makedirs(...)
, along with a little error-checking.)
2 | added preparser info |
DSM's answer is good. Another option: from within Sage, you can also do
sage: from sage.misc.misc import sage_makedirs
sage: sage_makedirs('/tmp/new/directory/here')
This will create any intermediate directories as necessary. (This function runs os.makedirs(...)
, along with a little error-checking.)
Re the preparser: to turn it off, just do preparser(False)
, then execute the command, then turn it back on with preparser(True)
.