How to execute python script by terminal?Why is python's “easy_install” installing into the wrong directory?Rollback Python2.7 InstallationOS X Lion mysterious user cron job just does echo “PATH is $PATH”How can I tell Firewall to allow incoming connections for Python running a specific script? (In this case: SickBeard)“Cannot execute binary file” with alias of binaryHow do I change the path that is being searched for launching an application?os 10.11.6 pip install permission errorUnable to locate an executable at “/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/apt” (-1)?
Christmas party and autism
Can I land my aircraft on the grass next to the runway at a public airport?
Now I realize I used too many GFCI outlets. How can I reclaim them?
How can I prevent renaming the arguments to Function[...,...] for making plots of spherical harmonics coloured by phase
Will you be able to hear a supersonic aircraft flying away from you?
Why is the Exchange French considered drawish?
The lecturer supposed to grade my presentation fell asleep while I held it. Should I complain?
Horizontally mirror a brainflak program
Why would a life company agree to a 20-year guaranteed life annuity which is expected to pay out more than the principal?
Origin of the Latin Language?
White marks on garage ceiling
Water Jug Problem in AI
Where do I put nobles/royalty in a scifi military
when "this" is captured by a lambda does it have to be used explicitly
What to do if caught in a physical pentest?
What makes an airport "international"?
Paint Exterior Door that is in Sun
Medium - Rare steak as meal prep ok?
Is it possible to get reverse life insurance?
Getting data from Seagate ST-238R drive
Why use Fourier series instead of Taylor?
How do I experimentally measure the surface area of a rock?
Why do Muslim refugees seek asylum in Europe and not in rich countries in the Middle East?
What are these tiny kidney bean sized things in my rotisserie chicken
How to execute python script by terminal?
Why is python's “easy_install” installing into the wrong directory?Rollback Python2.7 InstallationOS X Lion mysterious user cron job just does echo “PATH is $PATH”How can I tell Firewall to allow incoming connections for Python running a specific script? (In this case: SickBeard)“Cannot execute binary file” with alias of binaryHow do I change the path that is being searched for launching an application?os 10.11.6 pip install permission errorUnable to locate an executable at “/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/apt” (-1)?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I wanted to learn Python, I installed some software. I created a little execution files and none of them will execute. So I've checked my terminal and type basic things like Is
, cd
etc. None of them work
:Users me$ cd
:~ me$ cd
:~ me$ cd /
:/ me$ Is
-bash: Is: command not found
:/ me$ cd ~
:~ me$ cd desktop
:desktop me$
If I type echo $PATH
, here the result:
/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I read many things about how to fix it but I don't understand. For example:
- I don't know how to find the User Folder
- I don't know how to get to the bash.profile
Bear in mind that I am very new to this.
macos terminal bash python
add a comment
|
I wanted to learn Python, I installed some software. I created a little execution files and none of them will execute. So I've checked my terminal and type basic things like Is
, cd
etc. None of them work
:Users me$ cd
:~ me$ cd
:~ me$ cd /
:/ me$ Is
-bash: Is: command not found
:/ me$ cd ~
:~ me$ cd desktop
:desktop me$
If I type echo $PATH
, here the result:
/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I read many things about how to fix it but I don't understand. For example:
- I don't know how to find the User Folder
- I don't know how to get to the bash.profile
Bear in mind that I am very new to this.
macos terminal bash python
add a comment
|
I wanted to learn Python, I installed some software. I created a little execution files and none of them will execute. So I've checked my terminal and type basic things like Is
, cd
etc. None of them work
:Users me$ cd
:~ me$ cd
:~ me$ cd /
:/ me$ Is
-bash: Is: command not found
:/ me$ cd ~
:~ me$ cd desktop
:desktop me$
If I type echo $PATH
, here the result:
/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I read many things about how to fix it but I don't understand. For example:
- I don't know how to find the User Folder
- I don't know how to get to the bash.profile
Bear in mind that I am very new to this.
macos terminal bash python
I wanted to learn Python, I installed some software. I created a little execution files and none of them will execute. So I've checked my terminal and type basic things like Is
, cd
etc. None of them work
:Users me$ cd
:~ me$ cd
:~ me$ cd /
:/ me$ Is
-bash: Is: command not found
:/ me$ cd ~
:~ me$ cd desktop
:desktop me$
If I type echo $PATH
, here the result:
/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I read many things about how to fix it but I don't understand. For example:
- I don't know how to find the User Folder
- I don't know how to get to the bash.profile
Bear in mind that I am very new to this.
macos terminal bash python
macos terminal bash python
edited Aug 9 at 10:55
nohillside♦
58.1k15 gold badges125 silver badges170 bronze badges
58.1k15 gold badges125 silver badges170 bronze badges
asked Aug 9 at 9:37
JeremyCJeremyC
82 bronze badges
82 bronze badges
add a comment
|
add a comment
|
2 Answers
2
active
oldest
votes
If you want to list all files/folders in a directory, you should type ls
not Is
. It is L, not i.
To learn python, you won't need to reach ~/.bash_profile
unless you need to change versions. Just use which python
or python --version
and use the syntax for the version that appears. Or use online compilers for quick testing.
Suppose you have your file learn.py
at Desktop, you type cd ~/Desktop
, type ls
to confirm, and then to run the file as a script, type python learn.py
. To enter python console, type python
and use it.
Wherever your file is, you could type cd
in Terminal, then drag your file into Terminal window and press Enter. Terminal will resolve the path for you.
For further help, refer to Stack Overflow. :)
If you want to see bash profile, open Finder, type command + shift + . to reveal hidden files and then command + shift + G and type ~/.bash_profile
in "Go To". But don't edit it unless required.
1
If location of file is not desktop, u can typecd
and then drag folder into terminal window and typeENTER
. That will bring you there.
– Marco M. von Hagen
Aug 9 at 20:49
2
@MarcoM.vonHagen Might need to point out that you shouldn't actually type ENTER, but rather press the 'Enter' key.
– Glen Yates
Aug 9 at 22:10
1
@GlenYates You are absolut right.<kbd>Enter</kbd>
will result inEnter
-key . But not in comments ;-(
– Marco M. von Hagen
Aug 13 at 14:11
add a comment
|
if python is installed already just go to terminal, go to correct directory and type "python filename.py"
4
Welcome to Ask Different! Please note the author of the question is "very new" to Terminal; they probably don't know what you mean by "go to correct directory".
– Glorfindel♦
Aug 9 at 14:08
In case of 'very new' I would suggest to learnbash shell
before python. That knowledge will be helpful when digging intopython
later on.
– Marco M. von Hagen
Aug 9 at 20:53
1
"if python is installed already " - When won't it be installed?
– user151019
Aug 13 at 20:46
@MarcoM.vonHagen No need for shell - you can do anything in python that shell can do - and it is a more sane syntax. Especially if you are used to GUI
– user151019
Aug 13 at 20:48
add a comment
|
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to list all files/folders in a directory, you should type ls
not Is
. It is L, not i.
To learn python, you won't need to reach ~/.bash_profile
unless you need to change versions. Just use which python
or python --version
and use the syntax for the version that appears. Or use online compilers for quick testing.
Suppose you have your file learn.py
at Desktop, you type cd ~/Desktop
, type ls
to confirm, and then to run the file as a script, type python learn.py
. To enter python console, type python
and use it.
Wherever your file is, you could type cd
in Terminal, then drag your file into Terminal window and press Enter. Terminal will resolve the path for you.
For further help, refer to Stack Overflow. :)
If you want to see bash profile, open Finder, type command + shift + . to reveal hidden files and then command + shift + G and type ~/.bash_profile
in "Go To". But don't edit it unless required.
1
If location of file is not desktop, u can typecd
and then drag folder into terminal window and typeENTER
. That will bring you there.
– Marco M. von Hagen
Aug 9 at 20:49
2
@MarcoM.vonHagen Might need to point out that you shouldn't actually type ENTER, but rather press the 'Enter' key.
– Glen Yates
Aug 9 at 22:10
1
@GlenYates You are absolut right.<kbd>Enter</kbd>
will result inEnter
-key . But not in comments ;-(
– Marco M. von Hagen
Aug 13 at 14:11
add a comment
|
If you want to list all files/folders in a directory, you should type ls
not Is
. It is L, not i.
To learn python, you won't need to reach ~/.bash_profile
unless you need to change versions. Just use which python
or python --version
and use the syntax for the version that appears. Or use online compilers for quick testing.
Suppose you have your file learn.py
at Desktop, you type cd ~/Desktop
, type ls
to confirm, and then to run the file as a script, type python learn.py
. To enter python console, type python
and use it.
Wherever your file is, you could type cd
in Terminal, then drag your file into Terminal window and press Enter. Terminal will resolve the path for you.
For further help, refer to Stack Overflow. :)
If you want to see bash profile, open Finder, type command + shift + . to reveal hidden files and then command + shift + G and type ~/.bash_profile
in "Go To". But don't edit it unless required.
1
If location of file is not desktop, u can typecd
and then drag folder into terminal window and typeENTER
. That will bring you there.
– Marco M. von Hagen
Aug 9 at 20:49
2
@MarcoM.vonHagen Might need to point out that you shouldn't actually type ENTER, but rather press the 'Enter' key.
– Glen Yates
Aug 9 at 22:10
1
@GlenYates You are absolut right.<kbd>Enter</kbd>
will result inEnter
-key . But not in comments ;-(
– Marco M. von Hagen
Aug 13 at 14:11
add a comment
|
If you want to list all files/folders in a directory, you should type ls
not Is
. It is L, not i.
To learn python, you won't need to reach ~/.bash_profile
unless you need to change versions. Just use which python
or python --version
and use the syntax for the version that appears. Or use online compilers for quick testing.
Suppose you have your file learn.py
at Desktop, you type cd ~/Desktop
, type ls
to confirm, and then to run the file as a script, type python learn.py
. To enter python console, type python
and use it.
Wherever your file is, you could type cd
in Terminal, then drag your file into Terminal window and press Enter. Terminal will resolve the path for you.
For further help, refer to Stack Overflow. :)
If you want to see bash profile, open Finder, type command + shift + . to reveal hidden files and then command + shift + G and type ~/.bash_profile
in "Go To". But don't edit it unless required.
If you want to list all files/folders in a directory, you should type ls
not Is
. It is L, not i.
To learn python, you won't need to reach ~/.bash_profile
unless you need to change versions. Just use which python
or python --version
and use the syntax for the version that appears. Or use online compilers for quick testing.
Suppose you have your file learn.py
at Desktop, you type cd ~/Desktop
, type ls
to confirm, and then to run the file as a script, type python learn.py
. To enter python console, type python
and use it.
Wherever your file is, you could type cd
in Terminal, then drag your file into Terminal window and press Enter. Terminal will resolve the path for you.
For further help, refer to Stack Overflow. :)
If you want to see bash profile, open Finder, type command + shift + . to reveal hidden files and then command + shift + G and type ~/.bash_profile
in "Go To". But don't edit it unless required.
edited Aug 13 at 15:46
Marco M. von Hagen
3612 silver badges8 bronze badges
3612 silver badges8 bronze badges
answered Aug 9 at 10:01
ankiiankii
3,5365 gold badges7 silver badges34 bronze badges
3,5365 gold badges7 silver badges34 bronze badges
1
If location of file is not desktop, u can typecd
and then drag folder into terminal window and typeENTER
. That will bring you there.
– Marco M. von Hagen
Aug 9 at 20:49
2
@MarcoM.vonHagen Might need to point out that you shouldn't actually type ENTER, but rather press the 'Enter' key.
– Glen Yates
Aug 9 at 22:10
1
@GlenYates You are absolut right.<kbd>Enter</kbd>
will result inEnter
-key . But not in comments ;-(
– Marco M. von Hagen
Aug 13 at 14:11
add a comment
|
1
If location of file is not desktop, u can typecd
and then drag folder into terminal window and typeENTER
. That will bring you there.
– Marco M. von Hagen
Aug 9 at 20:49
2
@MarcoM.vonHagen Might need to point out that you shouldn't actually type ENTER, but rather press the 'Enter' key.
– Glen Yates
Aug 9 at 22:10
1
@GlenYates You are absolut right.<kbd>Enter</kbd>
will result inEnter
-key . But not in comments ;-(
– Marco M. von Hagen
Aug 13 at 14:11
1
1
If location of file is not desktop, u can type
cd
and then drag folder into terminal window and type ENTER
. That will bring you there.– Marco M. von Hagen
Aug 9 at 20:49
If location of file is not desktop, u can type
cd
and then drag folder into terminal window and type ENTER
. That will bring you there.– Marco M. von Hagen
Aug 9 at 20:49
2
2
@MarcoM.vonHagen Might need to point out that you shouldn't actually type ENTER, but rather press the 'Enter' key.
– Glen Yates
Aug 9 at 22:10
@MarcoM.vonHagen Might need to point out that you shouldn't actually type ENTER, but rather press the 'Enter' key.
– Glen Yates
Aug 9 at 22:10
1
1
@GlenYates You are absolut right.
<kbd>Enter</kbd>
will result in Enter
-key . But not in comments ;-(– Marco M. von Hagen
Aug 13 at 14:11
@GlenYates You are absolut right.
<kbd>Enter</kbd>
will result in Enter
-key . But not in comments ;-(– Marco M. von Hagen
Aug 13 at 14:11
add a comment
|
if python is installed already just go to terminal, go to correct directory and type "python filename.py"
4
Welcome to Ask Different! Please note the author of the question is "very new" to Terminal; they probably don't know what you mean by "go to correct directory".
– Glorfindel♦
Aug 9 at 14:08
In case of 'very new' I would suggest to learnbash shell
before python. That knowledge will be helpful when digging intopython
later on.
– Marco M. von Hagen
Aug 9 at 20:53
1
"if python is installed already " - When won't it be installed?
– user151019
Aug 13 at 20:46
@MarcoM.vonHagen No need for shell - you can do anything in python that shell can do - and it is a more sane syntax. Especially if you are used to GUI
– user151019
Aug 13 at 20:48
add a comment
|
if python is installed already just go to terminal, go to correct directory and type "python filename.py"
4
Welcome to Ask Different! Please note the author of the question is "very new" to Terminal; they probably don't know what you mean by "go to correct directory".
– Glorfindel♦
Aug 9 at 14:08
In case of 'very new' I would suggest to learnbash shell
before python. That knowledge will be helpful when digging intopython
later on.
– Marco M. von Hagen
Aug 9 at 20:53
1
"if python is installed already " - When won't it be installed?
– user151019
Aug 13 at 20:46
@MarcoM.vonHagen No need for shell - you can do anything in python that shell can do - and it is a more sane syntax. Especially if you are used to GUI
– user151019
Aug 13 at 20:48
add a comment
|
if python is installed already just go to terminal, go to correct directory and type "python filename.py"
if python is installed already just go to terminal, go to correct directory and type "python filename.py"
answered Aug 9 at 13:26
utku cevvalutku cevval
396 bronze badges
396 bronze badges
4
Welcome to Ask Different! Please note the author of the question is "very new" to Terminal; they probably don't know what you mean by "go to correct directory".
– Glorfindel♦
Aug 9 at 14:08
In case of 'very new' I would suggest to learnbash shell
before python. That knowledge will be helpful when digging intopython
later on.
– Marco M. von Hagen
Aug 9 at 20:53
1
"if python is installed already " - When won't it be installed?
– user151019
Aug 13 at 20:46
@MarcoM.vonHagen No need for shell - you can do anything in python that shell can do - and it is a more sane syntax. Especially if you are used to GUI
– user151019
Aug 13 at 20:48
add a comment
|
4
Welcome to Ask Different! Please note the author of the question is "very new" to Terminal; they probably don't know what you mean by "go to correct directory".
– Glorfindel♦
Aug 9 at 14:08
In case of 'very new' I would suggest to learnbash shell
before python. That knowledge will be helpful when digging intopython
later on.
– Marco M. von Hagen
Aug 9 at 20:53
1
"if python is installed already " - When won't it be installed?
– user151019
Aug 13 at 20:46
@MarcoM.vonHagen No need for shell - you can do anything in python that shell can do - and it is a more sane syntax. Especially if you are used to GUI
– user151019
Aug 13 at 20:48
4
4
Welcome to Ask Different! Please note the author of the question is "very new" to Terminal; they probably don't know what you mean by "go to correct directory".
– Glorfindel♦
Aug 9 at 14:08
Welcome to Ask Different! Please note the author of the question is "very new" to Terminal; they probably don't know what you mean by "go to correct directory".
– Glorfindel♦
Aug 9 at 14:08
In case of 'very new' I would suggest to learn
bash shell
before python. That knowledge will be helpful when digging into python
later on.– Marco M. von Hagen
Aug 9 at 20:53
In case of 'very new' I would suggest to learn
bash shell
before python. That knowledge will be helpful when digging into python
later on.– Marco M. von Hagen
Aug 9 at 20:53
1
1
"if python is installed already " - When won't it be installed?
– user151019
Aug 13 at 20:46
"if python is installed already " - When won't it be installed?
– user151019
Aug 13 at 20:46
@MarcoM.vonHagen No need for shell - you can do anything in python that shell can do - and it is a more sane syntax. Especially if you are used to GUI
– user151019
Aug 13 at 20:48
@MarcoM.vonHagen No need for shell - you can do anything in python that shell can do - and it is a more sane syntax. Especially if you are used to GUI
– user151019
Aug 13 at 20:48
add a comment
|