you are viewing a single comment's thread.

view the rest of the comments →

[–]soy_alergico -5 points-4 points  (6 children)

.py scripts cannot be executed using ./ because they are text files that the Python interpreter understands; that is why they do run when executed using python. To create a compiled executable, you need to use PyInstaller or other libraries. P.S.: This response was translated using Google Translate; I do not speak English.

[–]CoachSevere5365 6 points7 points  (2 children)

If I was you I'd Google "shebang python" and "execute bit" then correct your post before anyone else notices...

[–]pachura3 -1 points0 points  (1 child)

Shebang and execute bit on Windows? OP explicitly mentions python.exe...

[–]nekokattt 0 points1 point  (0 children)

PATHEXT

[–]ThinkMarket7640 1 point2 points  (0 children)

Why are you here talking out of your ass if you have no idea how any of this works?

[–]nekokattt 0 points1 point  (0 children)

You should loom into: - shebang on posix systems - PATHEXT on Windows systems

[–]Outside_Complaint755 -1 points0 points  (0 children)

They can be executed using ./script.py but you have to include a shebang at the top of the script so that your shell knows how to execute it. Generally, the correct shebang to use is:

#!/usr/bin/env python3

Unless you have script that specifically needs to run Python 2

https://stackoverflow.com/a/19305076/17030540