Introduction
Most of us would be very interested in game designing even before knowing what is it about. We get admired by the way the games we play are designed and that becomes the cause for many of us to have the wish to become a game designer. So this is the platform where I am going to share with everyone what I have learned. When it comes to game designing, everyone knows that there is some serious coding stuff done behind and behind every successful game in the market, there would have been coders and designers working very hard for nearly more than 5 years. So we need to learn programming languages with great interest to get into
game designing.
Python is a latest language which is more convenient and easy to learn and work with.It is easy to learn it as it has built in capability for many features. We can perform the operations with a single line of code which requires several lines of code to be written in languages like C, C++,etc
Installing Python :
To install python in windows, we must first download the python package suitable for our operating system.
The python software can be downloaded from the official python website. Click here to take you to the Python downloads page.Now that we are in the python downloads page, there are options to download the software for Windows, Linux/Unix and Mac OS. Several versions of the python software are available. In our blog, we use Python-2.7 for running our programs.
The latest version release will be on the top of the download page. To download a specific version release, scroll down. A list of all the versions available will be displayed from which we can select the version to be downloaded.
Clicking on the version you need to download, you will be directed to the next page. Scroll down and click on the Windows MSI Installer ( either 64bit or 32 bit according to your system).
I am going to write the python programs in a windows machine.So let me tell you the instructions how to install python package in windows after downloading it.
After downloading the software package,we need to install it. Just go to the downloaded location and double click on the MSI installer. and click Run. The setup dialog box opens with two options.
If you are the only user on the computer, You can simply select "Install for all users". Or if you have multiple user accounts on your computer and you need not want the python to be installed across all the accounts, Select "Install just for me" and press Next.
On the next page, select the location of installation or leave it as it is. The default location of installation is C:\Python27\ . Click Next And click Finish to finish the installation.
So, let's get started. Now that we have successfully installed python in our computer system, we can write python code and run in our system.
Python like any other language like C, C++, JAVA has its own syntax . Unlike C, C++ or JAVA, Python does not use flower brackets ({,}) to indicate a segment of code. Instead it uses indentation to identify a block of code.
For example, we will look at our first program; the most favourite one for everyone.
Guess what...
It's the 'hello world' program. Printing hello world on the screen. ;-)
In python, we just need one line of code for this.
print 'hello world'
We can write the python code in just a notepad and save it with .py extension or we can write programs in IDLE(Python GUI). Open the python idle window. Click on File and select New Window.
There we can write the program and save it with .py extension. IDLE is more user friendly and changes the colour of the text when keywords are typed.It also auto indents the code providing ease of use.
Write this line of code and save it in a desired location,say as 'hello.py'. Now we need to run the program.
Open a command prompt and move to the location where the python file resides.
Now type python hello.py . This will run the code and print the result as "hello world".
We can write the python code in just a notepad and save it with .py extension or we can write programs in IDLE(Python GUI). Open the python idle window. Click on File and select New Window.
There we can write the program and save it with .py extension. IDLE is more user friendly and changes the colour of the text when keywords are typed.It also auto indents the code providing ease of use.
Write this line of code and save it in a desired location,say as 'hello.py'. Now we need to run the program.
Open a command prompt and move to the location where the python file resides.
Now type python hello.py . This will run the code and print the result as "hello world".
In python, print is a keyword used to print the value given to the console screen.
We have written our program in python ! Though it is the simplest program, we have started writing a program in python. Now, let us proceed in this way and enter into the 'World of Python' and explore.
>> Next : Python Datatypes and Variables >>
>> Next : Python Datatypes and Variables >>
Comments
Post a Comment