Python 官方文檔

Resource

Related

  • Django教程

String

String Methods

  • capitalize()
  • center(width[, fillchar])
  • count(sub[, start[, end]])
  • decode()
  • encode([encoding[, errors]])
  • endswith(suffix[, start[, end]])
  • expandtabs([tabsize])
  • find(sub[, start[, end]])
  • format(*args, **kwargs)
  • index(sub[, start[, end]])
  • isalnum()
  • isalpha()
  • isdecimal()
  • isdigit()
  • islower()
  • isnumeric()
  • isspace()
  • istitle()
  • isupper()
  • join(iterable)
  • ljust(width[, fillchar])
  • lower()
  • lstrip([chars])
  • partition(sep)
  • replace(old, new[, count])
  • rfind(sub[, start[, end]])
  • rindex(sub[, start[, end]])
  • rjust(width[, fillchar])
  • rpartition(sep)
  • rsplit([sep[, maxsplit]])
  • rstrip([chars])
  • split([sep[, maxsplit]])
  • splitlines([keepends])
  • startswith(prefix[, start[, end]])
  • strip([chars])
  • swapcase
  • title()
  • translate(table[, deletechars])
  • upper()
  • zfill(width)

File

Methods

  • close()
  • fileno()
  • flush()
  • isatty()
  • next()
  • read([size])
  • readline([size])
  • readlines([sizehint])
  • seek(offset[, whence])
  • tell()
  • truncate([size])
  • write(str)
  • writelines(sequence)
  • xreadlines()

Attributes

  • closed
  • encoding
  • errors
  • mode
  • name
  • newlines
  • softspace

Set & Mapping

Set Types

Mapping Types

  • key not in d
  • d[key] = value
  • d[key]
  • d中鍵k的值。
  • del d[key]
  • 刪除d[k]。
  • fromkeys(seq[, value])
  • get(key[, default])
  • has_key(key)
  • items()
  • iteritems()
  • iterkeys()
  • itervalues()
  • key in d
  • 如果k是d的鍵值,返回True。
  • keys()
  • len(d)
  • 返回字典d的項目數。
  • pop(key[, default])
  • popitem()
  • setdefault(key[, default])
  • update([other])
  • values

Date Time

Date Object

  • __str__()
  • ctime()
  • isocalendar()
  • isoformat()
  • isoweekday()()
  • replace((year, month, day))
  • strftime()
  • timetuple()
  • toordinal()
  • weekday()

Datetime Object

  • astimezone(tz)
  • date()
  • dst()
  • isocalendar()
  • isoweekday()
  • replace([year[, month[, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]]]]])
  • time()
  • timetz()
  • tzname()
  • utcoffset()
  • utctimetuple()
  • weekday()

Time Object

Array

Array Methods

  • append(x)
  • buffer_info()
  • byteswap()
  • count(x)
  • extend(iterable)
  • fromfile(f,n)
  • fromlist(list)
  • fromstring(s)
  • fromunicode(s)
  • index(x)
  • insert(i,x)
  • pop([i])
  • remove(x)
  • reverse()
  • tofile(f)
  • tolist()
  • tostring()
  • tounicode()

Math

Number Theoretic

  • ceil(x)
  • copysign(x,y)
  • fabs(x)
  • factorial(x)
  • floor(x)
  • fmod(x,y)
  • frexp(x)
  • fsum(iterable)
  • isinf(x)
  • isnan(x)
  • ldexp(x,i)
  • modf(x)
  • trunc()

Power and Logarithmic

  • exp(x)
  • log(x[,base])
  • log10(x)
  • log1p(x)
  • pow(x,y)
  • sqrt(x)

Trigonometric Functions

  • acos(x)
  • asin(x)
  • atan(x)
  • atan2(y,x)
  • cos(x)
  • hypot(x,y)
  • sin(x)
  • tan(x)

Angular Conversion

  • degrees(x)
  • radians(x)

Hyperbolic Functions

  • acosh(x)
  • asinh(x)
  • atanh(x)
  • cosh(x)
  • sinh(x)
  • tanh(x)

Constants

  • math.e
  • 數學常量 e,e即自然常數(自然常數)。
  • math.pi
  • 數學常量 pi(圓周率,一般以π來表示)。

Random

Functions

Sys

Sys Variables

sys.argv

OS

os Variables

  • altsep
  • Alternative sep
  • curdir
  • 返回當前目錄: ('.')。
  • defpath
  • Default search path
  • devnull
  • Path of null device
  • extsep
  • Extension separator
  • linesep
  • 輸出當前平臺使用的行終止符,win下為"\t\n",Linux下為"\n"。
  • pardir
  • 獲取當前目錄的父目錄字符串名:('..')。
  • pathsep
  • 輸出用于分割文件路徑的字符串。
  • sep
  • 輸出操作系統特定的路徑分隔符,win下為"\\",Linux下為"/"。

String Formatting

Formatting Operations

  • '%'
  • No argument is converted, results in a '%' character in the result.
  • 'i'
  • Signed integer decimal.
  • 'r'
  • String (converts any Python object using repr().
  • 'c'
  • 格式化字符及其ASCII碼
  • 'd'
  • 格式化整數
  • 'e'
  • 用科學計數法格式化浮點數
  • 'f'
  • 格式化浮點數字,可指定小數點后的精度
  • 'g'
  • %f和%e的簡寫
  • 'o'
  • 格式化無符號八進制數
  • 's'
  • 格式化字符串
  • 'u'
  • 格式化無符號整型
  • 'x'
  • 格式化無符號十六進制數(小寫)

Date Formatting

Date Formatting

  • %%
  • %號本身
  • %a
  • 本地簡化星期名稱
  • %b
  • 本地簡化的月份名稱
  • %c
  • 本地相應的日期表示和時間表示
  • %d
  • 月內中的一天(0-31)
  • %H
  • 24小時制小時數(0-23)
  • %I
  • 12小時制小時數(01-12)
  • %j
  • 年內的一天(001-366)
  • %m
  • 月份(01-12)
  • %p
  • 本地A.M.或P.M.的等價符
  • %S
  • 秒(00-59)
  • %U
  • 一年中的星期數(00-53)星期天為星期的開始
  • %w
  • 星期(0-6),星期天為星期的開始
  • %x
  • 本地相應的日期表示
  • %y
  • 兩位數的年份表示(00-99)
  • %Z
  • 當前時區的名稱
一本一道精品欧美中文字幕_欧美人与动ⅩXXXZOOZ_亚洲Aⅴ在线无码播放毛片一线天_99偷拍视频精品一区二区
<蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <文本链> <文本链> <文本链> <文本链> <文本链> <文本链>