Guest - MarcelComputacao - Posted November 25, 2006 Report Share Posted November 25, 2006 como faco para verificar se um arquivo tem dados sem abri-lo e le-lo ? :unsure: Quote Link to comment Share on other sites More sharing options...
0 Kakao Posted November 25, 2006 Report Share Posted November 25, 2006 Você pode testar o tamanho do arquivo:import os diretorio = '/home/cpn/workspace/pythonlearn' arquivo = 'usuarios.txt' caminho = os.path.join(diretorio, arquivo) tamanho = os.stat(caminho).st_size print tamanho Quote Link to comment Share on other sites More sharing options...
Question
Guest - MarcelComputacao -
como faco para verificar se um arquivo tem dados sem abri-lo e le-lo ? :unsure:
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.