print("Hello, World!") import another_file print(another_file.hello) import sys print("Stderr output", file=sys.stderr) name = input() print("Hello,", name) import random print("Random number: ", random.randint(1, 10)) import numpy array = numpy.array([1, 2, 3]) print("Numpy:", numpy.sin(array)) #import turtle #t = turtle.Turtle() #t.forward(100) #from p5 import * #def setup(): # createCanvas(400, 200) #def draw(): # color = frameCount % 255 # background(color, color, 255 - color) #run() import pygal bar_chart = pygal.Bar() bar_chart.add("Fibonacci", [1, 1, 2, 3, 5]) bar_chart.render() import sqlite3 conn = sqlite3.connect("sports_club.sqlite") rows = conn.execute("select FirstName from Member").fetchall() print(rows) from complex import Complex print("Complex:", Complex(2, 3) + Complex(4, 5)) from sense_hat import SenseHat sense = SenseHat() #sense._motion.wait_for_motion() #sense._motion.wait_for_no_motion() print() print("motion_detected:", sense._motion.motion_detected) sense._motion.when_motion = lambda *args: None sense._motion.when_no_motion = lambda *args: None print("getIMUData:", sense._imu.getIMUData()) print("_getFusionPose:", sense._imu._getFusionPose()) print("pressureRead:", sense._pressure.pressureRead()) print("humidityRead:", sense._humidity.humidityRead()) device = sense._get_fb_device() device.setpixels(range(64), [[1, 1, 1]] * 64) device.setpixel(3, [5, 6, 7]) print("getpixel:", device.getpixel(3)) print("getpixels:", device.getpixels()) print("colour_raw:", sense._colour.colour_raw) print("get_compass:", sense.get_compass()) device.ioctl(SenseHat.SENSE_HAT_FB_FBIORESET_GAMMA, 1) buffer = [0] * 32 device.ioctl(SenseHat.SENSE_HAT_FB_FBIOGET_GAMMA, buffer) print("GAMMA:", buffer) device.ioctl(SenseHat.SENSE_HAT_FB_FBIOSET_GAMMA, [1] * 32)
Run
Stop
Loading pyodide...