This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mini-project # 7 - Spaceship | |
# | |
# 'Introduction to Interactive Programming in Python' Course | |
# RICE University - coursera.org | |
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner | |
import simplegui | |
import math | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fontconfig> | |
<match target="font"> | |
<edit name="rgba" mode="assign"> | |
<const>none</const> | |
</edit> | |
</match> | |
</fontconfig> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt5 import QtWidgets, QtGui, QtCore | |
def fetch_data(): | |
return [ | |
{ | |
'name': 'horizontal', | |
'image': { | |
'colour': (255, 0, 0), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/autodesk/maya/bin/mayapy | |
import sys | |
for each in ("PySide", "PySide2"): | |
try: | |
if each == "PySide2": | |
_temp = __import__(each, globals(), locals(), ['QtWidgets'], -1) | |
QtWidgets = _temp.QtWidgets | |
else: | |
_temp = __import__(each, globals(), locals(), ('QtGui'), -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def ikePoleVector(root, mid, end): | |
result = [] | |
for i in range(len(root)): | |
v1 = end[i] - root[i] | |
midV1 = v1 * 0.5 | |
v2 = end[i] - midV1 | |
v3 = mid[i] - v2 | |
vf = mid[i] + v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mini-project #8 - "RiceRocks" (Asteroids) | |
# | |
# 'Introduction to Interactive Programming in Python' Course | |
# RICE University - coursera.org | |
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner | |
import simplegui | |
import math | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from distutils import sysconfig | |
def std_modules(): | |
std_lib = sysconfig.get_python_lib(standard_lib=True) | |
for top, dirs, files in os.walk(std_lib): | |
for nm in files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import multiprocessing | |
from PyQt5 import QtWidgets | |
def calc(): | |
# random cpu bound computation | |
result = 0 | |
for i in range(10 ** 7): | |
result += i ** 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import imp | |
import sys | |
def main(filepath): | |
module = imp.load_source('foo', filepath) | |
entities = [repr(x) for x in dir(module) if not x.startswith('__')] | |
if entities: | |
text = ', '.join(entities) |
NewerOlder