diff --git a/README.md b/README.md index da39021..53d5361 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,12 @@ pip install -r requirements.txt python ./examples/widget_demo.py ``` +## Running examples for integrations of Gooey with other tools +``` +cd integrations/formlayout +pip install -r requirements.txt - - +python example_formlayout.py +``` diff --git a/examples/integrations/formlayout/example_formlayout.py b/examples/integrations/formlayout/example_formlayout.py new file mode 100644 index 0000000..7d598c4 --- /dev/null +++ b/examples/integrations/formlayout/example_formlayout.py @@ -0,0 +1,26 @@ +''' +Combining Gooey and formlayout +''' + +import sys +from gooey import Gooey, GooeyParser +from formlayout import fedit + +@Gooey(auto_start=True) +def main(): + _ = GooeyParser().parse_args(sys.argv[1:]) + + print('Demo starting') + R=fedit(title='Interactive data input example', + data=[ ('What is your name', ''), + ('Are you married?',[2, 'Yes', 'No', 'It\'s complicated']) ], + comment='Please fill the following information with care.') + + if R: + name,mstat = R + print('Welcome {}'. format(name)) + print('Marital status: {}'. format([ 'Married', + 'Free', + 'Not specified' ][mstat])) +if __name__ == '__main__': + main() diff --git a/examples/integrations/formlayout/requirements.txt b/examples/integrations/formlayout/requirements.txt new file mode 100644 index 0000000..f4efa66 --- /dev/null +++ b/examples/integrations/formlayout/requirements.txt @@ -0,0 +1,2 @@ +formlayout>=1.2.0 +PyQt5>=5.5.0