I have intermediate knowledge of python and it is the language I most familiar with. I didn't major or minor in computer science but I have taken a handful of low level classes and have been familiar with various programming languages since. this means i have very little insight into how larger programs fit together, which is what I am seeking advice on. I am starting with two scripts and I feel like this could be as simple as having a main script.
So far I have two portions of a program. the first reads a list of dates with associated e-mail addresses and sends an e-mail reminder to the people listed next to the date. I plan to run this every Wednesday to remind two people to bring breakfast the upcoming friday.
The second portion of the code pulls in e-mails from the address I have setup and search the message for keywords. One of the keywords I want to look for is 'Schedule' so I can e-mail people the day they are scheduled to bring breakfast if they want to know. This is something I want running in the background. I figure checking every minute.
I want to build in a couple of different commands so to make it easy for people to find replacements if they aren't they won't make it that friday.
From this project I have a couple of questions. No need to go into detail, keeping it big picture and dropping some google search keywords is what I am looking for.
- What is the best way to keep a program running in the background looking for a trigger so I can respond to schedule emails?
- Should I be keeping an e-mail connection open constantly or is it best to run every 30 seconds or so?
- What is the best way to combine these two scripts (or any for that matter) into one package that runs each script on the trigger (one every wednesday, the other when I receive an email)
Is there any proof of concept of this? Anybody know the distance/power limitations of sending transactions over radio signal? I know there is chirp.io which could be sent over radio audio.
I suppose there could be a network of radio nodes with big antennas that relay with each other. So if you are away from internet connection you just broadcast it to a nearby radio node and it gets relayed to higher radio nodes and eventually the internet. I know there are plans for Bitcoin satellites as well, so perhaps that could play a role as well.
Or maybe there is no market need for such a radio network? Possibly the radio nodes could monetize by requiring a fee in the transaction and if the fee is not included they will not relay the transaction. Would be interested in people's thoughts on this.
r/Python, I have been self learning on python and have been interested in writing bots for Telegram and Whatsapp. I was able to write a couple of them for telegram but have been having a lot many issues with running even the simplest ones i found for whatsapp.
I have setup Yowsup and was able to register a mobile number with this api. But i am not able to proceed with even simplest bot for whatsapp. I have tried many of them from github but failed to do it. Could someone please provide a basic Whatsapp bot which would send the same message we sent it? I will start building on top of this. Thank you in advance.
I wrote a python script using requests that pulls the html text from https://www.reddit.com/r/wallpapers, parses it to find imgur links, chooses one, downloads it, and makes it my wallpaper. I ran it once to test, and it worked great. But then after running it a few minutes later, it gave me 429 too many requests. It only requests once, like this:
r = requests.get("https://www.reddit.com/r/wallpapers")
The 'retry in' header says '2', which I assume means 2 seconds. Anyone know why this is happening?
[link] [3 comments]
Pony ORM does this nicely, but I'm looking at all the alternatives. Here's a Pony ORM sample:
class Business(db.Entity): name = Required(str) latitude = Optional(float, py_check=lambda val: -90 <= val <= 90) longitude = Optional(float, py_check=lambda val: -180 <= val <= 180)