Advertisement
goatbar

Untitled

Apr 19th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. gzip -9 calling_stuff.py
  2.  
  3. ipython
  4. import subprocess
  5.  
  6. In [9]: subprocess.call('zcat calling_stuff.py.gz > foo.py', shell=True)
  7. Out[9]: 0
  8.  
  9. In [10]: ls -l foo.py
  10. -rw-r--r--  1 schwehr  staff  143 Apr 19 21:16 foo.py
  11.  
  12. In [11]: cat foo.py
  13. #!/usr/bin/env python
  14.  
  15. def say_hi():
  16.     print 'hi'
  17.  
  18. def my_function():
  19.     say_hi()
  20.     say_hi()
  21.  
  22. if __name__=='__main__':
  23.     my_function()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement