Oct-22-2021, 07:58 PM
(This post was last modified: Oct-23-2021, 05:40 PM by ChrisOfBristol.
Edit Reason: Presentation
)
I run my program from the command line like this:
python3 myprogram.py {filename}
where {filename} is the datafile that myprogram processes.
Now I've created and installed it as a package I've tried:
python3
]>>>import mypackage
and
>>>from myapps import mypackage
both run, although obviously since I haven't mentioned the datafile, it won't be found.
I then tried referring to it like this:
>>>import mypackage {filename}
and
>>>from myapps import mypackage {filename}
but the syntax is invalid. Should I have stated that there would be a parameter in one of the files for PIP? Where will the program look for the datafile - the user's current directory?
Some relevant PyPi documentation or forum would be good, but I haven't been able to find either.
[edit: Changed the 'P' in Python in commands to lowercase]
python3 myprogram.py {filename}
where {filename} is the datafile that myprogram processes.
Now I've created and installed it as a package I've tried:
python3
]>>>import mypackage
and
>>>from myapps import mypackage
both run, although obviously since I haven't mentioned the datafile, it won't be found.
I then tried referring to it like this:
>>>import mypackage {filename}
and
>>>from myapps import mypackage {filename}
but the syntax is invalid. Should I have stated that there would be a parameter in one of the files for PIP? Where will the program look for the datafile - the user's current directory?
Some relevant PyPi documentation or forum would be good, but I haven't been able to find either.
[edit: Changed the 'P' in Python in commands to lowercase]