Python Libraries: The Hive.Engine Token Monitor
Don’t laugh, but it’s my intent on changing skill sets to Python Developer. Actually, do as throughout my life I have made a point of proving people wrong who underestimate me.
Coding has been a part of my life since 1982 when I taught myself BASIC on a 1k Sinclair ZX81. However, it’s never been my primary skill set, more a side trade, but one I have always enjoyed.
...'666 Python jobs, 8 SCCM, Appv, MSI jobs.., now can you see where I am coming from?'...
With the way the world is going and my niche in IT seriously drying up, it's time to change things. There are oodles of Python jobs out there and I need to snag an entry-level one and get my foot in the door.
I had a chat with the old leader of 'The Humble Guys' cracking group a few days ago, and of course, he's a developer now (as well as still being a skilled cracker when needed). Python is one of his many talents, and he got me using PyCharm some months ago.
Downloading and being able to use it is completely different and I was not aware of the inbuilt syntax checking. This doesn't bug-proof your code, but checks for conventions. I can compare this with ICE checking for MSI validations, and as such, am taking notice of only some of these 'errors' it displays.
He mentioned that it's good practice to eradicate the errors from your code as a potential interviewer may pick your work up from your GitHub repo and put it through PyCharms’ validation as a form of integrity checking.
…’ There are probably shops that would toss your code into PyCharm, and let it look for things’… - Fabulous Furlough (@fabulousfurlough)....
I find all this real-world knowledge invaluable as without it how do you crack the shell of another niche?
I find one space to be more visually pleasing, but PyCharm tells me off if there’s just one. Talk about a pedantic bastard!
Multiple imports on the same line are not allowed and yet multiple variable declarations are fine!
So I am rambling, but the whole point of this post is to share some more code and add it to my own GitHub repository which I have now created.
Token Monitor is quite a simple script that monitors the BuyBook of any Hive.Engine token and displays the price every 5 seconds (user-definable value).
I have been using it to monitor GLX as it's comparatively new and descending in value. Being a monitor that runs in the background is all very well, but I wanted some sounds to alert me of changes.
This routine takes care of the sound. It's quite simple to get some basic sounds from Python, though they did get @bingbabe asking me, 'what are those weird noises?'
The is written for Wintel so I can't be sure of its behaviour on other platforms, but I am guessing it will require minimal changes.
While eradicating all the 'errors' I had more issues with formatting the string than anything else, as only 71 characters are allowed on a single line. There are many solutions out there, but I found the multiple f' string method suited me the best.
As newer iterations of Python are released, there are a lot of depreciated code examples on Stack Overflow. I try to use code that works with v3.6 or later if possible.
Hive.Engine Token Monitor.py can be modified to monitor other tokens, simply change the token variable to whatever you need to monitor.
It could be made to monitor many tokens at once, with many screens. My script is something that can be edited, worked on, and improved.
The full code can be found on GitHub (below). I suspect anything new from now will be added to this public repository.
Learning how to use GitHub properly is something else I needed to learn such as pushing changes; talk about wading in the dark.
After speaking to @steddyman for over an hour yesterday, I have the basics of cloning, commits, push, creating branches, etc.., there's a lot you need to know before being labelled Python Developer.
Disclaimer: @slobberchops is a NOVICE Python coder, so don’t go too hard on him