LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 09-24-2009, 10:15 AM   #1
Weining
LQ Newbie
 
Registered: Aug 2009
Posts: 5

Rep: Reputation: 0
Question 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.)

Thank you in advance, and best regards,
Weining
 
Old 09-24-2009, 01:34 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
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.
 
Old 09-25-2009, 06:12 AM   #3
Weining
LQ Newbie
 
Registered: Aug 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Hello slakmagik,

thanks for your reply and advice.

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?

Best regards,
Weining
 
Old 09-25-2009, 05:20 PM   #4
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Not with shell from python, but I wouldn't think there'd be a problem with calling other scripts.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Autorun Backup script before shutdown!!!!! jp286 Linux - Networking 1 11-25-2008 10:29 AM
Lost console login prompt--neither GUI or command line prompts display JMCraig Red Hat 7 11-14-2008 12:15 PM
nohup command in script doesn't return to system console prompt beammeup Linux - Software 4 02-05-2007 02:01 PM
any way I can autorun a script before when shutdown Niceman2005 Linux - General 4 03-03-2006 05:40 PM
change style of console? dominik81 Linux - Software 0 11-21-2003 04:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration