Skip to content

Instantly share code, notes, and snippets.

@waltherg
Last active April 15, 2025 10:06
Show Gist options
  • Save waltherg/6071963 to your computer and use it in GitHub Desktop.
Save waltherg/6071963 to your computer and use it in GitHub Desktop.
AUTO 07p run from an iPython Notebook
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Omer80
Copy link

Omer80 commented Jan 11, 2017

Hello ! Thanks for the wonderful tip. I try no to work out how to run AUTO from within a Python script. I haven't done it before and it gave me an error on the !echo. I tried this:

import os
import sys
auto_directory = os.system("echo $AUTO_DIR")
print auto_directory
#auto_directory = !echo $AUTO_DIR
if auto_directory == ['']:
    home = os.system("echo $HOME")
    auto_directory = home[0]+'/auto/07p/'
    sys.path.append(auto_directory+'/python')
else:
    sys.path.append(auto_directory[0] + '/python')
    


import AUTOCommands as ac
import AUTOclui as acl
import interactiveBindings as ib
import runAUTO as ra

But apparently os.system("echo $HOME") does not give me the HOME directory. Do you know what should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment