I have a function called MyScript() that I have defined in a file called MyScript.py. MyScript takes several arguments that I would like to prompt the user in the command line to enter. So I wrote a separate function RunMyScript() defined in RunMyScript.py to first run in the command line to gather the arguments:
def RunMyScript():
import os
dir1 = input('Enter the Directory1 file path: ')
dir2 = input('Enter the Directory2 file path: ')
dir3 = input('Enter the Directory3 file path: ' )
flag = input('Flag? (Y/N): ')
os.chdir = dir1
from MyScript import MyScript
MyScript(dir2,dir3,flag)
And then generically the MyScript function begins:
def MyScript(dir2,dir3,flag="N"):
import os
os.chdir(dir2)
if flag=="Y":
DoSomething
wb.save(dir3)
When I try to run RunMyScript in the command line I get the error "TypeError: 'str' object is not callable. I suspect it has something to do with how it interprets the flag input Y or N, but I'm not positive.
I am new to Python and the site so please pardon me if the question is not phrased properly, I will provide more detail as needed, and I have searched the site for similar questions but it's not clear that I'm having the same problem as others in the past.
Thank you.