Last active
August 1, 2023 00:35
-
-
Save catboy1357/39047a8ce5cd6e60ccbb9d3cad082f06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires the python-osc library. If you need to install the modual use: | |
# "pip install python-osc" | |
from pythonosc.udp_client import SimpleUDPClient | |
from datetime import datetime as d | |
from time import sleep | |
# sets up an osc sender | |
client = SimpleUDPClient("127.0.0.1", 9000) | |
# main | |
while True: | |
# Gets the time | |
time = d.now() | |
# Sends hour min sec | |
client.send_message(f'/avatar/parameters/sec', time.second) | |
client.send_message(f'/avatar/parameters/min', time.minute) | |
client.send_message(f'/avatar/parameters/hour', time.hour % 12) | |
print(f'\r{time.hour % 12}:{time.minute}:{time.second}', end='') | |
# update rate | |
sleep(1) |
Thank you for the simplification; I was not aware of this shortcut.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shortcut: