Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "python3"
-
So in PEP 594 of Python, some standard library modules are getting deprecated. Sorry for anyone who still uses aifc or crypt.
-
Alright, I was a little bored...
Rewatching some old flicks and thought I write a little script.
Mind you, I had no idea how to do any of the following, but as it turns out it's quite simple.
I wanted to take an image. A background image. Automatically write some text to it. The text, I would take from the RSS feed of my favourite blogger. It's the three latest blog entries, or at least the first 50 characters of their titles.
Then set the newly created background image with text as my desktop background.
And finally do all of that every 5 minutes.
So, I looked up a library for the image manipulation. Looked up how to set a background image from python.
What would you wager was the hardest part of the exercise? If you said every step will take you like 5 minutes, except setting up Windows Scheduler, that shit will take you more than an hour, then you're dead on.
That thing seems so... useful, yet so hard to understand. I found a StackOverflow post in which people argued what the settings meant.
Maybe I am just no Windows person, but hey, that thing seems needlessly complicated.8 -
How do you guys monitor programs on your servers?
For example, I have a raspberry pi zero w running raspbian (headless). On this pi, I have a bunch of discord bots and web scrapers running at the same time. My solution was to run them all from a bash file:
Python3 discordbot1.py &
Python3 discordbot2.py &
Python3 webscraper1.py &
Node webscraper2.js & etc.
Is there a better way I could be running these services? How is stuff like this usually done?8 -
In python, is there a way to make this work?
----------
# list of people
people = ["Nick", "Sue", "Bob"]
# class instance
Bob.pockets = ["gum", "paperclip", "coins"]
# convert string to prefix of a class instance
Print(people[2].pockets())
----------
This is the simplest way to show what I'm needing to figure out.
I need to convert a string into the prefix of a class instance.
I'm having trouble figuring it out.7