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 game import gamehandle | |
def givexp(ammount): | |
gamehandle.load_variables() | |
gamehandle.give_xp(ammount) |
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 game import gamehandle | |
from file2 import givexp | |
def main(): | |
print('1) give xp') | |
print('2) give 500 xp') | |
donow = input() | |
if donow == '1': | |
givexp(200) #this is in File2.py | |
if donow == '2': | |
gamehandle.give_xp(500) |
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
# -*- mode: python -*- | |
block_cipher = None | |
# > pyinstaller.exe --onefile filetegrity.py | |
a = Analysis(['filetegrity.py'], | |
pathex=['C:\\Users\\anthvo\\Desktop'], | |
binaries=None, | |
datas=None, |
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 urllib3 import HTTPConnectionPool | |
pool = HTTPConnectionPool('www.google.se', maxsize=1) | |
ret = pool.request('GET', '/') | |
print(ret.status) | |
ret_two = pool.request('GET', '/search', fields={'q' : 'python'}) | |
print(ret_two) |
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 time import time | |
from random import random | |
# Without checking the dictionary | |
x = {} | |
s = time() | |
for i in range(10000000): | |
x[round(random(), 6)] = True | |
e = time() | |
print(e-s, len(x), 'Using dict() for inserts') |
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
#Definerer databasene og | |
database = {'Andreas' : 'Password1', | |
'Andy' : 'Password2'} | |
#Definerer funksjonene | |
def godkjent(): | |
print ('Halla ' +bruker) | |
def ikkegodkjent(): | |
print ('Beklager ' +bruker+ ', du har ikke tilgang her') |
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 threading import * | |
from time import sleep | |
import uuid | |
class worker(Thread): | |
def __init__(self): | |
Thread.__init__(self) | |
self.start() | |
def run(self): |
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 time import time | |
theList = [1, 2, True, False, False] | |
for y in range(3): | |
start = time() | |
for i in range(1000000): | |
result = [x for x in theList if type(x) is bool] | |
end = time() |
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 pyglet, math | |
from pyglet.gl import * | |
key = pyglet.window.key | |
from pyglet import app | |
from pyglet.libs.win32 import _user32 | |
from pyglet.libs.win32.constants import * | |
from pyglet.libs.win32.winkey import * | |
from pyglet.libs.win32.types import * |
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 pyglet | |
from pyglet.gl import * | |
# REQUIRES: AVBin | |
pyglet.options['audio'] = ('alsa', 'openal', 'silent') | |
key = pyglet.window.key | |
# xfce4-notifyd | |
class main(pyglet.window.Window): | |
def __init__ (self): |