Python Forum
How do I pick the right python in Linux env?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I pick the right python in Linux env?
#8
(Jun-25-2020, 01:59 AM)MDRI Wrote: The above code is tested in windows Python 3.8.1, but Linux has Python 2
Not anymore in new releases eg Ubuntu/Mint 20.. is Python 2 not included by default.
Quote:Python3 by default
In 20.04 LTS, the python included in the base system is Python 3.8. Python 2.7 has been moved to universe and is not included by default in any new installs.
Python 3 has been in Linux distors bye default for many year,but if you do ./xmltest.py(don't test only with this) or python xmltest.py it will call Python 2 in most distros.
Most use python3 xmltest.py.
Look at Linux Python 3 environment and pyenv Simple Python Version Management.

And go back and look your older Thread,there is no need to use one for loop for each tag element as you do now.
# Example all the child element nodes of the country element
parse = root.xpath('//country/*')
>>> for tag in parse:
...     if tag.text is not None:      
...         print(tag.text)
         
1
2008
141100
4
2011
59900
68
2012
13600
Reply


Messages In This Thread
RE: How do I pick the right python in Linux env? - by snippsat - Jun-27-2020, 08:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is possible to run the python command to call python script on linux? cuten222 6 826 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  How to use a variable in linux command in python code? ilknurg 2 1,636 Mar-14-2022, 07:21 AM
Last Post: ndc85430
  Python syntax in Linux St0rmcr0w 2 54,764 Jul-29-2021, 01:40 PM
Last Post: snippsat
  Login to NordVPN on Linux with python script AGreenPig 2 6,059 Feb-09-2021, 10:44 AM
Last Post: AGreenPig
  how to run linux command with multi pipes by python !! evilcode1 2 6,444 Jan-25-2021, 11:19 AM
Last Post: DeaD_EyE
  where to get portable Python for Linux (Fedora)? python001 5 6,398 Nov-01-2020, 05:23 PM
Last Post: Larz60+
  Python in Linux environment on RPI kendias 22 11,288 Sep-05-2020, 03:04 AM
Last Post: K_Research
  control a linux program with python Fifoux082 9 4,167 May-08-2020, 04:24 PM
Last Post: Fifoux082
  Python version on Linux whois1230 5 3,595 Apr-10-2020, 07:12 PM
Last Post: buran
  how to get PID's of linux commands executed through python modules? Manikandan_PS 4 3,092 Mar-12-2020, 07:16 AM
Last Post: Manikandan_PS

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020