I came across bpython
and tried to installed it on my windows system with the help of cygwin
. Now, whenever I have to access bpython
program I have to open cygwin and than write bpython inside the cygwin shell.
Now I am trying to automate the above process using a python script.So, that as soon as I write bpython.py
in my windows command prompt
it should directly open bpython shell
for me.
My code:
import subprocess
subprocess.call('F:\cygwin\Cygwin.bat')
Using above code I am able to create cygwin
process but than again I have to write bpython
in cygwin terminal to get it working.
So, I was wondering can I directly pass bpython
as an argument
to the F:\cygwin\Cygwin.bat
something like
F:\cygwin\Cygwin.bat bpython
which can directly open the bpython shell.
OR is it possible that
1) First I create cygwin
process with the help of subprocess
module.
2) Than I pass bpython
as an argument.
Both the above task to be done by python program so that the end result is bpython shell.
Output of which bpython
Create a file named
bpython.bat
(contents below) and put it in a directory in your WindowsPATH
: