Jump to content

How do I tell a Python script to use a particular version?


dil_bert

Recommended Posts

How do I tell a Python script to use a particular version?
    
How do I, in the main.py module (presumably), tell Python which interpreter to use?
What I mean is: if I want a particular script to use version 2 of Python to interpret the entire program, how do I do that?

I know that you can run your programs/scripts with different versions by typing "Py -2 file.py" or "Py -3 file.py", but is there any way to run...

 

 

btw  if i do so - it fails


 py -2 cp1.py

 

martin@linux-3645:~/_dev_/python>  py -2 cp1.py
If 'py' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf py
martin@linux-3645:~/_dev_/python>




Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.