Chp:->1 Python <-> Absolute Beginning

Prince

[ Verified Seller ]
Staff member
Trusted Seller
Joined
11 yrs. 6 mth. 26 days
Messages
5,381
Reaction score
18,380
Age
45
Wallet
11,590$
Chapter -1 Introduction to Python
Absolute Beginning(
0x00)Python Installation
To install python, you need to download latest version of python from
Please, Log in or Register to view URLs content!

The download list contains respective installer for cross platforms.
Windows -> .msi
*nix -> .tar.gz
Mac -> .dmg

After installation, if your box is windows, the installation directory would be c:\pythonx where x represent the python version number.
But if your box is *nix (either Unix based or Linux based) it’ll be under /usr/bin/python
For calling python shell anytime ->
Goto Control Panel > System > Advanced > Environment Variables
Then edit PATH, copy this sentence
“;C:\Python33”
If it’s in *nix box it probably pre-installed
You can know if your box has python or not by typing “python –v” in your shell. If the terminal or shell shows the python version, It means that your box has python pre-installed.
Or if shell shows “python command not found” then you don’t have python yet.
I'll will explain *nix installation later.
You can see your python version in
Start Menu -> All programs (win7)
Inside python folder, you will see five files :
IDLE (Python GUI), Module doc, Python (Command line), Python Manual, Uninstall python.
There are two relatively important thing for python:python shell aka Python Interpreter (Python command line)IDLE (Integrated Development Environment) (IDLE Python GUI)
(0x01)Choosing your Editor
You need to choose a good editor. A good editor has syntax highlighting, which is a great advantage in coding.
Python has a special editor -> Pyscripter, which is used by many fellow python programmers. Unfortunately it has only Windows version.
You can use other open source editors such as gedit and Notepad++.
As a piece of advice, don’t ever use the window’s built-in notepad as an editor for newbies, because it doesn’t have syntax highlighting. So here comes the question. Why would you need syntax highlighting? If there’s no syntax highlighting, your coding are more prone to “error” or so called “bugs”. IDLE and Notepad++ has syntax highlighting. And in windows, Pyscripter is highly recommended.

Python script file can be run directly or inside built-in python shell.
Python shell also known as Python interpreter is vital to python programming language, because python is an interpreted language, so interpreter is necessary.
One distinct feature of python language is that you don’t have to wait to finish the whole program to know what the codes does, you can input the codes directly into python shell to see what it does. On the other hand, in cases such as in C language and Java, you need to finish the whole program then compile and then only run, to see what the code does. So isn’t python convenient?

(0x02)Writing your first program -> The helloworld.py
Every new comers to programming language, starts with legendary “hello world” program. Ok let’s try it!
Open your editor. Type in the following codes
#!/usr/bin/env pythonPrint(“Hello World!”)

Then save it as helloworld.py then run it.
In *nix box you need to first give the script execute permission with chmod a+x hello.py
Then run the program. You’ll see Hello World!
Above sentence.
#!/usr… line is called shebang line. It is used to tell the system, from which interpreter we will use to run this script/program.
Print syntax will show the sentence as an output on the screen.

You can type help(syntax) to know what the syntax does. In other words, it’s sort of like man page.


After this Chapter – 1 ->You should know briefly about python
You should understand that algorithms is the sequence of steps to write your program.Algorithms has expressions and statements too.Expressions are values, for instance 9 + 1 is an expression. It’ll show you the value 10.Variable is, technically taking space in memory. Variable can also be like x, unknown.Remember what the “print” syntax does.
---------------------------------------------------------------------------------------------------
New Functions in this Chapter

=====    =======

Function     Description

=====    =======

print Shows the standard output

-----------------------------------------------------------------------------------------------------------

This is the end of the chapter-1

Thanks for reading,
If you find any mistakes feel free to tell me to fix
Null@Z+:~>logout
 
Paid adv. expire in 2 months
CLICK to buy Advertisement !
westernunion carding Verified & Trusted WesternUnion | MoneyGram | Bank - Transferring [299$ BTC for 2000$ WU]
electronics carding Verified & Trusted Electronics Carding, Carding iPhone, Samsung Carding, MacBook Carding, Laptops Carding

Elite91

Member
Member
Joined
11 yrs. 4 mth. 1 days
Messages
8
Reaction score
2
Wallet
0$
im starting to learn python, i have no idea why i choose it :/ maybe i fancy the name :p
 
Top Bottom