Detect Linux Runlevel

Michael Torrie torriem at gmail.com
Mon Dec 5 20:25:58 EST 2016


On 12/05/2016 05:14 PM, Bernd Nawothnig wrote:
> On 2016-12-05, Wildman wrote:
>> And I am trying to write it without using external programs, where
>> possible.
> 
> That is not the Unix way.
> 
>> I am a hobby programmer and I've been trying to learn python
>> for a few months now.  The program is 'worthlessware' but it
>> is a 'learning experience' for me.  
> 
> It looks for me like a worthless learning experience.
> 
>> A friend wrote a similar program in Bash script and I have been
>> working on translating it to Python.
> 
> Stay with shell script for such tasks. It is never a good idea to
> choose the programming language before closer evaluating the problem.I

I think Python is a good choice for such a utility, but I agree it is
much better to rely on these external utilities as children to do the
platform-dependent work, rather than try to re-implement everything in
Python.  A long time ago I wrote a simple wrapper to Popen that would
run a command and return the standard out and standard error to me.



More information about the Python-list mailing list