Check Python version from inside script? Run Pythons script in v2 compatibility mode?

2017-07-06 Thread Ben S. via Python-list
Can I somehow check from inside a Python script if the executing Python engine is major version v2 or v3? I am thinking about a code similar to if (os.python-majorversion<3) print hello else print (hello) Additional question: Is there a way to execute a python script with v3 python engine

"Python launcher" required to run *.py scripts on Windows?

2017-06-26 Thread Ben S. via Python-list
As I observed v3.6.1 installs (on Windows 7) in addition to the core python engine a second program "Python Launcher". As far as I read this component seems to be not necessary since it only aims to facilitate the handling with *.py scripts on Windows. When I always call Python script from Comm

Syntax error for simple script

2017-06-26 Thread Ben S. via Python-list
Sorry for this newbie question: I installed Python v3.6.1 on win 7. Afterwards I tried to execute the following simple python script from webpage http://www.pythonforbeginners.com/code-s...me-script/: Python Code: from datetime import datetime now = datetime.now() mm = str(now.month) dd = st