domingo, 17 de maio de 2015

Navegando em diretórios no Python

Para identificar o diretório atual (pwd):
    import os
    os.getcwd() # cwd = current working directory

Para mudar de diretório (cd):
    import os
    path = '/my/path/'
    os.chdir(path)

Para listar o conteúdo (ls):
    import os
    os.listdir() #retorna um objeto do tipo list (lista), claro!


Um comentário:

  1. PlayCasinoRatos - Casino Poker Software
    PlaycasinoRatos.org is an online poker 슬롯 꽁 머니 software provider that has 바다 이야기 먹튀 developed and developed software 슈어벳먹튀 for multiple casinos 벳 365 우회 접속 in various 승인전화없는 가입머니 parts of the world.

    ResponderExcluir