SlideShare una empresa de Scribd logo
1 de 23
Using Python
or how to code snake language in windows
About Python…
Python is a common programming
language…
It is used for a large variety of applications,
for example, analytical software.
Code
import os
x = os.getcwd() #Assigns the current directory to x
print(x)
-------------------------------------------------------------------------------------
Output
C:UsersSebastianDownloads
A simple Python program looks like
above.
Explanation time…
Code
import os
x = os.getcwd() #Assigns the current directory to x
print(x)
-------------------------------------------------------------------------------------
Output
C:UsersSebastianDownloads
The purples are statements. The import statement tells the computer to grab
a prewritten piece of code and implement it easily…
Code
import os
x = os.getcwd() #Assigns the current directory to x
print(x)
-------------------------------------------------------------------------------------
Output
C:UsersSebastianDownloads
The greens are modules. Modules are a way to write code so that you can
implement it easier in other parts of your code…
The reds are variables. The x is here assigned to the value of os.getcwd().
Variables are a way to store data that will be used later, either, for example,
for calculations, or for text manipulation…
Code
import os
x = os.getcwd() #Assigns the current directory to x
print(x)
-------------------------------------------------------------------------------------
Output
C:UsersSebastianDownloads
Code
x = ‘Hello you’ #x is now a string-variable
y = 7 #y is now a number-variable
print(x)
print(y)
-------------------------------------------------------------------------------------
Output
Hello you
7
Here’s a visual demonstration of different kinds of variable values and how
the values are stored to a variable. The ‘Hello you’ is a string, and the 7
is an integer, shortened int…
Code
import os
x = os.getcwd() #Assigns the current directory to x “””
print(x)
-------------------------------------------------------------------------------------
Output
C:UsersSebastianDownloads
The grey are comments. The # represents a single line comment, which is
used when there needs to be a quick explanation, such as above. There is also
the “””…“”” which is a multiline comment, mostly used to comment away
sections of code that isn’t used. The comments does nothing when the
program runs…
Code
import os
x = os.getcwd() #Assigns the current directory to x
print(x)
-------------------------------------------------------------------------------------
Output
C:UsersSebastianDownloads
And finally, the blues are functions. Functions is a block of organized, reusable
code that is used to perform a single, related action. Functions provide better
modularity for your application and a high degree of code reusing…
Now it’s time to install Python…
Start by going to
https://www.python.org/downloads/...
Then click the download button for the version of Python you
want, we are using Python 3.4.* for the code in this
presentation…
Finally it is just a matter of following the
instructions given.
Even though Python has a large built in library, it
lacks certain modules to ease the code-writing…
Therefore, we’ll now guide you through the
process of installing more libraries to Python…
Start by downloading the library you want to install,
we’ll install the wikipedia library in this tutorial…
If there is a .exe file to download, download and run it, and it’s
installed. Otherwise, download the .gz.tar file and unzip it to the
folder where Python is, using e.g. WinRAR…
This is what my
Python folder
looks like.
After that it’s time to start the old CMD. When it’s started,
navigate to the Python folder, it should look something like the
picture above…
Now it’s time to install the library. Type in the code shown above in to CMD to
start the installation, but remember to type in the name of the library you’re
installing instead of wikipedia…
Python –m pip install wikipedia
That’s it!
By Sebastian Grunditz and Samuel Håkansson

Más contenido relacionado

La actualidad más candente (19)

Hosts
HostsHosts
Hosts
 
Hosts
HostsHosts
Hosts
 
Hosts
HostsHosts
Hosts
 
Linux Commands - 3
Linux Commands - 3Linux Commands - 3
Linux Commands - 3
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet
 
Hosts
HostsHosts
Hosts
 
Hosts
HostsHosts
Hosts
 
Hosts
HostsHosts
Hosts
 
test
testtest
test
 
Hosts yes
Hosts yesHosts yes
Hosts yes
 
Hosts
HostsHosts
Hosts
 
Hosts
HostsHosts
Hosts
 
Hosts
HostsHosts
Hosts
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
 
Hosts
HostsHosts
Hosts
 
Instruction addressing and execution
Instruction addressing and executionInstruction addressing and execution
Instruction addressing and execution
 
Hosts para a info
Hosts para a infoHosts para a info
Hosts para a info
 
