1269Views4Replies

Author Options:

How to get the properties from a file with python Answered

I need to know how to see if files(like .txt files) are empty with python and how to create new files(like the ones you store pics and .txt files in) and how to move files(like .txt) into the files you just created

Thanks in advance for any answers!

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
mwrenfro
mwrenfro

10 years ago

I recommended Dive Into Python in the previous question. It's not the only place to read, but it's a start. How far did you get in reading through it? What other Python tutorials have you started on, and do you have any code that attempts to check file size, create new files, etc.?

And when you say you want to move files into the files you just created, do you really want to rename one file to another name, or to copy its contents into a new file?

0
FastLearner
FastLearner

Answer 10 years ago

Ok. I know python very well but I dont know how to: 1. create a file(like one you store pictures in) 2. move a file(.txt) That is all p.s. sorry I thought the link was to python.org

0
mwrenfro
mwrenfro

Answer 10 years ago

You mean how to create a folder or directory to store things in? That's entirely different from creating a file.

If so, and if you have as much Python experience as you indicate, then did Googling "create directory python" and "list directory python" not return anything relevant?

0
FastLearner
FastLearner

Answer 10 years ago

thank you for showing me that, it was verry useful!