What is python
Python is a high level, interpreted and object-oriented programming language with wide variety of applications in software development.Python is a general purpose language.
Python was invented in 1989 by a Netherlands Citizen called Guid van Rossum who was a computer scientist. Today is one of the top programming language in the world. The current version in python is 3.12.1.
Ifā¦
I wish the setup was as cozy as it this looks but it wasn't. The average estimated time taken is half a day, because of the XCode download. Everything else was pretty straightforward. Here is what I did to install python and set up all the relevant tools for coding:Ā
Downloaded and installed XCode from the Appstore - Mac OS IDE
Got comfy with the terminal, even created a specific folder for CodeĀ
mkdir āCodeā
I then installed the answer to all my installation problems: Homebrew by copy-pasting this to the terminal. Homebrew helps to install everything that I would need for Mac installations.Ā
Given that I already had XCode and Homebrew installed, I figured Python had been installed too and added this command to check which version of python I had. 2.7.10.....sweet!
python --version
I then checked to see if PIP, Pythonās standard manager was installed. This was not the case given I got an error message that mentioned pip was anĀ āunfamiliarā command. To install peep, I wentĀ āSUDOā
sudo easy_install_pip
I then installed VirtualEnv to help with managing projects with conflicting dependencies
pip install virtualenv
Lastly, I downloaded and installed Github.Ā
brew_install_git
And now guess we are ready for the first simple Python program - it should help to automate a task on my computer.Ā
Using python 2.7 and 3 concurrently - the simple way
Itās quite damn simple, actually. The convolution online is ...Ā
Basically, the reason behind it all is that if you look at the executable for both versions, they are both named, python.exe thus whichever was installed first, will just simply be the one activated when you enter python in the cmd.Ā
Given all the new updates, just add python27 to the environment variables, and then change the python 3.3ā²s executable to python3.exe. When you launch in the cmd, just type python3 instead of python. Tadah. PIP will automatically be renamed as PIP3. Thatās it. o.0Ā
Actually a rather simple process despite previous unfortunate attempts.Ā
Download the installer from python, of course. (3.4 is the current version at the time of writing.)Ā There are two varying versions that are being maintained. But since for the purpose of the library that I was using, 3.4 is choice.Ā
Just install the package like a normal installer.Ā
After which, press windows and type cmd in the search bar. This should bring up the command prompt.Ā
Type python in the prompt -- if it says file/direction not found, go on to the next step.Ā
Press windows and type 'system'. Select the 'System' under Control Panel.Ā
This should bring up a dialog box. Select 'Advanced system settings' on the left sidebar. Go to 'Environment Variables'.Ā
Under "User variables for Admin" if path is not created, press 'New..'Ā
For variable - pathĀ
Value -Ā C:\Windows\System32;C:\Python34;C:\Python34\python.exe;C:\Python34\Scripts;
Save changes and return to command prompt. It should run properly when you type python.
To run PIPĀ
The declaration of the above system environment variables makes this possible already. Simple type 'python -m pip' in the command prompt.Ā