Hosts
HostsHosts
Hosts
 

Destacado

WareHouse Addition
WareHouse AdditionWareHouse Addition
WareHouse Addition
B Kneeland
 
Diplome Maltherapeut
Diplome MaltherapeutDiplome Maltherapeut
Diplome Maltherapeut
Dino Toniolo
 
Asian monetary cooperation£ºtheory and possibility
Asian monetary cooperation£ºtheory and possibilityAsian monetary cooperation£ºtheory and possibility
Asian monetary cooperation£ºtheory and possibility
R_24
 

Destacado (20)

CAMBIOS CLIMATICOS
CAMBIOS CLIMATICOSCAMBIOS CLIMATICOS
CAMBIOS CLIMATICOS
 
Ami Polymer Pvt Ltd
Ami Polymer Pvt LtdAmi Polymer Pvt Ltd
Ami Polymer Pvt Ltd
 
احمد السيد
احمد السيداحمد السيد
احمد السيد
 
Nouns
NounsNouns
Nouns
 
The Company Searcher
The Company SearcherThe Company Searcher
The Company Searcher
 
Austin Benn - How to deal with a multi-generational workforce
Austin Benn - How to deal with a multi-generational workforceAustin Benn - How to deal with a multi-generational workforce
Austin Benn - How to deal with a multi-generational workforce
 
WareHouse Addition
WareHouse AdditionWareHouse Addition
WareHouse Addition
 
Diplome Maltherapeut
Diplome MaltherapeutDiplome Maltherapeut
Diplome Maltherapeut
 
Austin Benn Recruitment - Sales & Marketing Newsletter (Clients) Issue 4
Austin Benn Recruitment - Sales & Marketing Newsletter (Clients) Issue 4Austin Benn Recruitment - Sales & Marketing Newsletter (Clients) Issue 4
Austin Benn Recruitment - Sales & Marketing Newsletter (Clients) Issue 4
 
Nouns
NounsNouns
Nouns
 
Darkfield LED Array
Darkfield LED ArrayDarkfield LED Array
Darkfield LED Array
 
6th
6th6th
6th
 
UK Export Finance : Presentation for China event
UK Export Finance : Presentation for China eventUK Export Finance : Presentation for China event
UK Export Finance : Presentation for China event
 
Chameleon Technologies
Chameleon TechnologiesChameleon Technologies
Chameleon Technologies
 
Resume02052015
Resume02052015Resume02052015
Resume02052015
 
RAINBOW by ECS-3.COM:
RAINBOW by ECS-3.COM: RAINBOW by ECS-3.COM:
RAINBOW by ECS-3.COM:
 
Asian monetary cooperation£ºtheory and possibility
Asian monetary cooperation£ºtheory and possibilityAsian monetary cooperation£ºtheory and possibility
Asian monetary cooperation£ºtheory and possibility
 
Digital Transformational Trends in Insurance
Digital Transformational Trends in InsuranceDigital Transformational Trends in Insurance
Digital Transformational Trends in Insurance
 
Linea de tiempo
Linea de tiempoLinea de tiempo
Linea de tiempo
 
Austin Benn Sales and Marketing Newsletter (clients) - Issue 3
Austin Benn Sales and Marketing Newsletter (clients) - Issue 3Austin Benn Sales and Marketing Newsletter (clients) - Issue 3
Austin Benn Sales and Marketing Newsletter (clients) - Issue 3
 

Similar a Using Python

Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1
NYversity
 
Batch file programming
Batch file programmingBatch file programming
Batch file programming
swapnil kapate
 

Similar a Using Python (20)

Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c language
 
introduction to c language
 introduction to c language introduction to c language
introduction to c language
 
Btech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c language
 
Mca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageMca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c language
 
Diploma ii cfpc u-1 introduction to c language
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c language
 
Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1
 
2018-Summer-Tutorial-Intro-to-Linux.pdf
2018-Summer-Tutorial-Intro-to-Linux.pdf2018-Summer-Tutorial-Intro-to-Linux.pdf
2018-Summer-Tutorial-Intro-to-Linux.pdf
 
Whole c++ lectures ITM1 Th
Whole c++ lectures ITM1 ThWhole c++ lectures ITM1 Th
Whole c++ lectures ITM1 Th
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kite
 
