Created
October 21, 2011 10:16
-
-
Save soulwire/1303507 to your computer and use it in GitHub Desktop.
Can I access the bash shell that's executing a Python script from within the script?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# myscript.py | |
import subprocess | |
subprocess.call(['alias', 'my_ls=ls']) | |
# In the bash shell | |
$ python myscript.py | |
# Can I use the my_ls alias here? | |
$ my_ls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment