Új hozzászólás Aktív témák

  • sh4d0w

    félisten

    Vki magyarazza el nekem, legyen szives, miert nem mukodik az alabbi kod:

    >>> os.listdir("/")
    ['vmlinuz.old', 'mnt', 'root', 'media', 'sys', 'lib', 'dev', 'home', 'sbin', 'initrd.img.old', 'usr', 'tmp', 'srv', 'lib64', 'bin', 'var', 'run', 'etc', 'boot', 'vmlinuz', 'opt', 'lost+found', 'proc', 'initrd.img']
    >>> for entry in os.listdir("/"):
    ...   if os.path.isfile(entry):
    ...     print "File: " + entry
    ...   if os.path.isdir(entry):
    ...     print "Directory: " + entry
    ...   else:
    ...     print "Whatever: " +entry
    ... 
    Whatever: vmlinuz.old
    Whatever: mnt
    Whatever: root
    Whatever: media
    Whatever: sys
    Whatever: lib
    Whatever: dev
    Whatever: home
    Whatever: sbin
    Whatever: initrd.img.old
    Whatever: usr
    Whatever: tmp
    Whatever: srv
    Whatever: lib64
    Whatever: bin
    Whatever: var
    Whatever: run
    Whatever: etc
    Whatever: boot
    Whatever: vmlinuz
    Whatever: opt
    Whatever: lost+found
    Whatever: proc
    Whatever: initrd.img
    >>> os.path.isfile("/vmlinuz.old")
    True
    >>> os.path.isfile("/var")
    False
    >>> os.path.isdir("/var")
    True
    >>> 

    https://www.coreinfinity.tech

Új hozzászólás Aktív témák