I'm working on an online tutorial for Python, & I'm trying to go a little farther for an example problem than it calls for.
The objective is to rename all the files in a folder. My addition is to prompt the user for the folder, rather than hardcoding it.
I've tried the suggestions in Python: user input and commandline arguments, but when I run the script no prompt text is displayed.
As it stands my script looks like this:
import os
import sys
import optparse
def RName_Files():
#Get the folder to user
Fol = raw_input("Please enter the folder whose files should have numbers stripped from their name: ") #I've never run past this point
#Iterate through the files in the folder
for f in ListDir(f):
print("Current file is '" + f)
I imagine I'm misunderstanding the answers in the question I linked to, and was hoping someone could clarify the responses for me. Especially since that thread mixes 2.7 and 3.x.
Thanks!