:D
Thank you, so much!
It worked!
*bows to the epic superiority of bvdet*
Now, if you want to delete the folder, it would be
path = os.getcwd()
os.rmdir(path)
correct, no?
User Profile
Collapse
-
Grr...
Okay, this is the script I have so far...
I'm going to guess that I'm doing it completely wrong...Code:import os curDir = os.listdir(os.getcwd()) for fn in fileList: os.remove(os.path.join(curDir, fn)
So... the listdir is supposed to list the files that are in the current directory
Then for the filename in the list, remove ((Current DIrectory)+File name)
...Leave a comment:
-
If I do the first, I end up with:
Traceback (most recent call last):
File "<pyshell#1 9>", line 1, in <module>
os.remove(os.li stdir(os.getcwd ()))
TypeError: remove() argument 1 must be string, not list
So how do I make all of the list, which can vary thus needing of a wildcard, into strings? I'm sorry, but I just picked up programming a little while ago, and Python just...Leave a comment:
-
Wildcard Strings in Path
Okay, this is what I need to do, and I keep getting confused.
I need to remove all files in a folder, then delete the folder, it's part of an installer I'm making, and it creates a directory, I just don't know how to delete it. This is what I have right now:
curDir = os.getcwd()
os.remove(os.pa th.join(curDir, *)
So it will remove all the files in the directory it is in. How do I use the wildcard to make it all files in...
No activity results to display
Show More
Leave a comment: