Linked Questions
14 questions linked to/from Purpose of #!/usr/bin/python3 shebang
1 vote
0 answers
11k views
How to change default version of Python from 2.7 to 3.6? [duplicate]
I have installed python 3.6 and python 2.7. Currently the default version of python running on Terminal is python 2.7. I would like to install a package based on python 3.6. So first I need to change ...
-2 votes
1 answer
366 views
What is the "#!/usr/bin/" line at the top of every .py file [duplicate]
Complete newb here. What exactly is this line "#!/usr/bin/" I see at the top of every.py file in all of the tutorials? I assume it's the location of that particular file? I don't understand the ...
0 votes
2 answers
248 views
How to execute Python modules on MacOS terminal [duplicate]
The problem with this question is that I do not the proper words to refer to my problem. Let me be clear about what I'm not asking. I'm not asking how to execute a python file. I can already do ...
1390 votes
22 answers
1.1m views
Why do people write "#!/usr/bin/env python" on the first line of a Python script?
I see these at the top of Python files: #!/usr/bin/env python #!/usr/bin/env python3 It seems to me that the files run the same without that line.
1130 votes
17 answers
444k views
What is the meaning of "POSIX"?
What exactly is POSIX? I have read the Wikipedia article but I still don't understand.
40 votes
4 answers
19k views
How does kernel get an executable binary file running under linux?
How does kernel get an executable binary file running under linux? It seems a simple question, but anyone can help me dig deep? How the file is loaded to memory and how execution code get started? ...
24 votes
3 answers
10k views
Running a JAR file without directly calling `java`
I am deploying a command-line tool that is written in Java that accepts command-line arguments. I have it packaged as a JAR file because it is convenient to have a single file. The problem is that ...
20 votes
3 answers
83k views
apt-get install for different python versions
I have ubuntu 10.04 with python2.6 by default. I have installed python2.7. When I want to install python packages with apt-get python-<package> it gets installed to python2.6. How can I ...
9 votes
2 answers
21k views
Run Flask using python3 not python
How can you run Flask app which uses a specific version of python? On my env "python" = python2.7 and "python3" = python3.6. I have installed Flask using pip3. I start the app with FLASK_APP=app.py ...
5 votes
3 answers
12k views
Download the new python on MacOS but still got the old version when asking for python version
I am transforming from windows to Macos and want to install python. It came with an old version of python 2.7 in the computer, so I download python 3 using the pyenv install command. But when I input ...
4 votes
2 answers
7k views
AttributeError: 'list' object has no attribute 'copy' in leetcode editor, but in my PyCharm it's no error
I'm using python to solve the 'Longest Common Prefix ' problem in leetcode. Here is my code: class Solution: # @param {string[]} strs # @return {string} def longestCommonPrefix(self, strs): if ...
0 votes
2 answers
6k views
How to specify which version of python to use in npm python-shell node.js
I want to invoke a python script in a js file using python-shell. However the script requires python3 and py2 is always used, while my local development has both py2 and 3 installed. How do i specify ...
-2 votes
1 answer
2k views
simple python password prompt [duplicate]
I've finally decided to start learning python as my first language and so far i love it. I;m using python3 along with IDLE3. When writing a simple password prompt im running into a problem :/ script ...
0 votes
2 answers
1k views
Does the hashbang (#!) have any functionality client side?
I recently learned about the hashbang syntax for writing comments in JavaScript, and need to know if it is or has the potential to be any different then just putting a // at the top of a file. Are ...