Python规范

最近更新时间:2023-07-24


Python脚本开发者注意事项

  • 支持提交单个py脚本或者zip/tar.gz压缩包
  • 压缩包顶层需要有main.py,平台只会执行这个文件
  • 压缩包体积不可超过1M,解压后不可超过100M
  • 压缩包不可包含dll、so等二进制程序
  • 脚本(或者压缩包内容经解压后)在节点上存放的目录本身是只读的。若程序需要写磁盘,请写在/tmp目录下,可用磁盘空间为10MB
  • 我们为每一个节点生成了一个独一无二的字符串id以便开发者区分脚本运行的宿主,可在/tmp/node_id文件读取

Python版本

目前支持Python 2.7.13

可调用的程序(位于$PATH中,可直接调用)

程序名说明
fpingfping 4.0 https://fping.org/

Python可用库列表

___abcoll_ast_bisect
_bsddb_codecs_collections_csv_ctypes
_curses_elementtree_functools_hashlib_heapq
_hotshot_io_json_locale_lsprof
_LWPCookieJar_markerlib_MozillaCookieJar_multibytecodec_multiprocessing
_pyio_random_socket_sqlite3_sre
_ssl_strptime_struct_symtable_sysconfigdata
_testcapi_tevent_warnings_weakref_weakrefset
abcaifcantigravityanydbmargparse
arrayarrowastasynchatasyncore
atexitattraudiodevaudioopbase64
BaseHTTPServerBastionbdbbinasciibinhex
bisectbitstringbs4bsddbbz2
calendarCDROMcfficffibackendcgi
CGIHTTPServercgitbcharacteristicchardetchunk
cmathcmdcodecodeccodecs
codecscncodecshkcodecsiso2022codecsjpcodecskr
codecstwcodeopcollectionscolorsyscommands
compatcompileallcompilerConfigParsercontextlib
Cookiecookielibcopycopy_regcPickle
cProfilecrc16crcmodcryptCrypto
cryptographycssselectcssutilscStringIOcsv
ctypesctypestestcursescursespaneldataproperty
datetimedateutildbhashdecimaldifflib
dircachedisdistutilsDLFCNdoctest
DocXMLRPCServerdominatedumbdbmdummy_threaddummy_threading
easy_installemailencodingsencutilsensurepip
enumerrnoexceptionsfcntlfilecmp
fileinputfnmatchformatterfpformatfractions
ftplibfunctoolsfuture_builtinsgcgenericpath
getoptgetpassgettextglobgrp
gziphashlibheapqhmachotshot
html5libhtmlentitydefshtmllibHTMLParserhttplib
httplib2humanizeidnaihooksimaplib
imghdrimpimportlibimputilIN
inspectioipaddressitertoolsjson
jsonschemajsonschemavalidatorkeyringkeywordkmod
ldbldbtextlibmountlinecachelocale
logbooklogginglxmlmacpathmacurl2path
mailboxmailcapmarkdown2markupbasemarshal
mathmbstrdecodermd5mhlibmimetools
mimetypesMimeWritermimifymmapmodulefinder
multifilemultiprocessingmutexnetaddrnetifaces
netrcnewnntplibntpathnturl2path
numbersopcodeOpenSSLoperatoroptparse
osos2emxpathosxsupportparserpath
pathvalidatepdbpicklepickletoolspipes
pkcs7pkg_resourcespkgutilplatformplistlib
popen2poplibposixposix_ipcposixfile
posixpathpprintprofilepstatspty
ptyprocesspwdpy_compilepyasn1pyclbr
pydocpyexpatpyinotifypyparsingpytablereader
pytablewriterpytzQueuequoprirandom
rereadlinereprrequestsresource
rexecrfc822rlcompleterrobotparserrunpy
schedselectseleniumsetssetuptools
sgmllibshashelveshlexshutil
signalSimpleHTTPServersimplejsonSimpleXMLRPCServersite
sixsmtpdsmtplibsndhdrsocket
SocketServerspwdsqlite3sresre_compile
sre_constantssre_parsesslstatstatvfs
stringStringIOstringoldstringprepstrop
structsubprocesssunausunaudiosymbol
symtablesyssysconfigsyslogtabnanny
talloctarfiletdbtdbtexttelnetlib
tempfiletermiostest_characteristictest_pathtevent
textwrapthisthreadthreadingthreadinglocal
timetimeittoaifftokentokenize
tomltracetracebackttytype
TYPEStypesubjsonujsonunicodedata
unittesturlliburllib2urlparseuser
UserDictUserListUserStringuuuuid
versiontoolswarningswaveweakrefweb
webbrowserwhichdbwsgirefxdrlibxlrd
xlsxwriterxlutilsxlwtxmlxmllib
xmlrpclibxxsubtypezipfilezipimportzlib