Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
version/compile info
#11
Python 2:
Output:
>>> import sys >>> sys.platform 'linux2' >>>
Python 3:
Output:
>>> import sys >>> sys.platform 'linux' >>>
It's not a bug, it's a 'feature'. The '3' was removed in Python 3.3

See https://bugs.python.org/issue12326 for a long winded 'official' discussion.

For a summary see: https://stackoverflow.com/questions/1041...not-linux3

In the summary link it is suggested to use one of:
sys.platform.startswith('linux')

sys.platform == 'linux' # if you don't need to support older Python versions

It is also mentioned that 'win32' is used on all Windows systems, as apparently the term 'Win64' offends Microsoft.

Lewis
To paraphrase: 'Throw out your dead' code. https://www.youtube.com/watch?v=grbSQ6O6kbs Forward to 1:00
Reply


Messages In This Thread
version/compile info - by Skaperen - May-14-2018, 01:08 AM
RE: version/compile info - by wavic - May-14-2018, 04:21 AM
RE: version/compile info - by Skaperen - May-14-2018, 05:11 AM
RE: version/compile info - by wavic - May-14-2018, 08:19 AM
RE: version/compile info - by DeaD_EyE - May-14-2018, 08:44 AM
RE: version/compile info - by ljmetzger - May-14-2018, 12:43 PM
RE: version/compile info - by ljmetzger - May-14-2018, 02:39 PM
RE: version/compile info - by Skaperen - May-17-2018, 12:48 AM
RE: version/compile info - by ljmetzger - May-17-2018, 01:14 PM
RE: version/compile info - by Skaperen - May-19-2018, 02:56 AM
RE: version/compile info - by ljmetzger - May-19-2018, 01:14 PM
RE: version/compile info - by Skaperen - May-20-2018, 01:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What is all the info in the info window in Idle? Pedroski55 3 725 Jul-08-2023, 11:26 AM
Last Post: DeaD_EyE
  Can I upload a new version without previously deleting ancient version sylas 6 4,291 Nov-08-2017, 03:26 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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