I'm a student programming using Python.
#File Open Function
def openfile():
filename = filelog.askopenfilename(~~~/omitted/~~) #filename = path to file
refilename = filename.replace('/', '\\\\')
#Calculation Button Function
def clickOK():
bname = refilename.encode('utf-8')
IEEE = C.CDLL('IEEE')
tole = C.c_double(Margin.get())
name = C.c_char_p(bname)
Omitted~~~~~
The value of the refilename used in the "#FileOpen Function" is: I also want to use it in "#calculation button function".
NameError: name 'refilename' is not defined
The above calculation button function is written bname = refilename.code~~ so the above error occurs. How can I write refilename in the function below?
python
If you use the declaration function once as global refilename in the openfile() function, it will be used as a global variable This will be available in clickOK().
563 PHP ssh2_scp_send fails to send files as intended
564 Uncaught (inpromise) Error on Electron: An object could not be cloned
557 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
803 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.