SlideShare a Scribd company logo
1 of 1
Download to read offline
sys Variables                                     String Methods                                        Datetime Methods

                                                                                                         today()                       fromordinal(ordinal)
argv                     Command line args        capitalize() *              lstrip()
                                                                                                         now(timezoneinfo)             combine(date, time)
builtin_module_names Linked C modules             center(width)               partition(sep)
                                                                                                         utcnow()                      strptime(date, format)
byteorder                Native byte order                                    replace(old, new)
                                                  count(sub, start, end)
                                                                                                         fromtimestamp(timestamp)
check_interval           Signal check frequency   decode()                    rfind(sub, start ,end)
                                                                                                         utcfromtimestamp(timestamp)
exec_prefix              Root directory           encode()                    rindex(sub, start, end)
executable               Name of executable       endswith(sub)               rjust(width)
exitfunc                 Exit function name       expandtabs()                rpartition(sep)
                                                                                                        Time Methods
modules                  Loaded modules           find(sub, start, end) rsplit(sep)
                                                                                                         replace()                     utcoffset()
path                     Search path                                          rstrip()
                                                  index(sub, start, end)
                                                                                                         isoformat()                   dst()
platform                 Current platform         isalnum() *                 split(sep)
                                                                                                         __str__()                     tzname()
stdin, stdout, stderr    File objects for I/O     isalpha() *                 splitlines()
                                                                                                         strftime(format)
version_info             Python version info      isdigit() *                 startswith(sub)
winver                   Version number           islower() *                 strip()
                                                  isspace() *                 swapcase() *
                                                                                                        Date Formatting (strftime and strptime)
                                                  istitle() *                 title() *
sys.argv for $ python foo.py bar qux
                                                                                                        %a Abbreviated weekday (Sun)
                                                  isupper() *                 translate(table)
sys.argv[0]                                                                                             %A Weekday (Sunday)
                         foo.py                   join()                      upper() *
sys.argv[1]                                                                                             %b Abbreviated month name (Jan)
                         bar                      ljust(width)                zfill(width)
sys.argv[2]                                                                                             %B Month name (January)
                         qux                      lower() *
                                                                                                        %c Date and time
                                                                                                        %d Day (leading zeros) (01 to 31)
                                                                Methods marked * are locale
os Variables                                      Note          dependant for 8-bit strings.            %H 24 hour (leading zeros) (00 to 23)
                         Alternative sep
altsep                                                                                                  %I 12 hour (leading zeros) (01 to 12)
                         Current dir string
curdir                                                                                                  %j      Day of year (001 to 366)
                                                  List Methods
                         Default search path
defpath                                                                                                 %m Month (01 to 12)
                         Path of null device
devnull                                                                                                 %M Minute (00 to 59)
                                                  append(item)               pop(position)
                         Extension separator
extsep                                                                                                  %p AM or PM
                                                  count(item)                remove(item)
                         Line separator
linesep                                                                                                 %S Second (00 to 61 4)
                                                  extend(list)               reverse()
                         Name of OS
name                                                                                                    %U Week number                (00 to 53)
                                                  index(item)                sort()                                               1


                         Parent dir string
pardir                                                                                                  %w Weekday             (0 to 6)
                                                  insert(position, item)                                                   2


                         Patch separator
pathsep                                                                                                 %W Week number                (00 to 53)
                                                                                                                                  3


                         Path separator
sep                                                                                                     %x Date
                                                  File Methods
                                                                                                        %X Time
                                                                                                        %y Year without century (00 to 99)
                                                  close()                    readlines(size)
           Registered OS names: “posix”, “nt”,
Note       “mac”, “os2”, “ce”, “java”, “riscos”                                                         %Y Year (2008)
                                                  flush()                    seek(offset)
                                                                                                        %Z Time zone (GMT)
                                                  fileno()                   tell()
                                                                                                        %% A literal quot;%quot; character (%)
                                                  isatty()                   truncate(size)
Class Special Methods
                                                  next()                     write(string)
                                                                                                         1.
                                                  read(size)                 writelines(list)                   Sunday as start of week. All days in a
__new__(cls)             __lt__(self, other)
                                                  readline(size)                                                new year preceding the first Sunday
__init__(self, args)     __le__(self, other)
                                                                                                                are considered to be in week 0.
