Tag: scripting

TLDR  :)= You can find full project on github – https://github.com/jaronphillips/MotivationalTexter

This has been a fun project. It could easily be turned into some kind of fun prank.   What started out as a joke from my sister-in-law has turned into something quite fun for me.  My wife and her sister asked me to help with some fitness goals.  Normally I would pay no attention to such a request, but this one gave me a fun idea. I wanted to randomly text them throughout the day to remind them to focus on fitness. I also wanted to automate it. I figured it would be a good python project.

First I needed to figure out if this was  possible.   I googled something like  “python text message.”  There is plenty of stuff that popped up, but most of it was for Twilio, and you had to purchase a phone number. Well, I was not that invested in this project. I did not want to pay for a new phone number…  especially when google offers free ones with google voice.   I googled something like “python google voice sms” and found this wonderful blog by Motion Design https://motiondesigntechnology.wordpress.com/2014/01/24/mass-texting-sms-messaging-via-google-voice-and-python/

Now we are off to the races! The googlevoice function made this pretty easy. You can send a text from python with just a few lines of code:

from googlevoice import Voice
gv=Voice()
gv.login()
gv.send_sms("7204369797","Hey there tubby")

Now we read from a list of phone numbers and we can send everyone on that list a text:

ListOfNumbers="PhoneNumbers.txt"
PhoneList=open(ListOfNumbers, "r")
PhoneNumbers=PhoneList.read().splitlines()
for PhoneNumber in PhoneNumbers:
     gv.send_sms("7204369797","Hey there tubby")

(more…)

Read more

I just made a Secret Santa Picker with Python! Isn’t that a fun thing to say…
I am still trying to become a more useful human, I keep hearing everywhere that people need to know how to code. I am attempting to learn Python by doing useful things. I cannot learn by just reading a book and absorbing information, I have to have a goal to accomplish. I need a project to pursue.
Today one of my family members mentioned our annual Secret Santa game. We usually pick out of a hat, but now we are spread out all over the country so picking out of a hat is not going to be easy. I figured this would be a good challenge to put my python skills to the test. My new project was to make a Secret Santa picker. I knew I was going to use Python’s random library.  After playing with random.shuffle, I tried random.sample. This seemed to work much better for what I wanted to do.

If you don’t wanna read this whole thing you can just jump straight to the code and start using it – – https://github.com/germfil/SecretSanta

(more…)

Read more

You can start and stop windows services from command line using sc start or sc stop. You can even uninstall them with sc delete.

sc start myservice

sc stop myservice

sc delete myservice

You need to use the Service Name, not the display name

If you go to command line in windows, you can type sc to get a list of all available commands.

Read more