On Thu, 3 Dec 2015 04:18:42 -0800 (PST),
chris.yorkey@gmail.com declaimed the
following:
Team,
Our customer is trying to utilize the Beaglebone Black, running Python
scripts, to program the SimpleLink CC3200 <http://www.ti.com/product/CC3200>
.
Can you answer a question at the bottom of the attached reference document?
(“We could not find documentation on how to run python scripts on
beaglebone-black (Linux) like it has mentioned for Windows. It would be
helpful if we can get this information.”) In other words, what is the
command line to run the script on BBB (like “ImageProgramming.exe -p 2 -i
hib.bin” on Windows)?
Please try by using cut&paste of the TEXT rather than screen
captures... images don't always make it through, and the ones that did
(after I explicitly activated a "download images" function) are illegible.
However, "ImageProgramming.exe" is likely a Windows compiled binary
file -- it is nothing to do with Python. Python scripts normally have a .py
extension, and (presuming the she-bang line is valid, and it is made
executable) could be run on a Linux shell by typing
./thescript.py
at the prompt. Or, the long way
python thescript.py
debian@beaglebone:~$ cat example.py
#!/usr/bin/env python
STRING1 = "Goodbye"
STRING2 = "World!"
print STRING1
for i,c in enumerate(STRING2):
print "%s%s" % ("\t" * i, c)
debian@beaglebone:~$
debian@beaglebone:~$ python example.py
Goodbye
W
o
r
l
d
!
debian@beaglebone:~$
debian@beaglebone:~$ ./example
-bash: ./example: No such file or directory
debian@beaglebone:~$ ./example.py
-bash: ./example.py: Permission denied
debian@beaglebone:~$ ls -ltr
total 12
drwxr-xr-x 2 debian debian 4096 Apr 23 2014 Desktop
drwxr-xr-x 2 debian debian 4096 Apr 23 2014 bin
-rw-r--r-- 1 debian debian 138 Dec 3 20:27 example.py
Note that it is not flagged as "executable"
debian@beaglebone:~$ chmod +x example.py
debian@beaglebone:~$ ls -ltr
total 12
drwxr-xr-x 2 debian debian 4096 Apr 23 2014 Desktop
drwxr-xr-x 2 debian debian 4096 Apr 23 2014 bin
-rwxr-xr-x 1 debian debian 138 Dec 3 20:27 example.py
Now it is executable
debian@beaglebone:~$ ./example.py
Goodbye
W
o
r
l
d
!
debian@beaglebone:~$