Reddit Reddit reviews Python for Unix and Linux System Administration

We found 7 Reddit comments about Python for Unix and Linux System Administration. Here are the top ones, ranked by their Reddit score.

Computers & Technology
Books
Networking & Cloud Computing
Computer Networks, Protocols & APIs
Python for Unix and Linux System Administration
Used Book in Good Condition
Check price on Amazon

7 Reddit comments about Python for Unix and Linux System Administration:

u/goldfaber3012 · 13 pointsr/programming

Using the with statement is the recommended way to do this, which works like a try-except-finally statement (see the Note). The authors forgets to close() the file descriptors after opening them. See warpstalker's reply below, or the Input & Output section of the official tutorial.

The fileinput module also exists to help process different methods of input, avoiding the need to write cases for sys.stdin, sys.argv, or direct user input (although users would have to send ^D after typing their input).

I've also yet to encounter python programmers who do as he says, but I often encounter java -> python programmers who use nested for loops instead of list comprehensions or generators. Old habits die hard.

At the bottom of the article, the author states (his referral code removed):

> I have not read ""Python for Unix and Linux System Administration":http://www.amazon.com/dp/0596515820/" but the table of contents looks excellent.

Beware advice from those who recommend books they haven't read.

Instead of using the subprocess module directly, use Kenneth Reitz' Envoy: Subprocess for Humans wrapper, and possibly combine it with his Clint: Command Line Tools.

Anything I've said which contradicts official documentation should be disregarded.

u/[deleted] · 4 pointsr/Python

I just started looking at Python for Unix and Linux System Administration. It seems an interesting idea. The first chapter is all about using IPython as your shell, but then it goes into scripting.

u/PisteOff · 3 pointsr/PowerShell

What do the PowerShell scripts you want to rewrite in Python do? I find the idea of a "commandlet like Python script" misguided and confused. PowerShell is still very much an administrative tool geared toward Microsoft systems. At this point in time I wouldn't consider it a general purpose scripting language like Python. No one is writing webapps with a MVC framework, e.g. Django, with PowerShell. And I doubt anyone ever will, despite all appearances from MS that they're trying to turn it into a general purpose language with PS Core. If your scripts are doing a lot of administrative things with AD, etc. then you're likely not going to have much success porting them to Python. I would question your sanity if you really wanted to do that.

You also need to spend some time groking Linux and Unix to get the most out of Python. Remember that it's a product of that environment and very much follows those conventions. So if you're looking to parse arguments then you should look at argparse. You should also think about what the syntactic sugar of a switch statement is doing, and realize you can do the same thing with a hashtable/dictionary.

If you're just interested in doing administrative things with Python then take a look at this book: Python for Unix and Linux System Administration. But realize the Python ecosystem is about a billion and one times larger than PowerShell's and covers everything from web development to machine learning.

u/xadin · 2 pointsr/learnpython

The reviews of this book on the given link and Amazon are discouraging. Have you read this book yourself? If so how much previous Python knowledge did you have? Other languages? I'm pretty new to Python myself and have also been looking for something to help me use it in Linux administration. The Red Hat link from Agmenor is pretty good, and probably enough. Need to finish my beginner book first. http://www.amazon.com/Starting-Python-Edition-Gaddis-Series/dp/0132576376

http://www.amazon.com/Python-Unix-Linux-System-Administration/dp/0596515820

u/Kaizyn · 1 pointr/programming

Three books for you:

Python for Unix and Linux System Administration:
http://www.amazon.com/Python-Unix-Linux-System-Administration/dp/0596515820

Gray Hat Python: Python Programming for Hackers and Reverse Engineers:
http://www.amazon.com/Gray-Hat-Python-Programming-Engineers/dp/1593271921

Foundations of Python Network Programming:
http://www.amazon.com/Foundations-Python-Network-Programming-Goerzen/dp/1590593715

If you aren't going to go the Python route, then you should teach yourself Scheme.

u/ataraxia_ · 1 pointr/sysadmin

Just try googling python for linux sysadmins or something. There's presumably a bunch of resources.

What you're asking, however, is a strange question. You can't see how to apply programming to computers?

Here's a hint about what you can do with Python on linux: Everything.

This isn't me being disingenuous. Every task is essentially programmatically solvable, with enough effort.

Do you have any minor but repeatable issues with any of your systems, at all? Script it. Do you have any task that requires you to run several commands? Script it. Do you have any new-user setup tasks that require a bunch of changes? Script it.

Learn Python. Once you have learned Python, everything you see that you possibly think "this could be automated", automate it.

u/jabbalaci · 1 pointr/linux

I use it instead of the standard Python shell because of the following features: code completion with Tab and syntax highlighting. It has lots of other benefits but I don't use them yet. For debugging I started to use the ipdb module, which offers an IPython integration to pdb.
If you want to learn more about IPython, refer to the 2nd chapter of this book.