May-26-2019, 05:49 PM
I'm probably making a huge mistake by doing two new things at once: Learn Linux & Learn Python in one package. I apologize if I'm totally in the wrong place for this, but :|
So, I picked up an Elitebook 8560p for cheap ($20), threw in an SSD, stole 16GB ram from another recently deceased machine, and installed Mint Cinnamon (19.1 I think?).
So not only am I trying to figure out Python, but the file system on Linux, how it works, how permissions work, how all of it works. I've gone and done some digging, and I've found myself at a rather irritating and simple problem that I have thus far been unable to get around:
~/PythonProgs$ Hello.py
Hello.py: command not found
Ok.... So lets try this: ~/PythonProgs$ chmod u+x Hello.py
~/PythonProgs$ Hello.py
Hello.py: command not found
Ok, lets go back to the program itself (using Pyzo)
#!/home/halcyon/PythonProgs
print "Hello, world!"
~/PythonProgs$ Hello.py
Hello.py: command not found
Huh. Nope?
~/PythonProgs$ python Hello.py
Hello, world!
Ok, so that works...
Maybe its because my directory isn't sitting right where Python IS, therefore it won't do it?
OK... lets try this
Alter:
#!/home/halcyon/PythonProgs on the .py to: #!/usr/local/lib/python2.7
Do that and save
~/PythonProgs$ Hello.py
Hello.py: command not found
STILL no.
Ok... how about saving hello.py to the python folder?
Nope.
[Errno 13] Permission denied:'/usr/local/lib/python2.7/Hello.py'
How about the other version?
And nope
Nope.
[Errno 13] Permission denied:'/usr/local/lib/python3.6/Hello.py'
Obviously, the permission is a linux issue, but I'm not entirely sure if the inability to do what the tutorials say are STUPID EASY is just a linux issue. Maybe I'm not setting up my #!/<path> correctly here, and just not seeing it because I'm too noob to linux.
So, I picked up an Elitebook 8560p for cheap ($20), threw in an SSD, stole 16GB ram from another recently deceased machine, and installed Mint Cinnamon (19.1 I think?).
So not only am I trying to figure out Python, but the file system on Linux, how it works, how permissions work, how all of it works. I've gone and done some digging, and I've found myself at a rather irritating and simple problem that I have thus far been unable to get around:
~/PythonProgs$ Hello.py
Hello.py: command not found
Ok.... So lets try this: ~/PythonProgs$ chmod u+x Hello.py
~/PythonProgs$ Hello.py
Hello.py: command not found
Ok, lets go back to the program itself (using Pyzo)
#!/home/halcyon/PythonProgs
print "Hello, world!"
~/PythonProgs$ Hello.py
Hello.py: command not found
Huh. Nope?
~/PythonProgs$ python Hello.py
Hello, world!
Ok, so that works...
Maybe its because my directory isn't sitting right where Python IS, therefore it won't do it?
OK... lets try this
Alter:
#!/home/halcyon/PythonProgs on the .py to: #!/usr/local/lib/python2.7
Do that and save
~/PythonProgs$ Hello.py
Hello.py: command not found
STILL no.
Ok... how about saving hello.py to the python folder?
Nope.
[Errno 13] Permission denied:'/usr/local/lib/python2.7/Hello.py'
How about the other version?
And nope
Nope.
[Errno 13] Permission denied:'/usr/local/lib/python3.6/Hello.py'
Obviously, the permission is a linux issue, but I'm not entirely sure if the inability to do what the tutorials say are STUPID EASY is just a linux issue. Maybe I'm not setting up my #!/<path> correctly here, and just not seeing it because I'm too noob to linux.