February 25, 2010
Debugging Django

Often you find yourself dealing with an error that only occurs in certain circumstances—a function might be called from dozens of different places in your program but only runs in to trouble in a very specific case. You can use the traceback module to log the current stack, which will allow you to tell how a function was called when something went wrong:

import logging, traceback, pprint    def my_buggy_function(arg):  ...  if error_condition:  stack = pprint.pformat(traceback.extract_stack())  logging.debug('An error occurred: %s' % stack)

The tuple returned by traceback.extract_stack() includes line numbers, function names and paths to Python files so you can use it to reconstruct a good amount of information about your program.

Posted via web from 原宿工業大学 | Comment »

February 24, 2010
Python + Django vs. C# + ASP.NET: Productivity Showdown

The Hypothesis

We can accomplish more with Python + Django than with C# + ASP.NET given the same amount of time without sacrificing quality

Posted via web from hdknr’s posterous | Comment »

Shpinx:make latex: Python 2.6.2 のドキュメントをPDFにする

texを作る

(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc$ make latex
mkdir -p build/latex build/doctrees
sphinx-build  -b latex -d build/doctrees -D latex_paper_size=  . build/latex
Running Sphinx v0.6.4
loading pickled environment… done
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files… none found
processing c-api.tex… c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport
resolving references…
writing… done
processing distutils.tex… distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref
resolving references…
writing… done
processing documenting.tex… documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex
resolving references…
writing… done
processing extending.tex… extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding
resolving references…
writing… done
processing install.tex… install/index
resolving references…
writing… done
processing library.tex… library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle library/idle library/othergui library/development library/pydoc library/doctest library/unittest library/2to3 library/test library/debug library/bdb library/pdb library/profile library/hotshot library/timeit library/trace library/python library/sys library/__builtin__ library/future_builtins library/__main__ library/warnings library/contextlib library/abc library/atexit library/traceback library/__future__ library/gc library/inspect library/site library/user library/fpectl library/custominterp library/code library/codeop library/restricted library/rexec library/bastion library/modules library/imp library/imputil library/zipimport library/pkgutil library/modulefinder library/runpy library/language library/parser library/ast library/symtable library/symbol library/token library/keyword library/tokenize library/tabnanny library/pyclbr library/py_compile library/compileall library/dis library/pickletools library/distutils library/compiler library/misc library/formatter library/windows library/msilib library/msvcrt library/_winreg library/winsound library/unix library/posix library/pwd library/spwd library/grp library/crypt library/dl library/termios library/tty library/pty library/fcntl library/pipes library/posixfile library/resource library/nis library/syslog library/commands library/mac library/ic library/macos library/macostools library/easydialogs library/framework library/autogil library/carbon library/colorpicker library/macosa library/gensuitemodule library/aetools library/aepack library/aetypes library/miniaeframe library/sgi library/al library/cd library/fl library/fm library/gl library/imgfile library/jpeg library/sun library/sunaudio library/undoc
resolving references…
writing… done
processing reference.tex… reference/index reference/introduction reference/lexical_analysis reference/datamodel reference/executionmodel reference/expressions reference/simple_stmts reference/compound_stmts reference/toplevel_components reference/grammar
resolving references…
writing… done
processing tutorial.tex… tutorial/index tutorial/appetite tutorial/interpreter tutorial/introduction tutorial/controlflow tutorial/datastructures tutorial/modules tutorial/inputoutput tutorial/errors tutorial/classes tutorial/stdlib tutorial/stdlib2 tutorial/whatnow tutorial/interactive tutorial/floatingpoint
resolving references…
writing… done
processing using.tex… using/index using/cmdline using/unix using/windows using/mac
resolving references…
writing… done
processing whatsnew.tex… whatsnew/2.6
resolving references…
writing… done
processing howto-unicode.tex… howto/unicode
resolving references…
writing… done
processing howto-functional.tex… howto/functional
resolving references…
writing… done
processing howto-regex.tex… howto/regex
resolving references…
writing… done
processing howto-urllib2.tex… howto/urllib2
resolving references…
writing… done
processing howto-webservers.tex… howto/webservers
resolving references…
writing… done
processing howto-advocacy.tex… howto/advocacy
resolving references…
writing… done
processing howto-curses.tex… howto/curses
resolving references…
writing… done
processing howto-doanddont.tex… howto/doanddont
resolving references…
writing… done
processing howto-sockets.tex… howto/sockets
resolving references…
writing… done
processing howto-cporting.tex… howto/cporting
resolving references…
writing… done
copying TeX support files… done
build succeeded. Build finished; the LaTeX files are in build/latex.
Run `make all-pdf’ or `make all-ps’ in that directory to run these through (pdf)latex.
(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc$ d build/latex/
-bash: d: command not found
(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc$ cd build/latex/
(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc/build/latex$ make all-pdf
pdflatex  ‘c-api.tex’
make: pdflatex: コマンドが見つかりませんでした
make: *** [c-api.pdf] エラー 127


textlive-latex-baseインストール


(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc$ sudo aptitude install texlive-latex-base
パッケージリストを読み込んでいます… 完了
依存関係ツリーを作成しています               
状態情報を読み取っています… 完了
拡張状態情報を読み込んでいます      
パッケージの状態を初期化しています… 完了
タスクの記述を読み込んでいます… 完了       
以下の新規パッケージがインストールされます:
  dvipdfmx{a} libkpathsea4{a} libpaper-utils{a} libpaper1{a} libpoppler3{a} lmodern{a} tex-common{a} texlive-base{a} texlive-base-bin{a} texlive-base-bin-doc{a}
  texlive-common{a} texlive-doc-base{a} texlive-latex-base texlive-latex-base-doc{a}
更新: 0 個、新規インストール: 14 個、削除: 0 個、保留: 0 個。
アーカイブ 64.8MB 中 11.9MB を取得する必要があります。展開後に 139MB のディスク領域が新たに消費されます。
先に進みますか? [Y/n/?] y
…..


(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc/build/latex$ make all-pdf
pdflatex  ‘c-api.tex’
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %&-line parsing enabled.
entering extended mode
(./c-api.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(./manual.cls
Document Class: manual 2008/10/18 Document class (Sphinx manual)
(/usr/share/texmf-texlive/tex/latex/base/report.cls
Document Class: report 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo)))
(/usr/share/texmf-texlive/tex/latex/base/inputenc.sty  ! LaTeX Error: File `utf8x.def’ not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: def) Enter file name:

ファイルがたりないので、Debian Package Search 。

texlive-latex-recommended をインストール


(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc/build/latex$ sudo aptitude install  texlive-latex-recommended
パッケージリストを読み込んでいます… 完了
依存関係ツリーを作成しています               
状態情報を読み取っています… 完了
拡張状態情報を読み込んでいます     
パッケージの状態を初期化しています… 完了
タスクの記述を読み込んでいます… 完了       
以下の新規パッケージがインストールされます:
  ghostscript{a} gs-common{a} lacheck{a} latex-beamer{a} latex-xcolor{a} libcupsimage2{a} libgs8{a} pgf{a} prosper{a} ps2eps{a} psfontmgr{a} texlive-extra-utils{a}
  texlive-generic-recommended{a} texlive-latex-recommended texlive-latex-recommended-doc{a} texlive-pstricks{a} texlive-pstricks-doc{a}
更新: 0 個、新規インストール: 17 個、削除: 0 個、保留: 0 個。
アーカイブ 54.7MB 中 608kB を取得する必要があります。展開後に 98.3MB のディスク領域が新たに消費されます。
先に進みますか? [Y/n/?] Y

…. (main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc/build/latex$ make all-pdf
pdflatex  ‘c-api.tex’
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %&-line parsing enabled.
entering extended mode
(./c-api.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(./manual.cls
Document Class: manual 2008/10/18 Document class (Sphinx manual)
(/usr/share/texmf-texlive/tex/latex/base/report.cls
Document Class: report 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo)))
(/usr/share/texmf-texlive/tex/latex/base/inputenc.sty
(/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def))
(/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty
(/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def))
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
(/usr/share/texmf-texlive/tex/latex/base/t1enc.def))
(/usr/share/texmf-texlive/tex/generic/babel/babel.sty
(/usr/share/texmf-texlive/tex/generic/babel/english.ldf
(/usr/share/texmf-texlive/tex/generic/babel/babel.def)))
(/usr/share/texmf-texlive/tex/latex/psnfss/times.sty) (./fncychap.sty)
(/usr/share/texmf-texlive/tex/latex/tools/longtable.sty) (./sphinx.sty
(/usr/share/texmf-texlive/tex/latex/base/textcomp.sty
(/usr/share/texmf-texlive/tex/latex/base/ts1enc.def))
(/usr/share/texmf-texlive/tex/latex/fancyhdr/fancyhdr.sty)
(/usr/share/texmf-texlive/tex/latex/seminar/fancybox.sty
Style option: `fancybox’ v1.3 <2000/09/19> (tvz)
)

 ! LaTeX Error: File `titlesec.sty’ not found. Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: またっすか。

texlive-latex-extra をインストール

(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc/build/latex$ sudo aptitude install texlive-latex-extra
パッケージリストを読み込んでいます… 完了
依存関係ツリーを作成しています               
状態情報を読み取っています… 完了
拡張状態情報を読み込んでいます     
パッケージの状態を初期化しています… 完了
タスクの記述を読み込んでいます… 完了       
以下の新規パッケージがインストールされます:
  doc-base{a} lesstif2{a} libfreezethaw-perl{a} libmldbm-perl{a} libuuid-perl{a} libxp6{a} preview-latex-style{a} texlive-fonts-recommended{a}
  texlive-fonts-recommended-doc{a} texlive-generic-extra{a} texlive-humanities{a} texlive-humanities-doc{a} texlive-latex-extra texlive-latex-extra-doc{a}
  texlive-pictures{a} texlive-pictures-doc{a} texpower{a} texpower-manual{a} tipa{a} xpdf{a} xpdf-common{a} xpdf-reader{a} xpdf-utils{a}
更新: 0 個、新規インストール: 23 個、削除: 0 個、保留: 0 個。
アーカイブ 111MB 中 0B を取得する必要があります。展開後に 199MB のディスク領域が新たに消費されます。
先に進みますか? [Y/n/?] Y
….. (main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc/build/latex$ make all-pdf
でうまく行った。

(main)hdknr@deblen:~/.ve/main/docs/Python-2.6.2-svn/Doc$ ls build/latex/*.pdf
build/latex/c-api.pdf        build/latex/howto-advocacy.pdf   build/latex/howto-functional.pdf  build/latex/howto-urllib2.pdf     build/latex/reference.pdf
build/latex/distutils.pdf    build/latex/howto-cporting.pdf   build/latex/howto-regex.pdf       build/latex/howto-webservers.pdf  build/latex/tutorial.pdf
build/latex/documenting.pdf  build/latex/howto-curses.pdf     build/latex/howto-sockets.pdf     build/latex/install.pdf           build/latex/using.pdf
build/latex/extending.pdf    build/latex/howto-doanddont.pdf  build/latex/howto-unicode.pdf     build/latex/library.pdf           build/latex/whatsnew.pdf

Posted via email from 原宿工業大学 | Comment »

mod_wsgi — PyAMF - AMF for Python ( ログファイルを別にする )

Create the WSGI startup file for your application in /var/www/wsgi/myApp.wsgi:

 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38
import logging  from logging.handlers import RotatingFileHandler    import application as app      # logging level  LEVEL = logging.DEBUG    # a filename to append log messages to  LOG_FILENAME = '/var/log/apache2/myApp.log'    # max size in bytes before a new log file is created  MAX_SIZE = 2000    # max amount of log files before it rotates  BACKUP_COUNT = 5    # Set up a specific logger with our desired output level  logger = logging.getLogger('MyLogger')  logger.setLevel(LEVEL)    # Add the log message handler to the logger  handler = RotatingFileHandler(LOG_FILENAME,  			      maxBytes=MAX_SIZE,  			      backupCount=BACKUP_COUNT)    # log message formatter  formatter = logging.Formatter("%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s")  handler.setFormatter(formatter)  logger.addHandler(handler)      # hook up logger to gateway  app.gateway.logger = logger    # hook up gateway to mod_wsgi  application = app.gateway

Posted via web from 原宿工業大学 | Comment »

2008-05-26 - 新みのる日記 (python logging)

マイロガーとして使う

まあ、ここまでなら別になんてことはないんですが、

例えば、 warn,error,criticalはコンソールに、debug,infoはファイルに書き出すという

2種類のログを同時に取ってみる。

ソース

# encode=utf-8  import sys,os,logging    # コンソールに出力  logging.basicConfig(level=logging.WARN, format='%(asctime)s %(levelname)s %(message)s')    logging.critical('danger!!')  logging.error('ERRROR!!')  logging.warn('I am man.')  logging.info('You are man.')  logging.debug('Python!!')    # ファイルに出力  logfile = logging.FileHandler(r'C:\Mylogger.txt')  format = logging.Formatter('[%(filename)s:%(lineno)d] %(asctime)s %(levelname)s %(message)s')  logfile.setFormatter(format)  logging.getLogger('MyLogger').addHandler(logfile)  log = logging.getLogger('MyLogger')  log.setLevel(logging.DEBUG)    log.critical('MyLogger CRITICAL')  log.error('MyLogger ERROR')  log.warn('MyLogger WARN')  log.info('MyLogger INFO')  log.debug('MyLogger DEBUG')  

コンソール出力

2008-05-26 23:37:56,155 CRITICAL danger!!  2008-05-26 23:37:56,155 ERROR ERRROR!!  2008-05-26 23:37:56,171 WARNING I am man.  2008-05-26 23:37:56,171 CRITICAL MyLogger CRITICAL  2008-05-26 23:37:56,171 ERROR MyLogger ERROR  2008-05-26 23:37:56,171 WARNING MyLogger WARN  2008-05-26 23:37:56,187 INFO MyLogger INFO  2008-05-26 23:37:56,187 DEBUG MyLogger DEBUG  

ファイルの中身

[logging2-test.py:21] 2008-05-26 23:40:24,765 CRITICAL MyLogger CRITICAL  [logging2-test.py:22] 2008-05-26 23:40:24,780 ERROR MyLogger ERROR  [logging2-test.py:23] 2008-05-26 23:40:24,780 WARNING MyLogger WARN  [logging2-test.py:24] 2008-05-26 23:40:24,780 INFO MyLogger INFO  [logging2-test.py:25] 2008-05-26 23:40:24,780 DEBUG MyLogger DEBUG  

コンソールにはデフォルト(root)ロガーとMyLoggerのロガー出力がされて、

ファイルにはMyLoggerの出力のみで設定通りにうごいてるので、完了!!

Posted via web from 原宿工業大学 | Comment »

Python:logging

ログ関係のモジュールを用意する。


(djtweet)hdknr@deblen:~/.ve/djtweet/src/djcube/www/website$ more journal.py
import logging
#
def initialize():
    # apache error.log
    logging.basicConfig(level=logging.DEBUG,
                     format=’%(asctime)s %(levelname)s %(message)s’)

WSGIスクリプトとか最初に動くコードで初期化する

from app.journal import initialize
initialize()

プログラムの中で記録する

import logging
logging.debug(‘@@@’+str(type(ret))+str(ret.toPostArgs()))
mod_wsgiの場合、error.log にログされます。

Posted via email from 原宿工業大学 | Comment »

loggingモジュールで複数の出力先に別のログレベルで出力する - ytokuがつまづいた跡

しかし、それよりもbaseConfigメソッドで目についた所があった。if len(root.handlers) == 0:である。どうやらハンドラが登録されていればこのメソッドは丸ごと不要らしい。baseConfigは呼び出さなければならないという固定観念にとらわれていたが、確かに考えてみると複数ハンドラを登録して、ロガーのレベルを設定してやれば別に呼び出す必要はない。というわけで次のように書くことでやりたいことを実現できた。

import logging    logging.getLogger('').setLevel(logging.DEBUG)    logfile=logging.FileHandler("/tmp/test-logfile", "w")  logfile.setLevel(logging.INFO)  logging.getLogger('').addHandler(logfile)    console=logging.StreamHandler();  console.setLevel(logging.WARNING)  logging.getLogger('').addHandler(console)    logging.debug('A debug message')  logging.info('Some information')  logging.warning('A shot across the bows')

Posted via web from hdknr’s posterous | Comment »

Python : __class__ 特殊属性

(djtweet)hdknr@deblen:~/.ve/djtweet/src/djcube/djcube$ python
Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26)
[GCC 4.3.2] on linux2 
Type “help”, “copyright”, “credits” or “license” for more information.
»> class A:
… URL=’/’
… def __init__(self):
… print self.__class__.URL

»> class AA(A):
… URL=’/thankyou’

»> a=A()
/
»> aa=AA()
/thankyou http://docs.python.org/library/stdtypes.html

Posted via email from 原宿工業大学 | Comment »

February 20, 2010
スクリプト言語の比較::eval

Python

eval で代入はできないらしい(?)

>>> eval("i = 1")  Traceback (most recent call last):  File "<stdin>", line 1, in ?  File "<string>", line 1  i = 1  ^  SyntaxError: invalid syntax  

eval が使えない訳ではない。

>>> print eval("1 + 2 ")   3  

代入は式でなく文なので exec を使います。

>>> exec("i=1")  >>> i  1

Posted via web from 原宿工業大学 | Comment »

Python:__import__ で動的にモジュールを読み込む

サンプルDjangoプロジェクト


(djtweet)hdknr@deblen:~/.ve/djtweet/src/djcube/www/website$ tree
.
|— __init__.py
|— __init__.pyc
|— enable.py
|— manage.py
|— promocode
|   |— __init__.py
|   |— __init__.pyc
|   |— hoge.py
|   |— hoge.pyc
|   |— models.py
|   |— tests.py
|   |— urls.py
|   |— urls.pyc
|   |— views.py
|   `— views.pyc
|— settings.py
|— settings.pyc
|— urls.py
|— urls.pyc
`— wsgi.py 1 directory, 19 files


(djtweet)hdknr@deblen:~/.ve/djtweet/src/djcube/www/website$ python manage.py shell
imported django settings
Python 2.5.2 (r252:60911, Jan  4 2009, 17:40:26)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
(InteractiveConsole)
»> m = __import__(‘website.promocode.hoge’,{},{},’hoge’)
»> m
<module ‘website.promocode.hoge’ from ‘/home/hdknr/.ve/djtweet/src/djcube/www/website/../website/promocode/hoge.pyc’>
»> dir(m)
[‘__builtins__’, ‘__doc__’, ‘__file__’, ‘__name__’, ‘hello’]
»> m.hello()
hoge

Posted via email from 原宿工業大学 | Comment »