This file contains hidden or 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
def MyFunction(iny): | |
print iny | |
MyVar = MyFunction | |
eval('MyVar("hi!")') |
This file contains hidden or 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
def MyFunc1(iny): | |
print iny | |
def MyFunc2(iny): | |
print iny*2 | |
def MyFunc3(iny): | |
print iny*3 | |
d = {"A":MyFunc1,"B":MyFunc2,"C":MyFunc3} |
This file contains hidden or 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 dictt | |
x = MyFunc1 | |
y = getattr(dictt,x) | |
y("HIIII!") |
This file contains hidden or 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 | |
def loadmodules(): | |
""" | |
Loads all Python scripts in a directory into the enviroment, and a dictionary for easy calling | |
""" | |
#Define our variables | |
home = os.getcwd() | |
filenames = [] | |
mody = {} |
This file contains hidden or 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
from multiprocessing import Process, Queue | |
import random | |
seed = "123456789" | |
#10,000,000 | |
county = 10000000 | |
count = county/8 | |
print count | |
def generate(seed2, count, filey): | |
f = open("./random-"+str(filey)+".txt", "w") |
This file contains hidden or 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
kant | |
7/29/11 4:46 PM | |
Hardware: | |
Hardware Overview: | |
Model Name: Mac Pro | |
Model Identifier: MacPro4,1 |
This file contains hidden or 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
def zero(m,n): | |
return [[0 for row in range(n)] for col in range(m)] | |
def mult(matrix1,matrix2): | |
if len(matrix1[0]) != len(matrix2): | |
print 'Cant do that on that shiznip!' | |
else: | |
new_matrix = zero(len(matrix1),len(matrix2[0])) | |
for i in range(len(matrix1)): | |
for j in range(len(matrix2[0])): |
This file contains hidden or 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
"""The install file for checkin. Rewritten 8/23/2011""" | |
import getpass | |
from MySQLdb import * | |
import MySQLdb | |
import sys | |
#Vars | |
dev_flag = 0 #1-on, 0-off | |
default_name = "Pycheckins" | |
c_db = "" |
This file contains hidden or 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
#FILE 1 | |
def funcy(a,b,c): | |
print (a,b,c) | |
#FILE 2 | |
import file1 | |
def funcx(*vars): | |
file1.funcy([i for i in vars]) |
This file contains hidden or 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
testlevel = { | |
1:"################", | |
2:"# # ####", | |
3:"# # ####", | |
4:"### ########", | |
5:"################" | |
} |