__del__(self)            __gt__(self, other)
__repr__(self)           __ge__(self, other)      Indexes and Slices (of a=[0,1,2,3,4,5])
                                                                                                         2.     0 is Sunday, 6 is Saturday.
__str__(self)            __eq__(self, other)
                                                  len(a)                       6
__cmp__(self, other) __ne__(self, other)
                                                  a[0]                                                   3.
                                                                               0                                Monday as start of week. All days in a
__index__(self)          __nonzero__(self)
                                                  a[5]                         5                                new year preceding the first Monday
__hash__(self)
                                                  a[-1]                        5                                are considered to be in week 0.
__getattr__(self, name)
                                                  a[-2]                        4
__getattribute__(self, name)
                                                  a[1:]                                                  4.
                                                                               [1,2,3,4,5]                      This is not a mistake. Range takes
__setattr__(self, name, attr)
                                                  a[:5]                        [0,1,2,3,4]                      account of leap and double-leap
__delattr__(self, name)
                                                  a[:-2]                       [0,1,2,3]                        seconds.
__call__(self, args, kwargs)
                                                  a[1:3]                       [1,2]
                                                  a[1:-1]                      [1,2,3,4]
                                                                                                              Available free from AddedBytes.com
                                                  b=a[:]                       Shallow copy of a

More Related Content

What's hot

What's hot (20)

Lists
ListsLists
Lists
 
Python-List.pptx
Python-List.pptxPython-List.pptx
Python-List.pptx
 
Python Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, DictionaryPython Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, Dictionary
 
Generators In Python
Generators In PythonGenerators In Python
Generators In Python
 
Python list
Python listPython list
Python list
 
Python lists & sets
Python lists & setsPython lists & sets
Python lists & sets
 
Python Programming: Lists, Modules, Exceptions
Python Programming: Lists, Modules, ExceptionsPython Programming: Lists, Modules, Exceptions
Python Programming: Lists, Modules, Exceptions
 
Arrays In C
Arrays In CArrays In C
Arrays In C
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
 
Basic data structures in python
Basic data structures in pythonBasic data structures in python
Basic data structures in python
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptx
 
Ds lab handouts
Ds lab handoutsDs lab handouts
Ds lab handouts
 
C if else
C if elseC if else
C if else
 
Getting started cpp full
Getting started cpp   fullGetting started cpp   full
Getting started cpp full
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
PPS Arrays Matrix operations
PPS Arrays Matrix operationsPPS Arrays Matrix operations
PPS Arrays Matrix operations
 
Numeric Data types in Python
Numeric Data types in PythonNumeric Data types in Python
Numeric Data types in Python
 
Python Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - ListsPython Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - Lists
 
Data type list_methods_in_python
Data type list_methods_in_pythonData type list_methods_in_python
Data type list_methods_in_python
 
Java Foundations: Arrays
Java Foundations: ArraysJava Foundations: Arrays
Java Foundations: Arrays
 

Viewers also liked (16)

Cooking Cake
Cooking CakeCooking Cake
Cooking Cake
 
There Is No Place Like Home
There Is No Place Like HomeThere Is No Place Like Home
There Is No Place Like Home
 
ft Power Point
ft Power Pointft Power Point
ft Power Point
 
Das GläSerne Kind
Das GläSerne KindDas GläSerne Kind
Das GläSerne Kind
 
Presentation2
Presentation2Presentation2
Presentation2
 
Amd Q308 Financials
Amd Q308 FinancialsAmd Q308 Financials
Amd Q308 Financials
 
JRMC Recomendation Letter
JRMC Recomendation LetterJRMC Recomendation Letter
JRMC Recomendation Letter
 
ED Process Redesign
ED Process RedesignED Process Redesign
ED Process Redesign
 
Eco Fashion Magazine Preview
Eco Fashion Magazine PreviewEco Fashion Magazine Preview
Eco Fashion Magazine Preview
 
Tp Traitement Hcv Du 2009
Tp Traitement Hcv Du 2009Tp Traitement Hcv Du 2009
Tp Traitement Hcv Du 2009
 
De Poort Gaat Open
De Poort Gaat Open De Poort Gaat Open
De Poort Gaat Open
 
компьютерный колледж
компьютерный колледжкомпьютерный колледж
компьютерный колледж
 
Summer HK trip
Summer HK tripSummer HK trip
Summer HK trip
 
SECR -2
SECR -2SECR -2
SECR -2
 
