Creating command line alias with python
问题 I want to create command line aliases in one of my python scripts. I've tried os.system(), subprocess.call() (with and without shell=True), and subprocess.Popen() but I had no luck with any of these methods. To give you an idea of what I want to do: On the command line I can create this alias: alias hello="echo 'hello world'" I want to be able to run a python script that creates this alias for me instead. Any tips? I'd also be interested in then being able to use this alias within the python