Pages

Saturday, August 29, 2015

Python For Beginners Start Code Python With Sam Lesson 2 Run Python script using command prompt

Python For Beginners Start Code Python With Sam Lesson 2 Run Python script using command prompt


hello there in previous tutorial i promised you to teach about how to run python script in command prompt
ok lets get started first create new text file and type print ('hello world')
now goto save as and give a name like hello.py remember to put extension as py after that save as type change text file to all files then save












then go to command prompt you can go to start menu and type cmd and then open cmd and type
python but it show error what is error
"python is not recognized as an internal or external command"

python is not recognized as an internal or external command Error solved 



first right click on my computer
 Go to advance settings

then go to Environmental variables and click path and click Edit

then open python folder you have installed in my computer its in c://python34 go to that folder and copy link
than go to again environmental variable path and go to end of the path (you can use arrow key to go to end of the path)
then past ; semicolon in the end of the path 
then past the previous copied path

ex existing path here ;c://python34 


now click ok ok ok now you have solve the problem
 now open command prompt again and type python now there is no errors


Run python script using command prompt


now lets run the previous created hello.py file


open command prompt

change command prompt location where the file is saved
 i saved in desktop so i change directory as cd Desktop
then type python hello.py
then it execute the python script and shows output in command prompt as hello world



all done now you know how to fix errors set path in python and how to run python script using command prompt

ok guys next tutorial im going to teaching how to install pycham IDE for fast coding
thanks for watching
have a good day
Sameera Dissanayaka

#pythonforbeginners ,#startcodepythonwithsam ,#runpythonscriptusingcmd





Python For Beginners Start Code Python With Sam Lesson 1 Install Python

Python For Beginners Start Code With Sam Lesson 1 Install Python

Hello and welcome to my blog.i am D.M Sameera Madushan Dissanyaka.i am University student who like in new technology.currently im doing my Bsc Hons in Information Technology.(Final Year)University of Moratuwa . Sri Lanka.i love technology.i start blogging in 2010 and start lots of blogs about various topic.i love to share my knowledge with you all .and i love to learn new technologies.and love to discover things and achieve the challenges.Now a days im working on my final year Project on News summarizer with NLP and NLTK.So i think o share my knowledge with you all .i hope my little knowledge will help you to learn python and NLP.
 i like to Teach you guys Python step by step.first of all i like to say im not a Python guy.i uses Java,C#,C,Scala and objective C before But i realize python is easy to learn and people who like to learn Programming in very first level it is easy to start with python because it is very easy to learn,no cryptic like C or no hard coding.you can do lots of things using one or two line code.but you need more and more code if you use java or C .

Lets Get started

How to install python on your computer

first of all we need to download python.so we need to go to this python original website and download python version 3.x .im using python 3.4.3 version there is popular version like python 2.7 and python 3.4 but these two version have some differences.some modules don't include in 2.7 and so you better to download latest python 3.x version.
go to this website and download python and install it


then it will install python on your computer.now you can check python so you need to go to start menu and type python and it show python Default IDLE  click it and open it now you can code and check your code here.


then type print ('anything you want') and then press enter it will show what you typed there

now you are successfully installed python and ready to code.in next lesson im going to show how to run python script file in command prompt

have a good day 
see you in next tutorial

Sameera Dissanayaka

#pythonforbeginners,#startcodingpythonwithsam