Quote:
python /path/to/script/script.py
|
This does work, but I want the file to work independent of folder location.
Quote:
Have you tried using the ./ or ~ path modifiers?
|
python ./script.py works the same. ~ would help, but not much.
Oddly, after trying some things out, it appears that not even the following code will work from KDE (works fine from the console):
#! /bin/sh
echo qwerty >> testing.txt
testing.txt (created earlier) remains blank. Here are the properties for shell_script, according to the dialog:
Type: Shell Script
Permissions:
Code:
Read Write Exec
User X X X
Group X _ X
Others X _ X
Set UID, Set GID, Sticky are all unchecked.
User: paranoia
Group: paranoia
EDIT:
Hey, it works now. I finally thought of looking for this problem in Google including the word "bug", and found this:
http://dot.kde.org/1049507062/1049536268/ which gave me the line I needed to fix my problem. I also found the file testing.txt in ~ that my shell script had been dumping into. Sigh.
Just for anyone else with the same problem, this is my finished shell_script:
#!/bin/sh
cd `dirname $0`
exec python script.py
Make sure your shell script and path to your shell script doesn't have spaces in the name.
EDIT-EDIT:
By changing the script to:
#!/bin/sh
tempname=`dirname "$0"`
exec python "$tempname/script.py"
spaces in the filename or directory name will work.