Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generate a list
#3
You should try yourself as this is a relative easy task,we do not like a task posted without any effort,then is more job description.
That's said here a start(saving to log file you should try yourself), these days pathlib is a more modern way to do it.
import pathlib

win_dir = r'C:\Windows\System32'
for file in pathlib.Path(win_dir).glob('*.exe'):
    if file.is_file():
        print(file)
nilamo likes this post
Reply


Messages In This Thread
Generate a list - by sasitha96 - Sep-19-2021, 06:15 PM
RE: Generate a list - by nilamo - Sep-19-2021, 06:47 PM
RE: Generate a list - by sasitha96 - Sep-20-2021, 07:01 PM
RE: Generate a list - by snippsat - Sep-19-2021, 06:48 PM
RE: Generate a list - by sasitha96 - Sep-20-2021, 07:03 PM
RE: Generate a list - by dgrunwal - Sep-20-2021, 05:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to generate a log in a list style? wagnergt12 5 2,832 Apr-22-2020, 12:47 PM
Last Post: buran
  extract first and last 5 elements from given list and generate a new list. Raj_Kumar 1 2,408 Dec-07-2019, 05:03 PM
Last Post: ichabod801
  I created a function that generate a list but the list is empty in a new .py file mrhopeedu 2 2,365 Oct-12-2019, 08:02 PM
Last Post: mrhopeedu
  Generate list in class P13N 7 4,447 Dec-28-2018, 10:08 PM
Last Post: P13N
  Generate a list of numbers within a list of arbitrary numbers Takeshio 4 3,550 Nov-08-2018, 12:29 AM
Last Post: Takeshio
  How to generate the list I want? Krookroo 6 4,169 Sep-07-2017, 02:06 PM
Last Post: Krookroo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020