Ha! I figured it out!
I just did it like this lol: print "There are",filecount( path), "files in this directory." and it worked lol.
Thanks for all the help bvdet. Could not have done it without your help.
User Profile
Collapse
-
Alright i got it. And its working perfectly now. Thanks so much bvdet.
Last question though. How can i make it so i can do something like this: "There are",_, "files in this directory." And make it so that the ,_, will display the number of files in the directory. I know that is the correct code right there, but i don't know what would replace the _ in the ,_, ?? How can i go about doing this?Leave a comment:
-
Ok, i used that code you gave me and when i run the script, it works, but still does not display the number of files in the directory. When i do "python example.py" it executes and then directly moves on to the command line. I used raw_input() again to see if anything else was there, but still no output. :(Leave a comment:
-
Counting Files in Directory
Alright well i've been working at this for a ridiculously longer amount of time than i think i should have been, so i finally gave up and that's why im here. I program in C++ and hardly do any python.. ever. So i need a little help and hope you all will be kind enough to throw some knowledge my way.
What i need to do, is count the files in the directory that my python script is currently in. It needs to be able to list ONLY the files,...
No activity results to display
Show More
Leave a comment: