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

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
 

Último (20)

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
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...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
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
 
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...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
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
 

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