Re: VPL: How to run a graphical tkinter (Python) program
Re: VPL: How to run a graphical tkinter (Python) program
By default, VPL does not offer this feature. VPL does not allow console iteration when running Python with GUI.
If you want this behavior, you must set the following script at "advanced features->execution files->vpl_run.sh" file.
#!/bin/bash # This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/ # Script for running Python language # Copyright (C) 2014 onwards Juan Carlos Rodríguez-del-Pino # License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later # Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es> # @vpl_script_description Using python3 with the first file # load common script and check programs . common_script.sh check_program python3 get_first_source_file py cat common_script.sh > vpl_execution echo "export TERM=ansi" >>vpl_execution echo "python3 \"$FIRST_SOURCE_FILE\"" >>vpl_execution chmod +x vpl_execution mv vpl_execution console_execution get_source_files py check_program x-terminal-emulator xterm cat common_script.sh > vpl_execution echo "$PROGRAM -e ./console_execution" >> vpl_execution echo "sleep 5s" >> vpl_execution echo "wait_end console_execution" >> vpl_execution mv vpl_execution vpl_wexecution
Best regards,
Juan Carlos.
Re: VPL: How to run a graphical tkinter (Python) program
Best Regards
Smita Shrivastava
Re: VPL: How to run a graphical tkinter (Python) program
I will try to answer your questions:
A1) You can add a "read" command to wait for the "return key"
echo "read"" >>vpl_execution
add after "echo python3 ...
A2) I think that this issue about programming and not related to VPL or the custom script.
A3) Sorry, but I don't know.
A4) No. VPL manages as binary the image files with the following file extensions: gif, jpg, jpeg, png, ico. The use of these files programmatically is not related to VPL.
A5) No, I don't have a similar solution for Java. Notice that I have a specific script to resolve your problem with Python because a colleague had the same problem, and I wrote the script for him. We are planning to develop a global solution but not yet done.
best regards,
Juan Carlos.