os.system('sh ~/scripts/bingo.sh') this gives an error of Non ascii characters.
Asked
Active
Viewed 45 times
2 Answers
0
"Python 2 uses ascii as the default encoding for source files, which means you must specify another encoding at the top of the file to use non-ascii unicode characters in literals. Python 3 uses utf-8 as the default encoding for source files, so this is less of an issue"
I was able to find this by googling "Python error 'Non ascii characters'" From my understanding this is a good answer
How to make the python interpreter correctly handle non-ASCII characters in string operations?
hope this helps (I am new to coding and was looking into this to help my own understanding of how to avoid this problem for myself. Take what I have to say with a grain of salt.)

Community
- 1
- 1

Joseph Jones
- 5
- 1
0
import subprocess
subprocess.call(["sh","/full/path/bingo.sh"])

badger0053
- 1,179
- 1
- 13
- 19
-
its giving me an error of invalid syntax after the square brackets of invalid syntax subprocess.call(["sh","/full/path/bingo.sh"]) – Saddam Hk Jan 12 '17 at 05:44
-
@SaddamHk Hmm I ran it with no problem. Did you change /full/path/bingo.sh to the actually location on your file system? – badger0053 Jan 12 '17 at 05:51
-
ye i have given it the full path as follows subprocess.call(["sh","/Users/Saddam.Khattak/trytry/bingo.sh"]) – Saddam Hk Jan 12 '17 at 05:56
-
it working now Thank you very much.I was using a text editor due to which it was giving the syntax error but when i used the same command with Python idle its working fine now – Saddam Hk Jan 12 '17 at 06:09
-
@SaddamHk Great News! If this is a solution that worked for you, can you please accept the answer – badger0053 Jan 12 '17 at 15:37