I’m trying to get two pictures from two different file loaders and send them to one function in Google Collab when both of the files have been uploaded in the anvil app.
This is what I’ve tried but it says that self has not been defined
Unsolicited advice: debugging Anvil apps should become much easier after learning more Python. I really think you’ll save yourself a lot of frustration by doing that first.
I’m trying to call a function where after the user uploads two pictures in the file_loader the first argument of the function is the 1st file uploaded and the second argument is the 2nd file uploaded.
Code Sample:
def file_loader_1_change(self, files, **event_args):
"""This method is called when a new file is loaded into this FileLoader"""
# Call google colab function and transfers the two files
dimension = anvil.server.call('send_dims', first_file_uploaded, second_file_uploaded)
Is there a way to access only the first file and then only the second file? This way I could assign the first file to file1, then assign the second file to file2 like this:
def file_loader_1_change(self, files, **event_args):
"""This method is called when a new file is loaded into this FileLoader"""
file1= #method to call the first file
file2= #method to call the second file
# Call google colab function and transfers the two files
dimension = anvil.server.call('send_dims', file1, file2)
(I moved your new post here. It’s helpful to keep related topics together rather than starting a new thread. I think my previous reply should answer this new question also.)