mirror of
https://github.com/rasbt/python_reference.git
synced 2024-12-18 00:00:19 +00:00
autodetect python version
This commit is contained in:
parent
80fb307f24
commit
f71bcde1b3
|
@ -8,8 +8,10 @@
|
|||
# >> python myscript.py
|
||||
|
||||
# prepends !#/usr/bin/python to all .py files
|
||||
|
||||
python_ver=$(which python)
|
||||
find ./ -maxdepth 1 -name "*.py" -exec sed -i.bak '1i\
|
||||
#!/usr/bin/env/python
|
||||
#!/usr/bin/env/python"$python_ver"
|
||||
' {} \;
|
||||
|
||||
# removes temporary files
|
||||
|
|
Loading…
Reference in New Issue
Block a user