mercredi 4 avril 2012

pyhon, module

cd /var/www/html
[root@test11 html]# ls

info.php

[root@test11 html]# touch index.html
[root@test11 html]# view index.html

(make your Welcome text message)

[root@test11 html]# python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
localhost - - [04/Apr/2012 11:05:26] "GET / HTTP/1.1" 200 -
localhost - - [04/Apr/2012 11:05:26] code 404, message File not found
localhost - - [04/Apr/2012 11:05:26] "GET /favicon.ico HTTP/1.1" 404



L'option m permet de définir les modules utilisés
-m module-name
Searches sys.path for the named module and runs the correspond‐
ing .py file as a script.


Liste des modules
  • In ipython you can type "importTab".

  • In the standard Python interpreter, you can type "help('modules')".

  • At the command-line, you can use pydoc modules.

  • In a script, call pkgutil.iter_modules().


lancer ipython
In [2]: import
Display all 573 possibilities? (y or n)
ANSI formatter
AptUrl fpectl
ArgImagePlugin fpformat
BaseHTTPServer fractions
Bastion ftplib
BdfFontFile functools
BmpImagePlugin future_builtins
BufrStubImagePlugin gc
CDROM gconf
CGIHTTPServer gdbm
Canvas genericpath
CommandNotFound getopt
ConfigParser getpass
ContainerIO gettext
Cookie gi
Crypto gio
CurImagePlugin glib
DLFCN glob
DcxImagePlugin gnome_sudoku
Dialog gnomekeyring
DistUpgrade gobject
DocXMLRPCServer google
EpsImagePlugin grp
ExifTags gst
FSM gstoption
FileDialog gtk
FitsStubImagePlugin gtkunixprint
FixTk gwibber
FliImagePlugin gzip
FontFile hashlib
FpxImagePlugin heapq
GbrImagePlugin hmac
GdImageFile hotshot
GifImagePlugin hpmudext
GimpGradientFile htmlentitydefs
GimpPaletteFile htmllib
GnuPGInterface httplib
GribStubImagePlugin httplib2
HTMLParser ibus
Hdf5StubImagePlugin ihooks
IN imageop
IPython imaplib
IcnsImagePlugin imghdr
IcoImagePlugin imp
ImImagePlugin importlib
Image imputil
ImageChops inspect
ImageCms io
ImageColor itertools
ImageDraw jockey
ImageDraw2 json
ImageEnhance keyring
ImageFile keyword
ImageFileIO language_support_pkgs
ImageFilter launchpadlib
ImageFont lazr
ImageGL lib2to3
ImageGrab libproxy
ImageMath libxml2
ImageMode libxml2mod
ImageOps linecache
ImagePalette linuxaudiodev
ImagePath locale
ImageQt logging
ImageSequence louis
ImageShow lsb_release
ImageStat macpath
ImageTransform macurl2path
ImageWin mailbox
ImtImagePlugin mailcap
IptcImagePlugin mako
JpegImagePlugin markupbase
LanguageSelector markupsafe
McIdasImagePlugin marshal
MicImagePlugin math
MimeWriter md5
MpegImagePlugin mhlib
MspImagePlugin mimetools
NvidiaDetector mimetypes
OleFileIO mimify
Onboard miniterm
OpenSSL mmap
PAMmodule modulefinder
PIL multifile
PSDraw multiprocessing
PaletteFile mutex
PalmImagePlugin mx
PcdImagePlugin netrc
PcfFontFile new
PcxImagePlugin nis
PdfImagePlugin nntplib
PixarImagePlugin ntpath
PngImagePlugin nturl2path
PpmImagePlugin numbers
PsdImagePlugin oauth
PyQt4 oneconf
Queue opcode
Quirks operator
ScrolledText optparse
SgiImagePlugin orca
SimpleDialog os
SimpleHTTPServer os2emxpath
SimpleXMLRPCServer ossaudiodev
SocketServer packagekit
SpiderImagePlugin pango
StringIO pangocairo
SunImagePlugin papyon
TYPES parallelmagic
TarIO parser
TgaImagePlugin pcardext
TiffImagePlugin pdb
TiffTags pexpect
Tix pickle
Tkconstants pickletools
Tkdnd pilconvert
Tkinter pildriver
UbuntuSystemService pilfile
UpdateManager pilfont
UserDict pilprint
UserList pipes
UserString piston_mini_client
WalImageFile pkg_resources
WmfImagePlugin pkgutil
XKit platform
XVThumbImagePlugin plistlib
XbmImagePlugin popen2
XpmImagePlugin poplib
_LWPCookieJar posix
_MozillaCookieJar posixfile
__builtin__ posixpath
__future__ pprint
__main__ problem_report
__phello__ profile
_abcoll pstats
_ast pty
_bisect pwd
_bsddb pxssh
_codecs pyHnj
_codecs_cn py_compile
_codecs_hk pyatspi
_codecs_iso2022 pychecker
_codecs_jp pychecker2
_codecs_kr pyclbr
_codecs_tw pycurl
_collections pydoc
_csv pydoc_data
_ctypes pyexpat
_ctypes_test pygst
_curses pygtk
_curses_panel pyinotify
_dbus_bindings pynotify
_dbus_glib_bindings quopri
_elementtree random
_functools re
_hashlib readline
_heapq reportlab
_hotshot repr
_imaging resource
_imagingcms rexec
_imagingft rfc822
_imagingmath rlcompleter
_io robotparser
_json runpy
_locale scanext
_lsprof sched
_multibytecodec screen
_multiprocessing select
_pyio serial
_random sessioninstaller
_renderPM sets
_rl_accel sgmllib
_socket sgmlop
_sqlite3 sha
_sre shelve
_ssl shlex
_strptime shutil
_struct signal
_symtable simplegeneric
_testcapi simplejson
_threading_local sip
_warnings sipconfig
_weakref sipconfig_nd
_weakrefset site
abc sitecustomize
aifc smbc
antigravity smtpd
anydbm smtplib
appindicator sndhdr
apport socket
apport_python_hook softwarecenter_aptd_plugins
apt softwareproperties
apt_inst speechd
apt_pkg speechd_config
aptdaemon spwd
aptsources sqlite3
argparse sre
array sre_compile
ast sre_constants
asynchat sre_parse
asyncore ssl
atexit stat
atk statvfs
audiodev storemagic
audioop string
autoreload stringold
axi stringprep
base64 strop
bdb struct
binascii subprocess
binhex sunau
bisect sunaudio
brlapi symbol
bsddb sympyprinting
butterfly symtable
bz2 sys
cPickle sysconfig
cProfile syslog
cStringIO tabnanny
cairo tarfile
calendar telepathy
cgi telnetlib
cgitb tempfile
chardet termios
checkbox test
checkbox_qt textwrap
chunk this
cmath thread
cmd threading
code time
codecs timeit
codeop tkColorChooser
collections tkCommonDialog
colorsys tkFileDialog
commands tkFont
compileall tkMessageBox
compiler tkSimpleDialog
computerjanitor toaiff
configglue token
configobj tokenize
contextlib trace
cookielib traceback
copy ttk
copy_reg tty
crypt turtle
csv twisted
ctypes types
cups ubuntu_sso
cupsext ubuntuone
cupshelpers ufw
curl unicodedata
curses unittest
datetime uno
dateutil unohelper
dbhash urllib
dbm urllib2
dbus urlparse
deb822 usbcreator
debconf user
debian uu
debian_bundle uuid
debtagshw validate
decimal virtkey
decorator vtemodule
defer wadllib
difflib warnings
dircache wave
dirspec weakref
dis webbrowser
distutils whichdb
dl wsgiref
doctest wx
drv_libxml2 wxPython
dsextras wxversion
dumbdbm xapian
dummy_thread xdg
dummy_threading xdiagnose
duplicity xdrlib
email xml
encodings xmllib
errno xmlrpclib
exceptions xxsubtype
farsight zeitgeist
fcntl zipfile
fdpexpect zipimport
filecmp zlib
fileinput zope
fnmatch



Aucun commentaire:

Enregistrer un commentaire