2to3.sh 447 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash
#
#BOP
# !DESCRIPTION:
# Convert to python 3. The script converts the file in the file 
# argument to python. It creates the converted file in th py3 sub-folder.
# Additionaly the shell invokation will be changed to 
# explicitly invoke python3.
#EOP

file=PyProTex.py

mkdir -p py3
2to3 -p -n -w -o py3 $file
# make the shell invokation python3 instead of python
Momme Butenschoen's avatar
Momme Butenschoen committed
16
sed -i "s/\#\!\/usr\/bin\/python\b/\#\!\/usr\/bin\/python3/" py3/$file