Programming is my favorite thing
Who has programmed before?
Computers do exactly what you tell them to do if you can program you can do almost anything
Syntax matters - computers are very particular about how they understand things
import turtle | |
def drawPolygon (the_turtle,num_side): | |
angle = 360 / num_side | |
for iter in range (num_side): | |
are_we_fizz = iter + 1 | |
print are_we_fizz | |
if are_we_fizz % 3 == 0 and are_we_fizz % 5 == 0: | |
the_turtle.color('blue') |
import turtle | |
def get_user_input(): | |
userInput = raw_input("How many sides does your shape have?") | |
try: | |
userInput = int(userInput) | |
except: | |
print "Hey that's not a number!" |
import turtle | |
def get_user_input(): | |
userInput = raw_input("What trick do you want to do?") | |
try: | |
userInput = str(userInput) | |
except: | |
print "That's not a trick!" |
import turtle | |
import random | |
def main(): | |
turtle1 = turtle.Turtle() | |
turtle2 = turtle.Turtle() | |
turtle3 = turtle.Turtle() | |
turtle4 = turtle.Turtle() | |
turtle1_distance = random.randrange(100) |
Django channels are official way for implementing async messaging in Django.
The primary caveat when working with GraphQL subscription is that we can't serialize message before broadcasting it to Group of subscribers. Each subscriber might use different GraphQL query so we don't know how to serialize instance in advance.
See related issue