Is there a way of having a GUI for bash scripts?
I have some 开发者_JAVA百科bash scripts, some simple ones to copy, search, write lines to files and so on.
I am an Ubuntu. and I've searched in google, but it seems that everybody is doing that on python. I could do these on python, but since I am not a python programmer, I just know the basics. I have no idea of how calling a sh script from a GUI written on python.
If someone has a link or something to say, please drop a line.
regards, Mario
Is there a way of having a GUI for bash scripts?
You can try using Zenity.
a tool that allows you to display GTK dialog boxes in commandline and shell scripts.
I have no idea of how calling a sh script from a GUI written on python.
You can do this using subprocess
.
Personally I would recommend that you learn Python and call the scripts from Python instead of trying to write the GUI in Bash.
basically, all bash does is start other programs (and do symbolic math on the command line). So no, you're going to have to involve some other program.
I do not fully understand what you want. Calling a shell script from python, is like calling any executable from python, using os.system.
In fact there're several 'guis' for bash, namely zenity and others.
If you want to be able to display dialog boxes, calendar selection boxes, etc. you might want to take a look at dialog and whiptail. They are not graphical - they use text mode - but they may be adequate for your needs.
精彩评论