+
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/


11 changes: 7 additions & 4 deletions arduino-laser/laser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
cleaning up
"""

import sys, serial, struct
import pyaudio
import numpy
import math
import struct
from time import sleep
import argparse

import numpy

import serial
import pyaudio


# manual test for sending motor speeds
def manualTest(ser):
print('staring manual test...')
Expand Down
8 changes: 4 additions & 4 deletions arduino-laser/test_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

"""

import math

import numpy as np
import sys

from matplotlib import pyplot
from time import sleep
import argparse
import pyaudio
import math


N = 4096

Expand Down
6 changes: 3 additions & 3 deletions ascii/ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
Author: Mahesh Venkitachalam
"""

import sys, random, argparse
import numpy as np
import math
import argparse

import numpy as np
from PIL import Image


# gray scale level values from:
# http://paulbourke.net/dataformats/asciiart/

Expand Down
5 changes: 4 additions & 1 deletion autos/autos.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
Author: Mahesh Venkitachalam
"""

import sys, random, argparse
import random
import argparse

from PIL import Image, ImageDraw


# create spacing/depth example
def createSpacingDepthExample():
tiles = [Image.open('test/a.png'), Image.open('test/b.png'),
Expand Down
12 changes: 8 additions & 4 deletions boids/boids.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
Author: Mahesh Venkitachalam
"""

import sys, argparse
import argparse
import math

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from scipy.spatial.distance import squareform, pdist, cdist
from numpy.linalg import norm

import matplotlib.pyplot as plt
import matplotlib.animation as animation

from scipy.spatial.distance import squareform
from scipy.spatial.distance import pdist

width, height = 640, 480

class Boids:
Expand Down
11 changes: 6 additions & 5 deletions common/glutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
Some OpenGL utilities.
"""

import OpenGL
from OpenGL.GL import *
from OpenGL.GL.shaders import *
import math

import numpy, math
import numpy
import numpy as np

from PIL import Image

from OpenGL.GL import *
from OpenGL.GL.shaders import *


def loadTexture(filename):
"""load OpenGL 2D texture from given image file"""
img = Image.open(filename)
Expand Down
7 changes: 5 additions & 2 deletions conway/conway.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
Author: Mahesh Venkitachalam
"""

import sys, argparse
import argparse

import numpy as np
import matplotlib.pyplot as plt

import matplotlib.pyplot as plt
import matplotlib.animation as animation


ON = 255
OFF = 0
vals = [ON, OFF]
Expand Down
14 changes: 10 additions & 4 deletions karplus/ks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
Author: Mahesh Venkitachalam
"""

import sys, os
import time, random
import wave, argparse, pygame
import numpy as np
import os
import time
import random
import wave
import argparse
from collections import deque

import numpy as np

import pygame
from matplotlib import pyplot as plt


# show plot of algorithm in action?
gShowPlot = False

Expand Down
5 changes: 4 additions & 1 deletion karplus/sine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
Author: Mahesh Venkitachalam
"""

import wave
import math

import numpy as np
import wave, math


sRate = 44100
nSamples = sRate * 5
Expand Down
6 changes: 3 additions & 3 deletions particle-system/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
Author: Mahesh Venkitachalam
"""

import sys, random, math
import OpenGL
from OpenGL.GL import *
import numpy

from OpenGL.GL import *
import glutils


strVS = """
#version 330 core

Expand Down
9 changes: 6 additions & 3 deletions particle-system/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
Description: A particle system class
"""

import sys, random, math
import OpenGL
from OpenGL.GL import *
import random
import math

import numpy

from OpenGL.GL import *
import glutils


strVS = """
#version 330 core

Expand Down
6 changes: 3 additions & 3 deletions particle-system/psmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
Description: A particle system
"""

import sys, os, math, numpy
import OpenGL
import os

from OpenGL.GL import *
import numpy
from ps import ParticleSystem, Camera
from box import Box
import glutils
import glfw


class PSMaker:
"""GLFW Rendering window class for Particle System"""
def __init__(self):
Expand Down
8 changes: 6 additions & 2 deletions photomosaic/photomosaic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
Author: Mahesh Venkitachalam
"""

import sys, os, random, argparse
from PIL import Image
import os
import random
import argparse
import imghdr

from PIL import Image
import numpy as np


def getAverageRGBOld(image):
"""
Given PIL Image, return average value of color as (r, g, b)
Expand Down
9 changes: 6 additions & 3 deletions piweather/piweather.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
Author: Mahesh Venkitachalam
"""

from bottle import route, run, request, response
import argparse

from bottle import route, run, request

from bottle import static_file
import random, argparse

import RPi.GPIO as GPIO
from time import sleep
import Adafruit_DHT


@route('/hello')
def hello():
return "Hello Bottle World!"
Expand Down
7 changes: 4 additions & 3 deletions playlist/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
Website: electronut.in
"""

import re, argparse
import sys
from matplotlib import pyplot
import argparse
import plistlib

import numpy as np

from matplotlib import pyplot


def findCommonTracks(fileNames):
"""
Expand Down
9 changes: 5 additions & 4 deletions simplegl/simpleglfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
Author: Mahesh Venkitachalam
"""

import OpenGL
from OpenGL.GL import *
import math
import os

import numpy, math, sys, os
import glutils
import numpy

from OpenGL.GL import *
import glutils
import glfw

strVS = """
Expand Down
9 changes: 5 additions & 4 deletions spirograph/spiro.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
Website: electronut.in
"""

import sys, random, argparse
import numpy as np
import argparse
import math
import turtle
import random
from PIL import Image
from datetime import datetime
from datetime import datetime
from fractions import gcd

from PIL import Image


# A class that draws a spirograph
class Spiro:
# constructor
Expand Down
5 changes: 4 additions & 1 deletion volrender/makedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
Author: Mahesh Venkitachalam
"""

import sys, os
import os

import numpy as np

import Image


def makeSphereCuboid():
"""create a volume with a sphere and a cuboid inside"""
Nx, Ny, Nz = 256, 256, 256
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载