Re: python show folder files and not subfolder files

2020-10-04 Thread Cameron Simpson
On 04Oct2020 02:56, pascal z wrote: >On Thursday, September 24, 2020 at 4:37:07 PM UTC+2, Terry Reedy wrote: >> Read >> https://docs.python.org/3/faq/programming.html#what-is-the-most-efficient-way-to-concatenate-many-strings-together > >Thanks for this tip. I do think it's better to use lists tha

Re: python show folder files and not subfolder files

2020-10-04 Thread pascal z via Python-list
On Thursday, September 24, 2020 at 4:37:07 PM UTC+2, Terry Reedy wrote: > On 9/23/2020 7:24 PM, pascal z via Python-list wrote: > > Please advise if the following is ok (i don't think it is) > > > > #!/usr/bin/env python3 > > # -*- coding: utf-8 -*- > > > > import os > > > > csv_contents = "" >

Re: python show folder files and not subfolder files

2020-09-24 Thread Terry Reedy
On 9/23/2020 7:24 PM, pascal z via Python-list wrote: Please advise if the following is ok (i don't think it is) #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os csv_contents = "" output_file = '/home/user/Documents/csv/output3csv.csv' Lpath = '/home/user/Documents/' csv_contents = "F

Re: python show folder files and not subfolder files

2020-09-23 Thread pascal z via Python-list
ok, i came up with if os.path.isfile(path) following path = os.path.join(Lpath, f) and it seems to be ok, no dupplicates or wrong sizes... thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: python show folder files and not subfolder files

2020-09-23 Thread pascal z via Python-list
Please advise if the following is ok (i don't think it is) #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os csv_contents = "" output_file = '/home/user/Documents/csv/output3csv.csv' Lpath = '/home/user/Documents/' csv_contents = "FOLDER PATH;Size in Byte;Size in Kb;Size in Mb;Size in Gb

Re: python show .

2020-09-23 Thread Cameron Simpson
On 23Sep2020 13:24, pascal z wrote: >Hello, I'm working on a script where I want to loop into folders somehow >recursively to get information but I want to limit the infos for the files on >a certain level of folders for example: > >/home/user/Documents/folder1 >/home/user/Documents/folder2 >/ho