Andrés Y Carlos
Andrés Y CarlosAndrés Y Carlos
Andrés Y Carlos
 
Buenos AñOs 60 Y 70
Buenos AñOs 60 Y 70Buenos AñOs 60 Y 70
Buenos AñOs 60 Y 70
 

Similar to python-cheat-sheet-v1

โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
Little Tukta Lita
 
CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogramming
dudarev
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
gekiaruj
 
ภาษา C โปรแกรมย่อยและฟังก์ชันมาตรฐาน
ภาษา C โปรแกรมย่อยและฟังก์ชันมาตรฐานภาษา C โปรแกรมย่อยและฟังก์ชันมาตรฐาน
ภาษา C โปรแกรมย่อยและฟังก์ชันมาตรฐาน
Noppanon YourJust'one
 
User-Defined Table Generating Functions
User-Defined Table Generating FunctionsUser-Defined Table Generating Functions
User-Defined Table Generating Functions
pauly1
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
kramsri
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
kramsri
 
Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)
Chia-Chi Chang
 

Similar to python-cheat-sheet-v1 (20)

โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogramming
 
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARD
 
Python Cheat Sheet
Python Cheat SheetPython Cheat Sheet
Python Cheat Sheet
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기
 
ภาษา C โปรแกรมย่อยและฟังก์ชันมาตรฐาน
ภาษา C โปรแกรมย่อยและฟังก์ชันมาตรฐานภาษา C โปรแกรมย่อยและฟังก์ชันมาตรฐาน
ภาษา C โปรแกรมย่อยและฟังก์ชันมาตรฐาน
 
bpftrace - Tracing Summit 2018
bpftrace - Tracing Summit 2018bpftrace - Tracing Summit 2018
bpftrace - Tracing Summit 2018
 
Hw09 Hadoop + Clojure
Hw09   Hadoop + ClojureHw09   Hadoop + Clojure
Hw09 Hadoop + Clojure
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Python for R users
Python for R usersPython for R users
Python for R users
 
User-Defined Table Generating Functions
User-Defined Table Generating FunctionsUser-Defined Table Generating Functions
User-Defined Table Generating Functions
 
PHP Cheat Sheet
PHP Cheat SheetPHP Cheat Sheet
PHP Cheat Sheet
 
Super Advanced Python –act1
Super Advanced Python –act1Super Advanced Python –act1
Super Advanced Python –act1
 
Arduino reference
Arduino   referenceArduino   reference
Arduino reference
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
PHP Cheatsheet
PHP CheatsheetPHP Cheatsheet
PHP Cheatsheet
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)
 

More from Hiroshi Ono

Voltdb - wikipedia
Voltdb - wikipediaVoltdb - wikipedia
Voltdb - wikipedia
Hiroshi Ono
 
Gamecenter概説
Gamecenter概説Gamecenter概説
Gamecenter概説
Hiroshi Ono
 
EventDrivenArchitecture
EventDrivenArchitectureEventDrivenArchitecture
EventDrivenArchitecture
Hiroshi Ono
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
Hiroshi Ono
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdf
Hiroshi Ono
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdf
Hiroshi Ono
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdf
Hiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
Hiroshi Ono
 
BOF1-Scala02.pdf
BOF1-Scala02.pdfBOF1-Scala02.pdf
BOF1-Scala02.pdf
Hiroshi Ono
 
TwitterOct2008.pdf
TwitterOct2008.pdfTwitterOct2008.pdf
TwitterOct2008.pdf
Hiroshi Ono
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
Hiroshi Ono
 
SACSIS2009_TCP.pdf
SACSIS2009_TCP.pdfSACSIS2009_TCP.pdf
SACSIS2009_TCP.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
Hiroshi Ono
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
Hiroshi Ono
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdf
Hiroshi Ono
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdf
Hiroshi Ono
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdf
Hiroshi Ono
 

More from Hiroshi Ono (20)

Voltdb - wikipedia
Voltdb - wikipediaVoltdb - wikipedia
Voltdb - wikipedia
 
Gamecenter概説
Gamecenter概説Gamecenter概説
Gamecenter概説
 
EventDrivenArchitecture
EventDrivenArchitectureEventDrivenArchitecture
EventDrivenArchitecture
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdf
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdf
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
 
BOF1-Scala02.pdf
BOF1-Scala02.pdfBOF1-Scala02.pdf
BOF1-Scala02.pdf
 
