Python Script – Printing The Contents Of A Folder
I asked Copilot to create a script for me to read the names of folders in a directory and the names of the files in them, then print them to a text file on separate lines using Python. I was recently asked a question that would require this type of process so I tried it using a coding assistant instead of hammering it out on my own. The script was completed and tested within a few minutes. Copilot + Python is an automation specialist’s dream.
I will say I liked this approach more than asking ChatGPT to do it, which spits out some generic text that really isn’t very helpful. When I asked how to automate this, ChatGPT actually didn’t recommend Python, it recommended PowerShell, although in all fairness it did also include a generic Python script in its response. I’ll have to score Copilot as being more useful in this scenario.
