python directory 다루기

Python : 2009. 1. 21. 13:26
반응형

root@realg-desktop:~# l
합계 88
drwxr-xr-x 14 root root 4096 2009-01-13 20:07 .
drwxr-xr-x 23 root root 4096 2009-01-21 13:15 ..
-rw-------  1 root root 5108 2009-01-15 16:09 .bash_history
-rw-r--r--  1 root root 2227 2008-08-09 02:53 .bashrc
drwxr-xr-x  3 root root 4096 2008-11-10 13:23 .cache
drwx------  3 root root 4096 2008-11-10 13:23 .config
drwx------  3 root root 4096 2008-10-31 17:28 .dbus
-rw-------  1 root root   16 2008-11-09 17:49 .esd_auth
drwx------  2 root root 4096 2009-01-18 18:42 .gconf
drwx------  2 root root 4096 2009-01-18 18:42 .gconfd
drwx------  3 root root 4096 2008-10-31 17:28 .gnome2
drwx------  2 root root 4096 2008-10-31 17:28 .gnome2_private
drwx------  3 root root 4096 2008-12-31 23:49 .kde
drwxr-xr-x  3 root root 4096 2008-11-10 13:23 .local
-rw-------  1 root root  803 2009-01-13 20:07 .mysql_history
-rw-r--r--  1 root root  318 2008-12-31 21:59 .profile
drwxr-xr-x  2 root root 4096 2008-10-31 17:26 .pulse
-rw-------  1 root root  256 2008-10-31 17:26 .pulse-cookie
-rw-------  1 root root  218 2008-11-10 17:58 .recently-used.xbel
drwx------  3 root root 4096 2009-01-12 14:22 .synaptic
drwxr-xr-x  2 root root 4096 2008-10-30 08:12 .wapi
lrwxrwxrwx  1 root root   34 2008-12-31 22:14 ek-lm3s8962 -> /LM3S/DriverLib/boards/ek-lm3s8962
lrwxrwxrwx  1 root root   14 2008-12-26 01:52 embeded -> /aesop/rootfs/
root@realg-desktop:~# python
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob
>>> glob.glob('*')
['embeded', 'ek-lm3s8962']


>>> glob.glob('[abc]*.py')
[]
>>> os.listdir('.')
['.mysql_history', 'embeded', '.gconfd', '.kde', '.bash_history', '.cache', '.dbus', '.config', '.bashrc', '.esd_auth', '.synaptic', '.recently-used.xbel', '.gnome2_private', '.local', '.gnome2', '.gconf', '.pulse-cookie', 'ek-lm3s8962', '.profile', '.wapi', '.pulse']
>>>
반응형

'Python' 카테고리의 다른 글

python beautiful soup html parsing  (0) 2009.01.21
django 실습  (0) 2008.12.13
img2py wxPython에서 이미지를 파일에 포함하기  (0) 2008.12.03
Posted by Real_G