Python Forum
Feedback on my first Python module - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: Code sharing (https://python-forum.io/forum-5.html)
+--- Thread: Feedback on my first Python module (/thread-10985.html)

Pages: 1 2


RE: Feedback on my first Python module - CodeRaker - Jun-20-2018

(Jun-16-2018, 05:37 PM)snippsat Wrote: Some use of string formatting but could be more,not so nice + ' ' +.
f-string makes it a lot nicer,that will of course make it 3.6 only.
if that's no problem then use f-string.

Thanks for the perspective. Looks more neat. I agree. I like to keep the module python 2.7 friendly, since I'll be using it on systems where some may not have 3+ installed.

Thanks to everyone for their comments and ideas. <3 I have implemented almost all of them into the code. I have gone ahead and improved the module by categorizing functions into classes. I'ld appreciate a second look since much has changed. I have followed a guide to add a Linux server to an AD domain controller and used my module to realize that in a script.
If you'ld be so kind to look and let me know if the way the module and the script plays together looks fine or if I'm doing something super noobish.

I can tell that it does work on my Ubuntu test servers.

The module is here: https://github.com/CodeRaker/automation/blob/master/toolbox.py
The AD joiner script is here: https://github.com/CodeRaker/administration/blob/master/linux-ad-join.py

Thanks, I really appreciate all your inputs.


RE: Feedback on my first Python module - ichabod801 - Jun-21-2018

(Jun-20-2018, 08:55 PM)CodeRaker Wrote: I like to keep the module python 2.7 friendly, since I'll be using it on systems where some may not have 3+ installed.

You might look at the format method of strings. It's 2.7 friendly and in the direction of an f-string.