python path
Re: python path
The losuj.py 1st line you posted in the previous page is wrong. There is no /bin/python. It's /usr/bin/python.
Re: python path
Aha!
But that still doesn't explain the failure of .losuj-1.py, which calls python correctly. Or does that one work now?

But that still doesn't explain the failure of .losuj-1.py, which calls python correctly. Or does that one work now?
Re: python path
Maybe I would ask about this problem on other forums?
linuxquestions.org?
linuxquestions.org?
Re: python path
Code: Select all
$ cd /tmp
$ mkdir mydir
$ cd mydir
$ echo '#!/usr/bin/env python' > mypythonscript
$ echo 'print "It works!"'>> mypythonscript
$ chmod +x mypythonscipt
$ cd
$ PATH=$PATH:/tmp/mydir
$ mypythonscipt
It works!
Re: python path
peacefully. I thought you ran out of ideas.
gapan you make typo (mypythonscript) from the 5 row.
don't take offense.
In /tmp path your script works
But in another localization not.
gapan you make typo (mypythonscript) from the 5 row.
don't take offense.
In /tmp path your script works
But in another localization not.
stahoo[skrypty_python]$ echo '#!/usr/bin/env python' > mypythonscript
stahoo[skrypty_python]$ echo 'print "It works!"'>> mypythonscript
stahoo[~]$ chmod +x mypythonscript
stahoo[skrypty_python]$ cd
stahoo[~]$ PATH=$PATH:/home/stahoo/skrypty_python
stahoo[~]$ mypythonscript
bash: /home/stahoo/skrypty_python/mypythonscript: Permission denied
stahoo[~]$
Re: python path
Code: Select all
stahoo[skrypty_python]$ echo '#!/usr/bin/env python' > mypythonscript
stahoo[skrypty_python]$ echo 'print "It works!"'>> mypythonscript
stahoo[~]$ chmod +x mypythonscript
Re: python path
yes
Code: Select all
$ cat /etc/fstab
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/sda2 swap swap defaults 0 0
/dev/sda1 / ext4 noatime,defaults 1 1
/dev/sda3 /home ext4 defaults,noexec 1 2
Re: python path
Please post the output of
... and as gapan just said, you need to be in the correct directory when issuing the chmod +x, or use an absolute path. I expect that's it!
EDIT
All the King's horses and all the King's men ...
Code: Select all
ls -ld /home/stahoo/skrypty_python
mount | grep root
EDIT
All the King's horses and all the King's men ...
Last edited by mimosa on 3. Feb 2012, 20:59, edited 1 time in total.
Re: python path
Well, then don't do it, or you won't be able to execute any program in that location (i.e. remove the ',noexec' part an reboot). I don't think that's a default setting for Salix anywhere.ink3 wrote:yesCode: Select all
$ cat /etc/fstab devpts /dev/pts devpts gid=5,mode=620 0 0 proc /proc proc defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 /dev/sda2 swap swap defaults 0 0 /dev/sda1 / ext4 noatime,defaults 1 1 /dev/sda3 /home ext4 defaults,noexec 1 2
Edit:
Even if he got the executable permission right, which he probably did, it's definitely the noexec. I already was thinking about that one earlier but it seemed unlikely at that point, as it's nowhere default.mimosa wrote:... and as gapan just said, you need to be in the correct directory when issuing the chmod +x, or use an absolute path. I expect that's it!