Mailinglist Archive: opensuse (1467 mails)

< Previous Next >
Re: [opensuse] Running scripts from ~/bin
On 07/02/16 18:31, Anton Aylward wrote:
On 02/07/2016 01:20 PM, Bob Williams wrote:
Running Leap 42.1 with KDE5.

In the past, I'm sure I was able to run scripts that I put in ~/bin from
my home directory. For example:

:~> python script.py

would run if script.py was in ~/bin

It doesn't seem to be working here, even though /home/bob/bin is in my
$PATH.

18:03 bob@hexagon:~> echo $PATH
/home/bob/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/bob/bin:/home/bob/leo-editor:/home/bob/morituri/bin:/home/bob/bin:/home/bob/leo-editor:/home/bob/morituri/bin

I'm not sure why it's there several times.

The error I get is:

18:03 bob@hexagon:~> python3 cdrip.py artists
python3: can't open file 'cdrip.py': [Errno 2] No such file or directory

I'm of an age where memory starts failing, so maybe I've misremembered
something. Any suggestions, please.

if but maybe debugging.

1. Shouldn't it be "#! /usr/bin/python script.py" as teh first line"?
Or simply "usr/bin/python script.py" with no prefix?

2. How does "cdrip.py" come into it?
Is this required in some way by "script.py"?

See also manual page for PYTHONPATH and PYTHONHOME

Sorry to be incoherent. As I said, anno domini!

Script.py doesn't exist, it was a 'generic' example. cdrip.py is a real
file, with #!/usr/bin/python3 as the first line. Thank you for reminding
me of that feature. All is well now.

Thanks

Bob
--
Bob Williams
System: Linux 4.1.15-8-default
Distro: openSUSE 42.1 (x86_64) with KDE Development Platform: 4.14.16

< Previous Next >