TwitterOct2008.pdf
TwitterOct2008.pdfTwitterOct2008.pdf
TwitterOct2008.pdf
 
camel-scala.pdf
camel-scala.pdfcamel-scala.pdf
camel-scala.pdf
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
 
SACSIS2009_TCP.pdf
SACSIS2009_TCP.pdfSACSIS2009_TCP.pdf
SACSIS2009_TCP.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdf
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdf
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdf
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

python-cheat-sheet-v1

  • 1. sys Variables String Methods Datetime Methods today() fromordinal(ordinal) argv Command line args capitalize() * lstrip() now(timezoneinfo) combine(date, time) builtin_module_names Linked C modules center(width) partition(sep) utcnow() strptime(date, format) byteorder Native byte order replace(old, new) count(sub, start, end) fromtimestamp(timestamp) check_interval Signal check frequency decode() rfind(sub, start ,end) utcfromtimestamp(timestamp) exec_prefix Root directory encode() rindex(sub, start, end) executable Name of executable endswith(sub) rjust(width) exitfunc Exit function name expandtabs() rpartition(sep) Time Methods modules Loaded modules find(sub, start, end) rsplit(sep) replace() utcoffset() path Search path rstrip() index(sub, start, end) isoformat() dst() platform Current platform isalnum() * split(sep) __str__() tzname() stdin, stdout, stderr File objects for I/O isalpha() * splitlines() strftime(format) version_info Python version info isdigit() * startswith(sub) winver Version number islower() * strip() isspace() * swapcase() * Date Formatting (strftime and strptime) istitle() * title() * sys.argv for $ python foo.py bar qux %a Abbreviated weekday (Sun) isupper() * translate(table) sys.argv[0] %A Weekday (Sunday) foo.py join() upper() * sys.argv[1] %b Abbreviated month name (Jan) bar ljust(width) zfill(width) sys.argv[2] %B Month name (January) qux lower() * %c Date and time %d Day (leading zeros) (01 to 31) Methods marked * are locale os Variables Note dependant for 8-bit strings. %H 24 hour (leading zeros) (00 to 23) Alternative sep altsep %I 12 hour (leading zeros) (01 to 12) Current dir string curdir %j Day of year (001 to 366) List Methods Default search path defpath %m Month (01 to 12) Path of null device devnull %M Minute (00 to 59) append(item) pop(position) Extension separator extsep %p AM or PM count(item) remove(item) Line separator linesep %S Second (00 to 61 4) extend(list) reverse() Name of OS name %U Week number (00 to 53) index(item) sort() 1 Parent dir string pardir %w Weekday (0 to 6) insert(position, item) 2 Patch separator pathsep %W Week number (00 to 53) 3 Path separator sep %x Date File Methods %X Time %y Year without century (00 to 99) close() readlines(size) Registered OS names: “posix”, “nt”, Note “mac”, “os2”, “ce”, “java”, “riscos” %Y Year (2008) flush() seek(offset) %Z Time zone (GMT) fileno() tell() %% A literal quot;%quot; character (%) isatty() truncate(size) Class Special Methods next() write(string) 1. read(size) writelines(list) Sunday as start of week. All days in a __new__(cls) __lt__(self, other) readline(size) new year preceding the first Sunday __init__(self, args) __le__(self, other) are considered to be in week 0. __del__(self) __gt__(self, other) __repr__(self) __ge__(self, other) Indexes and Slices (of a=[0,1,2,3,4,5]) 2. 0 is Sunday, 6 is Saturday. __str__(self) __eq__(self, other) len(a) 6 __cmp__(self, other) __ne__(self, other) a[0] 3. 0 Monday as start of week. All days in a __index__(self) __nonzero__(self) a[5] 5 new year preceding the first Monday __hash__(self) a[-1] 5 are considered to be in week 0. __getattr__(self, name) a[-2] 4 __getattribute__(self, name) a[1:] 4. [1,2,3,4,5] This is not a mistake. Range takes __setattr__(self, name, attr) a[:5] [0,1,2,3,4] account of leap and double-leap __delattr__(self, name) a[:-2] [0,1,2,3] seconds. __call__(self, args, kwargs) a[1:3] [1,2] a[1:-1] [1,2,3,4] Available free from AddedBytes.com b=a[:] Shallow copy of a