0
Return from another file
I have two files. File1: string = âstring" def returnString(): return string File 2: import file1 string = file1.returnString() I get an exception : AttributeError I think it's a beginners mistake, but I don't know, what I'm doing wrong here. Thanks in advance for your help.
2 Answers
+ 2
Is file1 the name of your script?
Did you try
def returnString():
return "My string"
in file 1?
+ 1
I renamed some files and did not notice, that I import file1 from file2 and the other way around... đ€ Thanks for your help!