Skip to content

Instantly share code, notes, and snippets.

#: kivy 1.9.1
<Main>:
HUD:
size_hint: 1., 1.
pos: 0,0
<HUD>:
spacing: 10
Button:
#!/usr/bin/python3
import kivy
kivy.require("1.9.0")
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.image import Image
from kivy.graphics import Rectangle
from kivy.clock import Clock
from kivy.properties import ObjectProperty
<Main>
size: 400, 400
canvas:
Rectangle:
pos: self.pos1
size: 30, 30
<Main>
size: 400, 400
canvas:
Line:
points: root.line1
width: 1.0
Rectangle:
pos: self.pos1
size: 30, 30
import os
def set_dir(file_path):
here = os.path.dirname(file_path)
os.chdir(here)
if __name__ == "__main__":
set_dir(__file__)
import numpy as np
from PIL import Image, ImageDraw
from vec2d import vec2d
from random import randint as rai
class Poly(object):
"""This generates a polygon in a numpy Array"""
from kivy.config import Config
xwidth, xheight = 1024, 960
Config.set("graphics", "width", xwidth)
Config.set("graphics", "height", xheight)
Config.write()
from kivy.app import App
from kivy.core.window import Window
from bs4 import BeautifulSoup as bs
import requests
url = "en.wikipedia.org/wiki/List_of_X-Men_comics"
r = requests.get("http://" +url)
data = r.text
soup = bs(data)
text = soup.get_text()
#!/bin/bash
while [[ 1 -eq 1 ]]; do
for i in $(echo /usr/share/backgrounds/*.jpg); do
echo $i
gsettings set org.gnome.desktop.background picture-uri file:///${i}
sleep 60;
done
done
#!/bin/bash
uri=$1 #URI of RSS Feed
lines=$2 #Number of headlines
titlenum=$3 #Number of extra titles
#Script start
#Require a uri, as a minimum
if [[ "$uri" == "" ]]; then
echo "No URI specified, cannot continue!" >&2