Timeline for What's wrong with this little python script?
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 10, 2018 at 14:32 | comment | added | Seamus |
@goldilocks: Yep - which is the way to go in this case. I suppose I always turn to find out of habit - plus the fact I like coffee . ha ha :)
|
|
Jun 10, 2018 at 10:56 | comment | added | goldilocks♦ |
find / ... and go have a coffee, lol. Executables are always somewhere in one of the $PATH directories (look at echo $PATH ), or else you must prefix them with a path (including ./ ); which is a shortcut for finding the former (see man which , and note there are a few commands that are shell built-ins that either don't have an executable path, or have a path to an executable version that isn't actually used by the shell).
|
|
Jun 10, 2018 at 1:09 | history | edited | Seamus | CC BY-SA 4.0 |
expand & correct answer
|
Jun 9, 2018 at 23:13 | comment | added | Ghanima♦ | Either way it is always a good thing to provide full paths to cron. +1 | |
Jun 9, 2018 at 22:46 | comment | added | Seamus | WaveRipper: First, apologies for the wrong spec on python3. As for the empty file: My guess is that something your script needs hasn't been loaded yet in the boot process. Try this: @reboot ( sleep 30 ; /usr/bin/python3 /home/user/Desktop/log.py ) Please let us know how this works. | |
Jun 9, 2018 at 22:30 | history | edited | Seamus | CC BY-SA 4.0 |
corrected location of python3
|
Jun 9, 2018 at 22:29 | comment | added | Seamus |
@goldilocks oh crap! I copied the wrong line from sudo find / -name python3 ... yes, it is /usr/bin/python3 . My apologies - got in too big a hurry.
|
|
Jun 9, 2018 at 8:50 | comment | added | WaveRipper | Thanks for your hints! With which python3 I was able to locate python3 in /usr/bin/. Unfortunately this did not solve the problem. Note that the script seems to be running, since the output text file is being created at every reboot (if it did not exist before). However the file is empty. | |
Jun 9, 2018 at 2:38 | comment | added | goldilocks♦ |
There's no way that path (/usr/lib/python3 ) is correct, but you should be able to find it with which python3 . It will probably return bin in place of the lib ;)
|
|
Jun 8, 2018 at 23:52 | history | answered | Seamus | CC BY-SA 4.0 |