February 2022
Intermediate to advanced
182 pages
4h 25m
English
Now that all the back-end messaging infrastructure is configured, we’re ready to write the Python script that will receive and process the WAKE_PC message from the body of the Pushbullet message. As with all projects, create an empty Git repository to store and version control your project code:
$ git init --bare ~/repository/voicewol.git
$ cd ~/projects/
$ git clone ~/repository/voicewol.git
$ cd voicewol
Using your preferred code editor, create a new Python script called wakeup.py. Use the os.system() function to programmatically execute the wakeonlan xx:xx:xx:xx:xx:xx command that you successfully tested earlier:
| | import os |
| | |
| | MAC = 'YOUR_COMPUTER_MAC_ADDRESS_GOES_HERE' |
| | |
| | os.system('wakeonlan ' + MAC) ... |
Read now
Unlock full access