Text Size
Text Size
Exit Full Screen
Python Mini
Show
Source Code
View Source Code in Full Screen
Open in New Tab
from processing import * import firebase import time import random db = firebase.loadFirebase('AIzaSyCZ3tPJmKLqaDLwcN7Z44fPVeYkYAOasKc', 'fir-test-efbf9', 'fir-test-efbf9') currTS = time.time() random.seed(currTS) r = random.randint(0, 100) g = random.randint(0, 100) b = random.randint(0, 100) name = raw_input("Your name") pid = str(random.random()) data = { "name": name, "pid": pid, "x": 1, "y": 1, "color": [r, g, b], "joints": time.time(), } db.push("pixelart/player/", data) def setup(): size(120, 30) background(0, 0, 0) def draw(): textSize(14) text("Send command", 10, 20) def mouseClicked(): command = raw_input("Command") if not command: return command = command.strip() if command == "done": return order = { "pid": pid, "command": command } print command db.push("pixelart/order/", order) run()
pixelart-client.py
( around 41 lines python code )
Published By:
Bo Tinker
Published on
2016-08-18T22:18:00Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here