5 Lessons Learned from Creating The PyAlly

[ ryn0f1sh ]
ThePyNoob
Published in
5 min readNov 3, 2021
Photo by Scott Graham on Unsplash

Hello World.
This will most likely be the last post I do about The PyAlly. I had a couple of posts about it in the past. The initial post about the multi-tool, and an update post about some changes I made. Since that last one I’ve learned a few things, and made some decisions, so I wanted to share that with you in this “Lessons Learned” post.

// Lesson 1: Proper Testing.
As I’m learning this craft of programming, I do my best to of course test the tools that I’m creating as I go. I think creating the .EXE files, may have been a crutch for me (as well as a blessing).

A blessing, because I can just put that .EXE file on my flash drive, and just run my tool with a click on any Windows machine, which is super helpful.

A crutch, because I think it made me somewhat neglect the fact that some people might actually want to use these tools on Linux. That is why I always provide the .py files for these tools, but I found out that that alone is not enough.

// Lesson 2: .PY Files Alone, Are Not Enough.
I was under the impression that if I just give the source code, then anyone can simply fire it up on their favorite code editor, and run it. Well. It turned out that its NOT that easy.

I found out the hard way. I was on a different machine then the one I use to write my tools, and I needed to use the PDF Decrypter tool I wrote. So I went to my github page, and downloaded the PyAlly, opened up PyCharm, ran the main .py file, and all I got were errors.

That sent me down a rabbit hole of trying to figure out why is this not working. Turned out that in order for any of them to work, I needed to install (import) all the libraries needed, since the machine I was working on did not have any of them. Well, crap! that means that anyone who downloads this code, who does not have these libraries already pre-installed would have to do that first before getting anywhere.

Yes it may not seem major, since importing libraries is pretty simple with python. BUT the whole point of me doing this, is to try to make things easier, and faster, and this failed on both those accounts.

// Lesson 3: Requirments.txt.
Due to the realization from Lesson 2, I started searching for a solution. Then I came across “requirments.txt”. I’m going to be honest with you, I had seen this before, and in fact have used tools that required that I run “pip install -r requirments.txt”, but I honestly didn’t know a 100% why the program wouldn’t work without it. I am new to this after all.

Now I know. Apparently once I have my program working properly, there are a couple of ways that would allow me to create a “requirments.txt” which would basically be a list of dependences, and packages that my program uses to run. I would include that file with the source code, and ask the user to run the command mentioned above, and by doing it, it would install all that is needed for the program to run properly.

I have yet to try this, but once I do, I will make sure to write about it for sure in a future post.

// Lesson 4: I May Have Over Reached.
As I mentioned in the beginning of this post, that this will be my last PyAlly post. Creating this tool has both humbled me, and excited me. I do like the idea of the multi-tool, and I know that I will come back to it again. But I think I tried to cram too many things together, and due to that things got clunky, and started to break, so I’m going with a different approach.

I learn by doing, so being zealous and trying to create this huge multi-tool (huge is relative to the fact that I have not made such a thing before) did teach me a lot, and I believe that I’ve become a better programmer because of it.

// Lesson 5: Take What You’ve Learned & Start Over.
I know it may seem counter intuitive to some of you reading this when I say “Your better now, so start over”, but to me it makes a lot of sense.
Hear me out.

One of the pit-falls was how big the project was, and my approach to it. Even though the end result may not have worked properly outside of the environment, the tool it self did work when it was in the lab it was created it. Now that I know how to prep it properly so that it works outside of that environment, I have the opportunity to do things differently (and hopefully less messy).

The idea is, I will break down all the tools that are in PyAlly, and put them in 2 or 3 different groups. And then create smaller multi-tools for each of those groups. That way, all the relative tools are together, and user would not have to download ALL the tools, if what they need could be in either one of the groups.

The dream is, once I have these 2 or 3 multi-tools created, I would like to see if I can find a better way to bring the groups together into a tool box, where they are still separate groups, but you can have access to all of them, if you wish.

// First Things First.
Before I get a head of myself, again. My first focus will be on looking at all the tools that I created, create my groups, and then make the first group, create that requirments.txt file, and make sure that I have that process down of making the actual tools work outside of the environment (hopefully with an .EXE file as well), then create the remaining groups. Hopefully by then, I would have figured out how to make that Tool Box of multi-tools by then. Wish me luck.

I hope this post has given you some ideas.
This has been ryn0f1sh, The PyNoob.
[R/F] End Of Line.

--

--

[ ryn0f1sh ]
ThePyNoob

Sudanese / Blogger / Pen Tester / Python Charmer / Machine Learner / Lover Of Outer Space / Coffee Drinker (https://www.buymeacoffee.com/execodeable)