SourceForge.net Logo
[Home]
[Links]
[Download]

Sunjoong
pyTMalign
[Readme] [Install] [Download]

README of Sunjoong
Python modules I have written for various purpose

o FileUtils

  * openByFileExtension()

Example1)

>>> filename = 'README'
>>> fp = openByFileExtension(filename, 'r')
>>> for line in fp.readlines().__iter__():
...    print line
>>> fp.close()

Example2)

>>> filename = 'README.gz'
>>> fp = openByFileExtension(filename, 'r')
>>> for line in fp.readlines().__iter__():
...    print line
>>> fp.close()

Example3)

>>> filename = 'README.bz2'
>>> fp = openByFileExtension(filename, 'r')
>>> for line in fp.readlines().__iter__():
...    print line
>>> fp.close()

Example4)

>>> filename = 'README.Z'
>>> fp = openByFileExtension(filename, 'r')
>>> for line in fp.readlines().__iter__():
...    print line
>>> fp.close()

Example5)

>>> filename = 'README'
>>> fp = openByFileExtension(filename, 'w')
>>> fp.write('test\n')
>>> fp.close()

Example6)

>>> filename = 'README.gz'
>>> fp = openByFileExtension(filename, 'w')
>>> fp.write('test\n')
>>> fp.close()

Example7)

>>> filename = 'README.gz2'
>>> fp = openByFileExtension(filename, 'w')
>>> fp.write('test\n')
>>> fp.close()

Caution)
    valid plain file modes are ['r', 'rb', 'a', 'ab', 'w', 'wb'],
    valid '.gz' file modes are ['r', 'rb', 'a', 'ab', 'w', 'wb'],
    and valid '.bz2' file modes are ['r', 'rb', 'w', 'wb'],
    but valid '.Z' file modes are only 'r' and 'rb'.


o History

Example)
Insert "TAB" key in [tab] position.

>>> from sunjoong import History
>>> dir()
>>> dir(_builtins__)
>>> history
>>> history()
>>> fp = op[tab]('~/.ba[tab]rc', 'r')
>>> for line in fp.readlines().__iter__():
...    print line
>>> fp.close()
>>> history
>>> history()
>>> history.save('saved.py')
>> help(history.save)
>> help(history.clear)
>> help(history.recall)
>> help(history.execute)


2006.07.07    Sunjoong LEE 


INSTALL of Sunjoong
o Installation process
  * example1)
    This example will make files and directories under /usr directory.
    You need superuser privilege.

  $ python setup.py install

  * example2)
    This example will make files and directories under your home directory.
    You should set PATH and PYTHONPATH environment variables to
    "${HOME}/bin" and "${HOME}/lib/python"

  $ python setup.py install --home $HOME


o Prerequisites to build Sunjoong
  Python   version 2.3   or later,  http://www.python.org/


2006.07.15    Sunjoong LEE 


[Readme] [Install] [Download]