Which style for autorun script is better: prompt console(.sh) or GUI(.py)
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Which style for autorun script is better: prompt console(.sh) or GUI(.py)
Hi,
I am working on my first autorun script which is used to install some software, drivers for hardware, and compile something. I think I could implement it in two ways: writing a shell script(.sh) file or constructing a Python file.
Since I will use some script commands like "zypper" to install software (for SUSE Linux 10), and also other Linux commands, I think the shell script file is a direct way to collect them. But maybe I am new to the shell script file, in some case I feel it's hard to offer a more friendly interactive console for user than GUI.
With a Python program using Tkinter, the GUI can be implemented. By using os.system(), the script command or even shell script file could be called from the python program. But sometimes the parameters passing between the script and python make things complicated.
Is there a rule that such autorun script should be written in which pattern? or which one is better? and why? (I searched some and most are with the script file.)
Preface: not a software delivery expert and I'm not even sure what you mean by 'autorun' unless you mean you're going to be shipping CDs and Linux DEs are now doing the full tilt Windows thing.
That said, if you're sure all your users are going to be in a graphical environment with python and everything else installed, I don't see any reason why you shouldn't do it in a way you're most comfortable with and will create the best user experience. However, if you want to reach any user in any environment, then a shell script would be much better and, aside from your familiarity, might well be easier/shorter/more direct. As far as shell UI other than command line, the 'dialog' program can be used to construct a decent menu/box interface without too much trouble, if that will be available to your users. I'm not sure what the advantage of lashing python and shell together would be, though. Seems like the worst of both worlds from your point of view and of no advantage to the user.
The script I am writing is to autorun a CD which will install drivers for some GPIB /serial cards, and then debug and install a single purpose software which will later use those cards for acquiring data from GPIB/serial device.
I will try the Python programming. Since some performance, for example, the driver installation, or getting the hardware status, should be done in the shell script, the python program need to call several such shell script files. I don't know whether there would be any problem by so frequently calling. (I even don't know which kind of problem, just worry.) Any experience?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.