简体   繁体   中英

Main() missing 2 required positional arguments

I know that I need to pass 'path' and 'window' to 'main', but I can't quite figure out how this can be done.

蟒蛇 3

The main() function you defined has two arguments: path and windows . When calling main() at the last line, you should fill in the two parameters with the appropriate objects.

Your main only uses path and window in one place: when calling load_image . I suspect you should always use newwindow in main and not pass it in from top-level (in other words, eliminate the window arg from main ). On the other hand, path is probably something you want the user to enter on the command line, so you probably want to get it from the argv. But for a quick test, you could hardcode it in line 76.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM