[IPython-user] ipython scripts/noninteractive use?

Jan Nieuwenhuizen janneke at gnu.org
Thu Nov 24 03:28:19 CST 2005


I was hoping to use ipython in python scripts to simplify executing
shell commands, ie, to simplify translating a bash script into python.

For example, how do I use ipython to do something like
                                                                                
    ipython.shell (shell_class=noninteractive,
                   '''
                    cd %(srcdir)s && aclocal
                    cd %(srcdir)s && autoheader
                    ...
                    ''')
                                                                                
as a translation of the sh snippet
              
     set -e                                                                  
     cd $srcdir && aclocal
     cd $srcdir && autoheader
     ...
                                                                                
instead of having to do something like
                                                                                
     my_system ('cd %s && aclocal' % self.srcdir ())
     my_system ('cd %s && autoheader' % self.srcdir ())
     ...
                                                                                
-- Jan.
                                                                                





More information about the IPython-user mailing list