Python for s60 输出重定向和模块列表

本文介绍如何在S60系统中使用Python,包括Interactive命令输入及脚本运行方式。通过重定向屏幕输出至文件的方法解决帮助信息显示不全的问题,并提供详细的模块列表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Python for S60是赛班系统的Python。既可以Interactive的输入命令,也可以运行脚本。帮助信息可以通过函数help获得,如查询有哪些modules,可以使用命令>>>help('modules'),或输入>>>help(),然后输入modules,不过由于module太多,显示的缓存太小,只能显示最后的一些modules。如何查看所有的输出,方法是将屏幕输出重定向到文件。导入sys模块,sys.stdout的值可能为<series60_console.Console instance at 0x17649b8>,只要将该属性设为文件的句柄就可以,文件句柄可以通过fh=open('filename','w')获得。给sys.stdout赋值前先保存该值以便恢复。将文件句柄赋予sys.stdout后,再输入>>>help('modules')或>>>print help('modules')屏幕无输出,查看fh对应的文件就可以看到所有的模块信息。最后有必要恢复sys.stdout的原值和关闭fh,fh.close()。

附上模块列表

help> 

Please wait a moment while I gather a list of all available modules...

 

BaseHTTPServer      copy_reg            logs                shlex

ConfigParser        csv                 mailbox             shutil

Cookie              decimal             markupbase          site

DocXMLRPCServer     difflib             marshal             smtplib

HTMLParser          dir_iter            md5                 sndhdr

MimeWriter          dircache            messaging           socket

Queue               dis                 mhlib               sre

SimpleHTTPServer    doctest             mime                sre_compile

SocketServer        dom                 mimetools           sre_constants

StringIO            dumbdbm             mimetypes           sre_parse

UserDict            dummy_thread        multifile           stat

UserList            dummy_threading     netrc               string

UserString          e32                 new                 stringprep

_LWPCookieJar       e32calendar         ntpath              strop

_MozillaCookieJar   e32dbm              nturl2path          struct

__builtin__         email               opcode              subprocess

__future__          encodings           optparse            symbol

_ast                etree               os                  symtable

_codecs             exceptions          parsers             sys

_sre                filecmp             pdb                 sysinfo

_strptime           fileinput           pickle              tarfile

_threading_local    fnmatch             pickletools         telephone

aifc                formatter           pkgutil             tempfile

anydbm              fpformat            platform            textwrap

appuifw             ftplib              popen2              threading

asynchat            functools           positioning         time

asyncore            gc                  posix               token

atexit              getopt              posixpath           tokenize

audio               gettext             pprint              topwindow

base64              gles_utils          profile             trace

bdb                 glob                pstats              traceback

binhex              graphics            pty                 tty

bisect              gzip                py_compile          types

btconsole           hashlib             pyclbr              unittest

btsocket            heapq               pydoc               urllib

cProfile            hmac                quopri              urllib2

calendar            hotshot             random              urlparse

camera              htmlentitydefs      re                  uu

cgi                 htmllib             repr                uuid

chunk               httplib             rfc822              viewfinder

cmd                 imaplib             robotparser         warnings

code                imghdr              runpy               wave

codecs              imp                 sax                 weakref

codeop              inspect             sensor              whichdb

colorsys            interactive_console sensor_api          wsgiref

commands            key_codes           sensor_defs         xdrlib

compiler            keycapture          sensorfw            xml

consolidated_imports keyword             series60_console    xmllib

contacts            linecache           sets                xmlrpclib

contextlib          locale              sgmllib             zipfile

cookielib           location            sha                 zipimport

copy                logging             shelve              zlib

 

Enter any module name to get more help.  Or, type "modules spam" to search

for modules whose descriptions contain the word "spam".

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值