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?How to reset the $PATH in terminal OS X El Capitan? tried previous posts but did not workos 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)?Terminal Startup command not found

LeetCode: Pascal's Triangle C#

Is it appropriate for a prospective landlord to ask me for my credit report?

Mathematical uses of string theory

Shouldn't the "credit score" prevent Americans from going deeper and deeper into personal debt?

Why doesn't the Falcon-9 first stage use three legs to land?

Co-author responds to email by mistake cc'ing the EiC

Potential new partner angry about first collaboration - how to answer email to close up this encounter in a graceful manner

Was Tuvok bluffing when he said that Voyager's transporters rendered the Kazon weapons useless?

When translating the law, who ensures that the wording does not change the meaning of the law?

Can pay be witheld for hours cleaning up after closing time?

Nth Problem with TikZ and Extensive Form Games

Science fiction short story where aliens contact a drunk about Earth's impending destruction

How to persuade recruiters to send me the Job Description?

Avoiding racist tropes in fantasy

Justifying the use of directed energy weapons

Why is my Earth simulation slower than the reality?

Was Switzerland really impossible to invade during WW2?

Three Singles in Three Clubs

Ask for a paid taxi in order to arrive as early as possible for an interview within the city

The teacher logged me in as administrator for doing a short task, is the whole system now compromised?

In an emergency, how do I find and share my position?

Is there a limit on how long the casting (speaking aloud part of the spell) of Wish can be?

Vacuum collapse -- why do strong metals implode but glass doesn't?

On the feasibility of space battleships



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?How to reset the $PATH in terminal OS X El Capitan? tried previous posts but did not workos 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)?Terminal Startup command not found






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















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.










share|improve this question


























  • What do you mean by "finding user folder"? pwd for current directory, cd ~/ for going to user directory by terminal. And cmd + up arrow, for going there in Finder.

    – ankiiiiiii
    Aug 9 at 10:34

















1















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.










share|improve this question


























  • What do you mean by "finding user folder"? pwd for current directory, cd ~/ for going to user directory by terminal. And cmd + up arrow, for going there in Finder.

    – ankiiiiiii
    Aug 9 at 10:34













1












1








1








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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 9 at 10:55









nohillside

56.3k14 gold badges118 silver badges166 bronze badges




56.3k14 gold badges118 silver badges166 bronze badges










asked Aug 9 at 9:37









JeremyCJeremyC

82 bronze badges




82 bronze badges















  • What do you mean by "finding user folder"? pwd for current directory, cd ~/ for going to user directory by terminal. And cmd + up arrow, for going there in Finder.

    – ankiiiiiii
    Aug 9 at 10:34

















  • What do you mean by "finding user folder"? pwd for current directory, cd ~/ for going to user directory by terminal. And cmd + up arrow, for going there in Finder.

    – ankiiiiiii
    Aug 9 at 10:34
















What do you mean by "finding user folder"? pwd for current directory, cd ~/ for going to user directory by terminal. And cmd + up arrow, for going there in Finder.

– ankiiiiiii
Aug 9 at 10:34





What do you mean by "finding user folder"? pwd for current directory, cd ~/ for going to user directory by terminal. And cmd + up arrow, for going there in Finder.

– ankiiiiiii
Aug 9 at 10:34










2 Answers
2






active

oldest

votes


















5













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.






share|improve this answer



























  • 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





    @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












  • @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












  • @ankiiiiiii added info into answer.

    – Marco M. von Hagen
    Aug 13 at 14:23


















2













if python is installed already just go to terminal, go to correct directory and type "python filename.py"






share|improve this answer




















  • 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 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











  • "if python is installed already " - When won't it be installed?

    – Mark
    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

    – Mark
    Aug 13 at 20:48




















2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5













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.






share|improve this answer



























  • 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





    @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












  • @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












  • @ankiiiiiii added info into answer.

    – Marco M. von Hagen
    Aug 13 at 14:23















5













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.






share|improve this answer



























  • 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





    @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












  • @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












  • @ankiiiiiii added info into answer.

    – Marco M. von Hagen
    Aug 13 at 14:23













5












5








5







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.






share|improve this answer















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.







share|improve this answer














share|improve this answer



share|improve this answer








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









ankiiiiiiiankiiiiiii

1,7651 gold badge6 silver badges24 bronze badges




1,7651 gold badge6 silver badges24 bronze badges















  • 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





    @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












  • @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












  • @ankiiiiiii added info into answer.

    – Marco M. von Hagen
    Aug 13 at 14:23

















  • 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





    @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












  • @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












  • @ankiiiiiii added info into answer.

    – Marco M. von Hagen
    Aug 13 at 14:23
















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














@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














@ankiiiiiii added info into answer.

– Marco M. von Hagen
Aug 13 at 14:23





@ankiiiiiii added info into answer.

– Marco M. von Hagen
Aug 13 at 14:23













2













if python is installed already just go to terminal, go to correct directory and type "python filename.py"






share|improve this answer




















  • 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 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











  • "if python is installed already " - When won't it be installed?

    – Mark
    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

    – Mark
    Aug 13 at 20:48















2













if python is installed already just go to terminal, go to correct directory and type "python filename.py"






share|improve this answer




















  • 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 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











  • "if python is installed already " - When won't it be installed?

    – Mark
    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

    – Mark
    Aug 13 at 20:48













2












2








2







if python is installed already just go to terminal, go to correct directory and type "python filename.py"






share|improve this answer













if python is installed already just go to terminal, go to correct directory and type "python filename.py"







share|improve this answer












share|improve this answer



share|improve this answer










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 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











  • "if python is installed already " - When won't it be installed?

    – Mark
    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

    – Mark
    Aug 13 at 20:48












  • 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 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











  • "if python is installed already " - When won't it be installed?

    – Mark
    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

    – Mark
    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













"if python is installed already " - When won't it be installed?

– Mark
Aug 13 at 20:46





"if python is installed already " - When won't it be installed?

– Mark
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

– Mark
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

– Mark
Aug 13 at 20:48



Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form