.py question

Colin Watson cjwatson at ubuntu.com
Tue Apr 23 13:04:16 UTC 2019


On Mon, Apr 22, 2019 at 08:42:15PM -0400, Gene Heskett wrote:
> I have a test equipment device running xenial, and one of the options 
> needs to run "python3 xxx.py" except I have no clue where to put, in the 
> file system, this xxx.py file so that python can find it and execute it.
> 
> So where should I install this file and its passel of cousins?

"python3 xxx.py" just reads the named file from the current working
directory.  Put it in your current directory.  If there are more files
involved, then you're going to need to explain what you mean by "its
passel of cousins" in order for anyone to offer effective advice.

Python programs normally import a number of other modules to do whatever
they need to do.  Such modules may well just be from Python's standard
library (in which case you don't need to do anything special), or they
may be from something installed as a package (ditto except maybe figure
out the right thing to "apt install"), or they may be something
specialised that you need to install yourself, in which case Joel's link
might possibly be helpful but I would rather be inclined to recommend
https://docs.python.org/3/tutorial/venv.html instead.

Try just running the program without any of that first, though.  If any
modules are unavailable then it will tell you.

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list