Python Forum
[Tkinter] How to pass args from GUI to pre-written script.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] How to pass args from GUI to pre-written script.
#1
Hello,

First post. New to Python. From a Java background.

I am trying to create a simple GUI for using existing Python scripts without having to use terminal and have run into a brick wall when trying to pass arguments to a method in the script. The method from the script I am trying to pass args to is called alignMain(args) and has such args as args.outputDir args.inputDir.

I am trying to call it like this from my script:

align_dlib.alignMain(outputDir=alignDir.get(), inputDir=rawDir.Get(), landmarks=landmark)

The error I get is: TypeError: alignMain() got an unexpected keyword argument 'outputDir'

Then as a test, I tried without the keyword and I get this error: AttributeError: 'str' object has no attribute 'outputDir'

What am I doing wrong here?

Thank you. (Happy to provide more info if needed.)
Reply
#2
Quote:I am trying to create a simple GUI for using existing Python scripts without having to use terminal
Im not sure why you would do this. The terminal is usually better than GUI in terms of speed and ease. If the program is hard to use via arguments then it falls on the programmer who failed to make it easy.

Quote: (Happy to provide more info if needed.)
As to fix your problem...i htink more info would be required.
Recommended Tutorials:
Reply
#3
I want to make an app with it as a part which can be used on different platforms. This is just one component. Do you require any specific info?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] [Solved]Pass value from GUI to Another Python Script Extra 7 2,127 Aug-27-2022, 08:27 PM
Last Post: Extra
  [Kivy] args converter-help antonmichel 0 2,120 Feb-15-2018, 07:42 PM
Last Post: antonmichel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020