Saturday, February 24, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 6768  / 2 Years ago, tue, july 12, 2022, 4:21:53

I'm trying to write a simple Python script using Geany. This IDE will automatically compile the code I write but I'm not sure which version of Python it is using. If I enter python --version in the command line I get:



Python 2.7.3


but if I enter python3 I get:



Python 3.2.3 (default, Oct 19 2012, 19:53:16) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>


Does Ubuntu come with both versions? If so, which one is Geany using to compile?


More From » python

 Answers
1

Ubuntu comes with both versions, yes. The python command will always point to a Python 2.x version, and python3 will always point to the default Python 3.x version. The python command will never point to Python 3.x.



I'm not sure what Geany uses exactly, but I would suspect it uses Python 2.x (and thus probably puts #!/usr/bin/python (or should put if it uses /usr/bin/env python instead), in the scripts it generates.


[#32062] Thursday, July 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atelti

Total Points: 194
Total Questions: 129
Total Answers: 110

Location: North Korea
Member since Tue, Jun 16, 2020
4 Years ago
;