PythonNotes1.pdf
PythonNotes1.pdfPythonNotes1.pdf
PythonNotes1.pdf
 
Data analysis in R
Data analysis in RData analysis in R
Data analysis in R
 
Introduction to python.pptx
Introduction to python.pptxIntroduction to python.pptx
Introduction to python.pptx
 
From Zero to Hero - All you need to do serious deep learning stuff in R
From Zero to Hero - All you need to do serious deep learning stuff in R From Zero to Hero - All you need to do serious deep learning stuff in R
From Zero to Hero - All you need to do serious deep learning stuff in R
 
Declare Your Language: What is a Compiler?
Declare Your Language: What is a Compiler?Declare Your Language: What is a Compiler?
Declare Your Language: What is a Compiler?
 
(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language
 
Batch file programming
Batch file programmingBatch file programming
Batch file programming
 
python PPT Session 1.pptx
python PPT Session 1.pptxpython PPT Session 1.pptx
python PPT Session 1.pptx
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 

Último

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Último (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

Using Python

  • 1. Using Python or how to code snake language in windows
  • 3. Python is a common programming language…
  • 4. It is used for a large variety of applications, for example, analytical software.
  • 5. Code import os x = os.getcwd() #Assigns the current directory to x print(x) ------------------------------------------------------------------------------------- Output C:UsersSebastianDownloads A simple Python program looks like above.
  • 7. Code import os x = os.getcwd() #Assigns the current directory to x print(x) ------------------------------------------------------------------------------------- Output C:UsersSebastianDownloads The purples are statements. The import statement tells the computer to grab a prewritten piece of code and implement it easily…
  • 8. Code import os x = os.getcwd() #Assigns the current directory to x print(x) ------------------------------------------------------------------------------------- Output C:UsersSebastianDownloads The greens are modules. Modules are a way to write code so that you can implement it easier in other parts of your code…
  • 9. The reds are variables. The x is here assigned to the value of os.getcwd(). Variables are a way to store data that will be used later, either, for example, for calculations, or for text manipulation… Code import os x = os.getcwd() #Assigns the current directory to x print(x) ------------------------------------------------------------------------------------- Output C:UsersSebastianDownloads
  • 10. Code x = ‘Hello you’ #x is now a string-variable y = 7 #y is now a number-variable print(x) print(y) ------------------------------------------------------------------------------------- Output Hello you 7 Here’s a visual demonstration of different kinds of variable values and how the values are stored to a variable. The ‘Hello you’ is a string, and the 7 is an integer, shortened int…
  • 11. Code import os x = os.getcwd() #Assigns the current directory to x “”” print(x) ------------------------------------------------------------------------------------- Output C:UsersSebastianDownloads The grey are comments. The # represents a single line comment, which is used when there needs to be a quick explanation, such as above. There is also the “””…“”” which is a multiline comment, mostly used to comment away sections of code that isn’t used. The comments does nothing when the program runs…
  • 12. Code import os x = os.getcwd() #Assigns the current directory to x print(x) ------------------------------------------------------------------------------------- Output C:UsersSebastianDownloads And finally, the blues are functions. Functions is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing…
  • 13. Now it’s time to install Python…
  • 14. Start by going to https://www.python.org/downloads/...
  • 15. Then click the download button for the version of Python you want, we are using Python 3.4.* for the code in this presentation…
  • 16. Finally it is just a matter of following the instructions given.
  • 17. Even though Python has a large built in library, it lacks certain modules to ease the code-writing…
  • 18. Therefore, we’ll now guide you through the process of installing more libraries to Python…
  • 19. Start by downloading the library you want to install, we’ll install the wikipedia library in this tutorial…
  • 20. If there is a .exe file to download, download and run it, and it’s installed. Otherwise, download the .gz.tar file and unzip it to the folder where Python is, using e.g. WinRAR… This is what my Python folder looks like.
  • 21. After that it’s time to start the old CMD. When it’s started, navigate to the Python folder, it should look something like the picture above…
  • 22. Now it’s time to install the library. Type in the code shown above in to CMD to start the installation, but remember to type in the name of the library you’re installing instead of wikipedia… Python –m pip install wikipedia
  • 23. That’s it! By Sebastian Grunditz and Samuel Håkansson