Python-cheat-sheet-v1.pdf

Páginas: 3 (590 palabras) Publicado: 10 de noviembre de 2011
sys Variables argv byteorder check_interval exec_prefix executable exitfunc modules path platform stdin, stdout, stderr version_info winver Command line args Native byte order Signal check frequencyRoot directory Name of executable Exit function name Loaded modules Search path Current platform File objects for I/O Python version info Version number

String Methods capitalize() * center(width)count(sub, start, end)

Datetime Methods lstrip() partition(sep) replace(old, new) rfind(sub, start ,end) rindex(sub, start, end) rjust(width) rpartition(sep) rstrip() split(sep) splitlines()startswith(sub) strip() swapcase() * title() * translate(table) upper() * zfill(width) Date Formatting (strftime and strptime) %a Abbreviated weekday (Sun) %A Weekday (Sunday) %b Abbreviated month name(Jan) %B Month name (January) %c Date and time Time Methods replace() isoformat() __str__() strftime(format) utcoffset() dst() tzname() today() now(timezoneinfo) utcnow() fromordinal(ordinal)combine(date, time) strptime(date, format)

builtin_module_names Linked C modules

decode() encode() endswith(sub) expandtabs()
index(sub, start, end)

fromtimestamp(timestamp) utcfromtimestamp(timestamp)find(sub, start, end) rsplit(sep) isalnum() * isalpha() * isdigit() * islower() * isspace() * istitle() * isupper() * join() ljust(width) lower() *
Methods marked * are locale dependant for 8-bitstrings.

sys.argv for $ python foo.py bar -c qux --h sys.argv[0] sys.argv[1] sys.argv[2] sys.argv[3] sys.argv[4] foo.py bar -c qux --h

Note

%d Day (leading zeros) (01 to 31) %H 24 hour(leading zeros) (00 to 23) %I 12 hour (leading zeros) (01 to 12) %j Day of year (001 to 366)

os Variables altsep curdir defpath devnull extsep linesep name pardir pathsep sep Alternative sep Current dirstring Default search path Path of null device Extension separator Line separator Name of OS Parent dir string Patch separator Path separator
Registered OS names: “posix”, “nt”, “mac”, “os2”,...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • gramatica cheat sheet
  • Git-cheat-sheet.
  • Cisco Meraki Cheat Sheet
  • Ltex 2ε cheat sheet
  • Html5 cheat sheet
  • Freereport-Paint-Basics-Cheat-Sheet
  • Cheat Sheet
  • Data Sheet Advanced Pdf 36691

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS