We are closing registration and public forum view to Paid & Private in 16 days! CLICK HERE to register FREE.
Create an account  

For users privacy, our last domains: CarderHack.com and OmertaHack.net are moved to CardingTeam.ws

Deposit & Withdraw | About Verified Sellers and Escrow | Advertise | Scam Report | Tracking Number Details | ICQ: 717039384

carding forums carding forums
carding forums carding forums
carding forums Paid adv expire in 48 days
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Introduction to Python

Today I'll be doing a basic introduction to programming with Python.
Well briefly go over some of the syntax differences between python and other languages that you may be more familiar with. After that Ill go over Modules which are pythons built in libraries that you can utilise.
Once we have the basics down we'll get into some more tangible stuff like variables, conditionals, and loops. Finially we'll take a brief look at functions and the Python Interactive Interpreter. Grab a cup of coffee cause this might be a long tutorial.  Also note this tutorial is based on the Python 2.x branch, particularily 2.7. If you code in 3.x and have any questions feel free to ask and Ill get an answer back to you as soon as I can.
This isn't an overly thorough tutorial, python is an awesome language and as a result its very extensive, i've tried to cover most of the basics here so that by the time you're finished you can sit down and start writing some code, if you have any questions feel free to contact me and stackoverflow is a godsend.
Common Phrases:
cast - changing a variable from one data type to another
class - an abstract data structure
module - another python script that can add extended functionality
object - an abstract data structure, an object is an instance of a class

Python Syntax:
The syntax in python is different from what you might be familiar with in languages like PHP or C++. Lines do not need to be terminated by a semi-colon in python(although you can still use them and it will execute fine, the standard convention is to omit them) There are also no curly braces in use in python to denote a block of code. As such code NEEDS to be indented properly in python or it will not run.  
Indentation needs to be consistent as well, you can for example use 4 spaces as an indent or one tab but you can not interchangeably use them both throughout the same program(as a rule of thumb when i copy python code i immediately do a find and replace of 4 spaces to \t to make life easier, if you port code from windows to python you may find you need to use dos2unix or unix2dos for the vise versa)
If you are familiar with how indentation works then this shouldn't be a problem, if you aren't aware what I'm referring to we'll get to that shortly.Python is also distinct from other languages in the amount of english used in its syntax, where other languages use the || and && logical 'or' and 'and' operators respectively in python you can simply write the words: 'or' and 'and' in conditional statements. This english based syntax mixed with strongly enforced indentation makes python code quite easy to read at initial glance which is one of the many benefits of Python.(there is also a keyword 'not' in place of ! however you can still use ! as an operator as in the example: 1 != 2)


If you're wondering if you can do something in python the answer is almost invariably yes, there is almost certainly already a module in existance that will make your life easier.  Python comes pre-packaged with a ton of useful modules of all types that you can use and theres just as many or more third party modules available that usually require only a simple install script be run to make them accessible. To import a module in essence the same as including a header file in C/C++ or doing an include/require in php or whatever the equivalency is in any other language, same deal.
The syntax to do so is:
import modulename
theres also a few spins on this, you can import multiple modules in one line like:
import module1, module2, module3
or you can choose to import only a sepcific class or method from a module
from module1 import class3
if you use import modulename you will find often that you have to declare modulename.classname() when you instantiate an instance, I forget the exact reasons but it has to do with how it is imported into the namespace, to avoid this you can write:from module1 import *which will import everything into the global namespace, be warned though this can be exhaustive on memory and a bad idea for several reasons, its not against standard procedures to do it but dont use it in a sloppy manner be sure theres a reason for it.you can also import other scripts you have written, if they are in the same cwd as the script you are executing you can simply typeimport myscriptif your script is named 'myscript.py' it will now be imported, besure to omit the .py in the import call.you can also import local files in a subdirectory provided you use:import folder.myscript
Paid adv. expire in 47 days
CLICK to buy Advertisement !

    Verified & Trusted HACKED Payza, PayPal, Ukash, Ucard, EgoPay, Skrill - TRANSFER [Escrow accepted]

very nice thank you...
is there some book or some specific way to follow to learn?

Forum Jump: