repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
arkangel-dev/blender-universal-file-import | ImportAllFiles.py | <gh_stars>0
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
bl_info = {
"name": "Import All File Types",
"author": "Sambo",
"version": (0, 0, 1),
"blender": (3, 0, 1),
"location": "File > Import > Import File",
"description": "Import files into the scene based on the file format... |
Duologic/ansible-role-uwsgi | molecule/default/tests/test_installation.py | """
Role tests
"""
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host):
"""
Check if packages are installed
"""
packages = []
if host.system_info.... |
V3LKR0W/CScouter | CScouter.py | import requests, time, os
from colorit import *
from dotenv import load_dotenv, dotenv_values
init_colorit()
load_dotenv()
Config = dotenv_values('.env')
Players = []
kills = []
deaths = []
wins = []
surrenders = []
w = []
s = []
cs = []
a = []
try:
Req = requests.get('https://127.0.0.1:2999/liveclientdata/al... |
bhamlin/tripping-octo-nemesis | make-pyimg.py | #!/usr/bin/env python
import argparse
import os
import zipfile
parser = argparse.ArgumentParser()
parser.add_argument('output', help='Name of executable to create')
parser.add_argument('source', help='Path to find sources')
args = parser.parse_args()
IMG = os.path.abspath(args.output)
with open(IMG, ... |
bhamlin/tripping-octo-nemesis | src/__main__.py | <reponame>bhamlin/tripping-octo-nemesis
#!/usr/bin/env python
import argparse
import sys
LIST_MODULES = 'list-modules'
AP = argparse.ArgumentParser('ffxi-tools',
description='Tools for modifying the Darkstar database')
AP.add_argument('-c', '--config', default='/etc/darkstar/', dest='config',
... |
bhamlin/tripping-octo-nemesis | src/modules/set_position.py |
MODULE_NAME = 'set-position'
MODULE_DESC = 'Move a character to its homepoint, or to another set location'
MODULE_VER = '1.0'
def START(db, *args):
"""Remove Darkstar account sessions"""
class Position(object):
def __init__(self, rot, x, y, z, zone):
self.rot = rot
... |
bhamlin/tripping-octo-nemesis | src/db/__init__.py |
import MySQLdb as __M
__CONFIG = dict()
def load_config(path):
import os
conf_dir = os.path.abspath(os.path.expanduser(path))
for filename in os.listdir(conf_dir):
conf_file, _ = filename.split('.')
CURRENT = dict()
with open(os.path.join(conf_dir, filename), ... |
bhamlin/tripping-octo-nemesis | src/modules/list_accounts.py |
MODULE_NAME = 'list-accounts'
MODULE_DESC = 'List accounts on server'
MODULE_VER = '1.0'
def START(db, *args):
"""List FFXI accounts in the database"""
import argparse
AP = argparse.ArgumentParser('ffxi-tools ' + MODULE_NAME,
description='Lists accounts')
args = AP.pa... |
bhamlin/tripping-octo-nemesis | src/modules/close_session.py |
MODULE_NAME = 'close-session'
MODULE_DESC = "Remove an account's session"
MODULE_VER = '1.0'
def START(db, *args):
"""Remove Darkstar account sessions"""
import argparse
AP = argparse.ArgumentParser('ffxi-tools ' + MODULE_NAME,
description='Removes a session')
AP.add_argume... |
bhamlin/tripping-octo-nemesis | src/modules/__init__.py | <gh_stars>0
import pkgutil as __p
import sys as __s
__self = __s.modules['modules'] # Find self; very zen
__available = dict()
def _get_all_modules():
"""Return all modules found"""
return __available
def get_module(name):
"""Return the named module"""
return __available[name]
def ... |
bhamlin/tripping-octo-nemesis | src/modules/list_modules_desc.py | <filename>src/modules/list_modules_desc.py
MODULE_NAME = 'list-modules'
MODULE_DESC = 'List available modules'
MODULE_VER = '1.0'
def START(db, *args):
"""List modules found by python"""
import argparse
AP = argparse.ArgumentParser('ffxi-tools ' + MODULE_NAME,
description='List avai... |
bhamlin/tripping-octo-nemesis | src/modules/list_sessions.py | <filename>src/modules/list_sessions.py
MODULE_NAME = 'list-sessions'
MODULE_DESC = 'List sessions active in the database'
MODULE_VER = '1.0'
def START(db, *args):
"""Remove Darkstar account sessions"""
import argparse
AP = argparse.ArgumentParser('ffxi-tools ' + MODULE_NAME,
des... |
Ygshvr/marketplace-k8s-app-tools | marketplace/deployer_util/validate_app_resource.py | #!/usr/bin/env python3
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
Ygshvr/marketplace-k8s-app-tools | marketplace/deployer_util/config_helper.py | #!/usr/bin/env python2
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
Ygshvr/marketplace-k8s-app-tools | marketplace/deployer_util/validate_app_resource_test.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
jlandowner/kustomize-ingress | base/krmfunc/ingress_patch.py | #!/usr/bin/env python3
from functools import reduce
import os
import sys
import yaml
import logging
def main(args=sys.argv[1:]):
resource_list = yaml.load(sys.stdin, Loader=yaml.FullLoader)
target_name = dict_get(resource_list, 'functionConfig.metadata.name')
annotations = dict_get(resource_list, 'functionConf... |
jerrykan/roundup | roundup/cgi/wsgi_handler.py | # WSGI interface for Roundup Issue Tracker
#
# This module is free software, you may redistribute it
# and/or modify under the same terms as Python.
#
import os
import weakref
from contextlib import contextmanager
from roundup.anypy.html import html_escape
import roundup.instance
from roundup.cgi import Translation... |
jerrykan/roundup | test/test_config.py | #
# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
# This module is free software, and you may redistribute it and/or modify
# under the same terms as Python, so long as this copyright message and
# disclaimer are retained in their original form.
#
# IN NO EVENT SHALL BIZAR SOFTWARE PTY LT... |
jerrykan/roundup | test/rest_common.py | import pytest
import unittest
import os
import shutil
import errno
import cgi
from time import sleep
from datetime import datetime, timedelta
try:
from datetime import timezone
myutc = timezone.utc
except ImportError:
# python 2
from datetime import tzinfo
ZERO = timedelta(0)
class UTC(tzinfo)... |
jerrykan/roundup | test/test_templating.py | from __future__ import print_function
import unittest
from cgi import FieldStorage, MiniFieldStorage
from roundup.cgi.templating import *
from .test_actions import MockNull, true
import pytest
from .pytest_patcher import mark_class
if ReStructuredText:
skip_rst = lambda func, *args, **kwargs: func
else:
ski... |
jerrykan/roundup | website/issues/detectors/rsswriter.py | #!/usr/bin/python
#
# RSS writer Roundup reactor
# <NAME> <<EMAIL>>
#
import os
import logging
logger = logging.getLogger('detector')
import sys
# How many <item>s to have in the feed, at most.
MAX_ITEMS = 30
#
# Module metadata
#
__author__ = "<NAME> <<EMAIL>>"
__copyright__ = "Copyright 2003 <NAME>"
__versi... |
xoolive/edu_constraints | notebooks/solutions/lazy_nqueens.py | import facile
def lazy_n_queens(n: int, *args, **kwargs) -> facile.Solution:
queens = [facile.variable(range(n)) for i in range(n)]
diag1 = [queens[i] + i for i in range(n)]
diag2 = [queens[i] - i for i in range(n)]
# facile.constraint(facile.alldifferent(queens))
for i, q1 in enumerate(queens):
... |
xoolive/edu_constraints | problems/picross/picross/__init__.py | from .loader import picross # noqa: F401
|
xoolive/edu_constraints | problems/airlines/airlines/tiny.py | Nv = 2
Na = 2
Ni = 2
Va = [0, 1, 2]
Ov = [0, 1, 2]
Dv = [0, 2, 1]
Td = [0, 8, 12]
Ta = [0, 9, 13]
Dt = [[0, 0, 0], [0, 2, 25], [0, 25, 2]]
Dtinf = 25
Np = [0, 80, 80]
Nec = [0, 2, 2]
Pr = [0, 100, 100]
Ne = 5
Ty = [1, 1, 0, 0, 0]
Vh = [1, 1, 1, 1, 2]
Nvmax = 2
Dmax = 7
Dda = 2
|
xoolive/edu_constraints | problems/tatami/tatami_solve.py | <gh_stars>1-10
from __future__ import annotations
import click
import facile
import matplotlib.pyplot as plt
def tatami_solve(xmax: int, ymax: int) -> list[facile.Solution]:
"""Solves the tatami problem.
The variables in the solve_all must be passed in order:
- x coordinates;
- y coordinates;
- ... |
xoolive/edu_constraints | notebooks/solutions/send_more_money.py | import facile
import functools
# The list comprehension mechanism is always helpful!
[s, e, n, d, m, o, r, y] = [facile.variable(range(10)) for i in range(8)]
# A shortcut
letters = [s, e, n, d, m, o, r, y]
# Constraints
facile.constraint(s > 0)
facile.constraint(m > 0)
facile.constraint(facile.alldifferent(letters)... |
xoolive/edu_constraints | notebooks/solutions/send_more_money_wrong.py | <reponame>xoolive/edu_constraints<filename>notebooks/solutions/send_more_money_wrong.py
import facile
# The list comprehension mechanism is always helpful!
[s, e, n, d, m, o, r, y] = [facile.variable(range(10)) for i in range(8)]
# A shortcut
letters = [s, e, n, d, m, o, r, y]
# Retenues
[c0, c1, c2] = [facile.varia... |
xoolive/edu_constraints | problems/airlines/airlines/__init__.py | <gh_stars>1-10
from . import tiny as tiny_instance
from . import small as small_instance
from . import normal as normal_instance
__all__ = ["tiny", "small", "normal"]
instances = {
"tiny": tiny_instance,
"small": small_instance,
"normal": normal_instance,
}
def get_instance(name: str):
module = inst... |
xoolive/edu_constraints | problems/picross/picross_solve.py | from __future__ import annotations
import signal
import sys
import click
import facile
from picross import picross
def picross_solve(
lines: list[list[int]],
columns: list[list[int]],
) -> tuple[facile.Solution, facile.Array]:
n, m = len(lines), len(columns)
grid = facile.Array.binary((n, m))
... |
xoolive/edu_constraints | problems/picross/picross/loader.py | <filename>problems/picross/picross/loader.py<gh_stars>1-10
from __future__ import annotations
from collections import UserDict
from pathlib import Path
__all__ = ["picross"]
class PicrossLoader(UserDict):
def __getitem__(self, name: str) -> tuple[list[list[int]], list[list[int]]]:
problem = UserDict.__ge... |
yossiz16/microcOSM | images/tegola/start.py | #!/usr/bin/env python3
import time
from datetime import datetime
import signal
import os
import glob
import sys
from jsonlogger.logger import JSONLogger
from osmeterium.run_command import run_command, run_command_async
EXPIRE_TILES_DIR = os.environ.get('EXPIRE_TILES_DIR', '/mnt/expiretiles')
CONFIG_PATH = '/opt/tegola... |
yossiz16/microcOSM | images/mod-tile/start.py | <reponame>yossiz16/microcOSM
import psycopg2
import re
import subprocess
import sys
import time
from os import path, linesep, environ, mkdir
from jsonlogger.logger import JSONLogger
from osmeterium.run_command import run_command_async, run_command
SEQUENCE_PATH_DENOMINATORS = [1000000, 1000, 1]
CARTO_FILE = '/src/open... |
yossiz16/microcOSM | images/imposm/start.py | <filename>images/imposm/start.py<gh_stars>0
#!/usr/bin/env python3
import os
import re
import time
import json
import subprocess
import sys
from datetime import datetime
import psycopg2
import requests
from jsonlogger.logger import JSONLogger
from osmeterium.run_command import run_command
state_file = 'state.txt'
pbf... |
yossiz16/microcOSM | images/osm2pgsql/start.py | #!/usr/bin/env python3
import os
import subprocess
import sys
import psycopg2
import re
import time
import requests
from jsonlogger.logger import JSONLogger
# postgres variables
PGHOST = os.environ['POSTGRES_HOST']
PGPORT = os.environ['POSTGRES_PORT']
PGUSER = os.environ['POSTGRES_USER']
PGDATABASE = os.environ['POSTG... |
yossiz16/microcOSM | images/earth-tiles-loader/start.py | <gh_stars>0
#!/usr/bin/env python3
import os
import signal
import sys
from datetime import datetime
from croniter import croniter
import pause
from jsonlogger.logger import JSONLogger
from osmeterium.run_command import run_command
pg_user = os.environ['POSTGRES_USER']
pg_password = os.environ['POSTGRES_PASSWORD']
pg_h... |
yossiz16/microcOSM | images/earth-tiles-loader/utils/ne-zip-files-extractor.py | # this script creates the correct yaml for the external data file sources part
# it needs a flat directory structure in the zip like in natural earth
import zipfile
import requests
import yaml
import io
import zipfile
urls = ('https://naciscdn.org/naturalearth/110m/cultural/ne_110m_populated_places.zip',
'htt... |
jonahmakowski/PyWrskp | src/other/animal_guesser.py | import os
import json
try:
pyWrkspLoc = os.environ["PYWRKSP"]
except KeyError:
pyWrkspLoc = os.environ["HOME"] + input('Since you do not have the PYWRSKP env var '
'\nPlease enter the pwd for the pyWrskp repo not including the '
... |
jonahmakowski/PyWrskp | src/other/txt_editor.py | <reponame>jonahmakowski/PyWrskp<gh_stars>0
class TxtReader:
def __init__(self):
self.file_loc = input('Enter the path for this .txt file\nOr enter create for a new file')
if self.file_loc == 'create':
self.file_loc = input('What is the path for the new file you want to make')
... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/class_2wrk.py | import pygame
DIS_WIDTH = 1280
DIS_HEIGHT = 820
pygame.init()
screen = pygame.display.set_mode([DIS_WIDTH, DIS_HEIGHT])
pygame.display.set_caption("Paint")
buttonMinus = pygame.image.load('button_minus.png')
buttonPlus = pygame.image.load('button_plus.png')
keep_going = True
mouse_down = False
BLACK = (0, 0, 0)
RED ... |
jonahmakowski/PyWrskp | src/other/shopping_list.py | <gh_stars>0
import json
import os
try:
pyWrkspLoc = os.environ["PYWRKSP"]
except KeyError:
pyWrkspLoc = os.environ["HOME"] + input('Since you do not have the PYWRSKP env var '
'\nPlease enter the pwd for the pyWrskp repo not including the '
... |
jonahmakowski/PyWrskp | src/super_safe_note_sender/sender.py | import sys
import json
import random
import os
sys.path.append('../coder-decoder')
from coder import CoderDecoder as Coder
'''
Need to pass a message to your friends?
Don't want anyone else to see it?
Use this program!
This program when you run the "create" option, will create a message.txt file, if your friend has ... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/mm2.py | import pygame
print('Based on Class_one1.py by Jonas, Apr 4, 2021; modified by <NAME>.')
# define colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
PURPLE = (251, 0, 255)
YELLOW = (255, 247, 0)
TEAL = (0, 255, 255)
ORANGE = (255, 196, 0)
LIME = (132, 255, 0)
bo... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/bday1.py | # compute number of months and days from today to my next bday
import datetime
from dateutil import relativedelta
bday = datetime.date(2010, 5, 29)
today = datetime.date.today()
age = today - bday
cur_yr = today.year
next_bday = bday.replace(year=cur_yr)
if next_bday < today: # already passed this year, consider... |
jonahmakowski/PyWrskp | src/other/team_maker.py | """
I know I have an older team maker, but I thought I would use what I have learned so far to make a brand new one!
Here it is:
"""
import os
from random import randint
import json
try:
pyWrkspLoc = os.environ["PYWRKSP"]
except KeyError:
pyWrkspLoc = os.environ["HOME"] + input('Since you do not have the PY... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/classes/testing.py | import requests
street = "1600+Pennsylvania+Avenue+NW"
city = "Washington"
state = "DC"
zipcode = "20500"
geocode = requests.get("https://geocoding.geo.census.gov/geocoder/locations/address?street={}&city={}&state={}&zip={}&benchmark=4&format=json".format(street, city, state, zipcode))
#print(geocode.text)
coor... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/what_is_your_name.py | import sys
import os
try:
pyWrkspLoc = os.environ["PYWRKSP"]
except KeyError:
pyWrkspLoc = os.environ["HOME"] + input('Since you do not have the PYWRSKP env var '
'\nPlease enter the pwd for the pyWrskp repo not including the '
... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/smartness_test.py | a = []
print('WELCOME TO MY SMARTNESS TEST')
def q(qu, ae):
qe = input(qu + '\n')
if qe == ae:
return True
if qe != ae:
return False
c = '' # question
d = '' # question (3 * 3)
def q_idea():
from random import randint as r
num = r(2, 3)
nums = []
if num == 2:
... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/classes/class_7.py | import requests
import matplotlib.pyplot as plt
import dateutil.parser
class Weather:
def __init__(self, street, city, state, zipcode, loc_name, hour):
self.street = street
self.city = city
self.state = state
self.zipcode = zipcode
self.loc_name = loc_name
# print(se... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/search.py | import tkinter as tk
class search(tk.Frame):
def __init__(self, items, master=None):
super().__init__(master)
self.master = master
self.items = items
self.pack()
self.cteate()
def create(self):
self.entry1 = tk.Entry(self.master, justify='right')
self,entr... |
jonahmakowski/PyWrskp | src/alarm/time_only.py | <reponame>jonahmakowski/PyWrskp
import datetime
def work(hour, mint, print_info=True):
hour = int(hour)
mint = int(mint)
now = datetime.datetime.now()
past_time = datetime.datetime(now.year, now.month, now.day, hour, mint)
past_time = past_time.strftime("%X")
while True:
now = datetim... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/class_2mm.py | <reponame>jonahmakowski/PyWrskp
# import datetime
# print(datetime.date.today())
import pygame
# definitions of the available colors
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
PURPLE = (255, 0, 234)
GREY = (131, 131, 131)
ORANGE = (255, 174, 0)
# definitions of available buttons
butto... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/class_4.py | import tkinter as tk
from tkinter.filedialog import askopenfilename, asksaveasfilename
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.createWidgets()
def createWidgets(self):
self.txtEdit = tk.... |
jonahmakowski/PyWrskp | src/custom_slack_bot/bot.py | import slack
import os
from pathlib import Path
from dotenv import load_dotenv
env_path = Path('.') / '.env'
load_dotenv(dotenv_path=env_path)
client = slack.WebClient(token=os.environ['SLACK_TOKEN'])
user = input('What is your name?')
print('What would you like to send?')
mess = ''
while True:
message = input()... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/classes/class_3_example_classes.py | <filename>src/other/Other_from_2020-2021/classes/class_3_example_classes.py
class Student:
role = "learn"
def __init__(self, name, grade):
self.name = name
self.grade = grade
class Teacher:
role = "teach"
def __init__(self, name, subject):
self.name = name
self.subject = ... |
jonahmakowski/PyWrskp | src/notes/notes.py | <gh_stars>0
import json
class Notes:
def __init__(self, name='data3.jonahtext'):
self.notes = []
self.name = name
def add_note(self, note):
self.notes.append(note)
def print_notes(self):
try:
with open(self.name) as json_file:
self.notes += jso... |
jonahmakowski/PyWrskp | src/classroom_tools/classroom_tools_extras.py | from random import randint as r
import time
def math_game(coins):
opration = r(1, 4)
num_1 = r(0, 9999999)
num_2 = r(0, 9999999)
if opration == 1:
opration = '+'
question = '{} {} {}'.format(num_1, opration, num_2)
a = str(num_1 + num_2)
elif opration == 2:
opration... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/fun_math_game.py | <filename>src/other/Other_from_2020-2021/home/fun_math_game.py
num = 1
money = 0
streak = 0
add = 1
while True:
q = (str(num) + ' + ' + str(num))
question = input('What is ' + q + '?\n')
an = str(num + num)
if question == an:
print('good job\nyou earned $' + str(num))
money += num
... |
jonahmakowski/PyWrskp | src/catalog/fuction.py | <gh_stars>0
import webbrowser
def online_search():
author = input('What is the author of the book?')
author = list(author)
for i in range(len(author)):
if author[i] == ' ':
author[i] = '+'
author2 = ''
for char in author:
author2 += char
title = input('What is the ti... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/turtle_hi.py | <filename>src/other/Other_from_2020-2021/home/turtle_hi.py<gh_stars>0
import turtle
t = turtle.Turtle()
t.penup
t.goto(140, 10)
t.pendown()
def hi():
t.left(90)
t.forward(100)
t.backward(50)
t.right(90)
t.forward(50)
t.left(90)
t.forward(50)
t.backward(100)
t.right(90)
t.penup... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/shape maker.py | import turtle
t = turtle.Turtle()
t.right(90)
t.penup()
t.forward(100)
t.left(90)
t.pendown()
t.speed(1)
sides = int(input('How many sides would you like?\n'))
length_sides = int(input('How long would you like the sides to be?\n'))
for i in range(sides):
t.left(360 / sides)
t.forward(length_sides)
|
jonahmakowski/PyWrskp | src/sudoku/Player.py | <reponame>jonahmakowski/PyWrskp
# Player found from https://www.geeksforgeeks.org/building-and-visualizing-sudoku-game-using-pygame/
# import pygame library
import pygame
# initialise the pygame font
pygame.font.init()
# Total window
screen = pygame.display.set_mode((500, 600))
# Title and Icon
pygame.display.set_ca... |
jonahmakowski/PyWrskp | src/other/is_it_the_word.py | class IsItAWord:
def __init__(self, word):
self.word = word
self.word_list = list(word)
self.rever = ''
self.reverse()
def reverse(self):
for i in range(len(self.word_list) - 1, -1, -1):
self.rever += self.word_list[i]
# print(self.rever)
... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/class_onea.py | <gh_stars>0
import pygame
print('version 0')
pygame.init()
screen = pygame.display.set_mode([1375,750])
pygame.display.set_caption("Paint (press space bar to erase all)")
keep_going = True
mouse_down = False
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
PURPLE = (... |
jonahmakowski/PyWrskp | src/JupyterLab/Helper_files/game_code.py | <filename>src/JupyterLab/Helper_files/game_code.py
import time
import random
def monster_fight(monster_name, monster_health, monster_damage_range, player_username, player_health, player_items):
print('A {} is fighting you, {}!'.format(monster_name, player_username))
print('It has {} health!'.format(monster_he... |
jonahmakowski/PyWrskp | src/coder-decoder/coder.py | <reponame>jonahmakowski/PyWrskp
class CoderDecoder:
def __init__(self, print_info=True):
self.abcs = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', ... |
jonahmakowski/PyWrskp | src/other/counter.py | <gh_stars>0
count_type = input('What count type would you like to use?\n')
if count_type == 'with spaces':
string = input('Paste what you want to count\n')
string = list(string)
print('Here is the length of your text:')
print(len(string))
else:
print('you have choosen not including spaces')
str... |
jonahmakowski/PyWrskp | src/sudoku/creator.py | '''
THIS DOES NOT WORK
'''
from solve_mm1 import Board
def sudoku(size):
import time
start_time=time.time()
import sys
import random as rn
mydict = {}
n = 0
# print ('--started calculating--')
while len(mydict) < 9:
n += 1
x = range(1, size+1)
testlist = rn.sam... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/preschool_drawing.py | from random import randint as random
import turtle
from time import sleep
screen = turtle.Screen()
DIS_WIDTH = 1280
DIS_HEIGHT = 750
x_max = DIS_WIDTH
y_max = DIS_HEIGHT
screen.setup(DIS_WIDTH, DIS_HEIGHT)
turtles = {}
colors = ['black','blue','yellow','green','purple','orange','gold']
for i in range(len(colors)):
... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/teams_with_captions.py | _4_5 = {'teacher':'Mr.Payne', 'students':['Ayaan', 'Nathaniel', 'Ethan', 'Kennedy', 'Shay', 'Dimitriana','Laith','Tamanna', 'Anna', 'Kaitlyn', 'Nathan', 'Jonah', 'Raleigh', 'Arijon', 'Jairus', 'Lauren', 'Abhijay', 'Liam', 'Lydia', 'Arionna', 'Calvin', 'Maxwell', 'Nyla']}
from random import randint
team_1 = []
team_2 ... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/google_photos_icon.py | import turtle
from time import sleep
t = turtle.Turtle()
colors = ['yellow', 'green', 'blue', 'red']
curve = 3
t.speed(0)
color = 0
heading = 90
for i in range(len(colors)):
t.setheading(heading)
t.fillcolor(colors[color])
t.begin_fill()
t.goto(0, 0)
t.color(colors[i])
for c in range(50):
... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/classes/class_8.py | import requests
from bs4 import BeautifulSoup
url = "https://www.tiobe.com/tiobe-index/"
r = requests.get(url)
soup = BeautifulSoup(r.content, features="lxml")
heading = soup.find(id="top20")
langs = heading.findAll('td')
topLangs = {}
for n in range(0, len(langs), 6):
topLangs.update({
langs[n].string: {
... |
jonahmakowski/PyWrskp | src/other/funnything.py | import turtle
import time
t = turtle.Turtle()
i = 1
while True:
t.write(i)
i += 1
time.sleep(0.1)
t.clear()
|
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/login.py | import tkinter as tk
from time import sleep
from random import randint
import os
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.active = False
self.pas = '<PASSWORD>'
self.create_widgets()... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/noah_and_me_turtle.py | <filename>src/other/Other_from_2020-2021/home/noah_and_me_turtle.py
import turtle
import extra_turtle_stuff
def run():
t = turtle.Turtle()
t.speed(0)
sides = 6
length_sides = 50
t.fillcolor('green')
t.begin_fill()
extra_turtle_stuff.draw_hex(sides, length_sides, t)
t.left(120)
ext... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/classes/class_4_pt_1.py | <gh_stars>0
import tkinter as tk
from tkinter.filedialog import askopenfilename, asksaveasfilename
class Application(tk.Frame):
def __init__(self, name, save_loc, master=None):
super().__init__(master)
self.master = master
self.pack()
self.createwidgets()
self.fp = save_loc... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/classes/class_6.py | <reponame>jonahmakowski/PyWrskp<gh_stars>0
import requests
# get the weather of the white house
street = '1600+Pennsylvania+Avenue+NW'
city = 'Washington'
state = 'DC'
zipcode = "20500"
geocode = requests.get("https://geocoding.geo.census.gov/geocoder/locations/address?street={}&city={}&state={}&zip={}&benchmark=4&form... |
jonahmakowski/PyWrskp | src/other/package_testing.py | import pyWrskp
t = pyWrskp.RandomNumber(10, 25) |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/j_game1.py | <reponame>jonahmakowski/PyWrskp
import pygame
keep_going = True
mouse_down = False
RED = (225, 0, 0)
radius = int(input('What would you like your pen size to be for this project?\n'))
current_color = (0,0,0)
pygame.init()
screen = pygame.display.set_mode([1290, 650])
pygame.display.set_caption('Click and drag to dra... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/bday1jm1.py | <gh_stars>0
import time
from datetime import date
import turtle
today = date.today()
today == date.fromtimestamp(time.time())
month = int(input('what is the month of your birthday?\nJanuary is 1, February is 2, March is 3, April is 4, May is 5, June is 6, July is 7, August is 8, September is 9, October is 10, November ... |
jonahmakowski/PyWrskp | src/math-game/game.py | import game_extras
from random import randint as r
class Game:
def __init__(self):
while True:
try:
self.max = int(input('What would you like the max of the nums\n'))
break
except:
print('ERROR: this is not a number, try again')
... |
jonahmakowski/PyWrskp | src/coder-decoder/coder_run.py | <filename>src/coder-decoder/coder_run.py
from coder import CoderDecoder
code = CoderDecoder()
message = input('What is your message?\n')
while True:
key = int(input('what is the key? (from 1 to {})\n'.format(len(code.abcs))))
if key >= 1 and key < len(code.abcs):
break
else:
print('inccorr... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/users.py | <reponame>jonahmakowski/PyWrskp<gh_stars>0
from datetime import date
class Human:
def __init__(self, fname, lname, age, tec_age=False, _ = None):
self.shut_off = False
self.pin = 1982
self.today = date.today()
if tec_age == True:
if _ == '+':
tec_age = age... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/date_time_testing.py | import datetime
from dateutil import relativedelta
bday = datetime.date(2010, int(input('What month were you born in (numbers please)\n')), int(input('What day of the month were you born in (numbers please)\n')))
today = datetime.date.today()
age = today - bday
cur_yr = today.year
next_bday = bday.replace(year=cur_yr)... |
jonahmakowski/PyWrskp | src/other/human_classes.py | <filename>src/other/human_classes.py
from datetime import datetime
from random import randint
class Human:
def __init__(self, gender, first_name, last_name, birth_year):
self.gender = gender
self.first_name = first_name
self.last_name = last_name
self.birth_year = birth_year
... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/print_all_combos.py | def printCombination(arr, n, r):
data = [0]*r;
combinationUtil(arr, data, 0,
n - 1, 0, r);
def combinationUtil(arr, data, start,
end, index, r):
# Current combination is ready
# to be printed, print it
if (index == r):
for j i... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/examples_to_show_to_jacob.py | <reponame>jonahmakowski/PyWrskp
import json # this is a library
# This char "#" makes the rest of the line a comment and the computer ignores it
"""This is a other way to right comments
as this can be many lines"""
print() # prints the item in the bracket
var1 = input('? str') # takes input from the question put... |
jonahmakowski/PyWrskp | src/password_maker/Creater.py | from random import randint
import os
if __name__ == '__main__':
try:
pyWrkspLoc = os.environ["PYWRKSP"]
except KeyError:
pyWrkspLoc = os.environ["HOME"] + input('Since you do not have the PYWRSKP env var '
'\nPlease enter the pwd for the pyWrskp r... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/class_2a.py | import pygame
DIS_WIDTH = 1280
DIS_HEIGHT = 820
pygame.init()
screen = pygame.display.set_mode([DIS_WIDTH, DIS_HEIGHT])
pygame.display.set_caption("Paint")
keep_going = True
mouse_down = False
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
GREY = (131, 131, 131)
currentColour = RED
radius ... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/testing.py | <gh_stars>0
import os
shutdown = input("Do you wish to shutdown your computer ? (yes / no): ")
if shutdown == 'no':
exit()
else:
os.system("shutdown")
|
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/mm1.py | <reponame>jonahmakowski/PyWrskp
# don't use file-name: turtle.py
import turtle
from random import randint
import time
t = turtle.Turtle()
t.penup()
t.goto (-140,140)
t.speed(0)
t.pendown()
screen = turtle.Screen() # screen.setup(500,500)
# draw race-lines
for i in range (8):
t.forward(318)
t.backward(318)
t.right... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/bday2.py | # compute number of months and days from today to my next bday
# import sys needed if sys.exit() used
import datetime
from dateutil import relativedelta
# handle and process the bday data
class NextBday:
def __init__(self, b_month, b_day, b_yr=0, cheat_today=False):
self.use_dateutl = True # set to Fa... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/classes/class_6_homework.py | <gh_stars>0
import requests
# get the weather of the white house
street = '1600+Pennsylvania+Avenue+NW'
city = 'Washington'
state = 'DC'
zipcode = "20500"
geocode = requests.get("https://geocoding.geo.census.gov/geocoder/locations/address?street={}&city={}&state={}&zip={}&benchmark=4&format=json".format(street, city, s... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/exec_coding.py | <gh_stars>0
def run_code(code):
exec(code)
code = ''
print('what is your code (enter = new line):')
while True:
cod = input()
if cod == '':
break
code += cod + '\n'
run_code(code) |
jonahmakowski/PyWrskp | src/other/turtle_stuff.py | import turtle
import time
import random
class Turtle:
def __init__(self):
self.t = turtle.Turtle()
self.t.speed(0)
self.border = 500
def grid(self):
self.t.pd()
def draw(t, length):
t.pd()
t.forward(length)
t.left(90)
t.p... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/classes/class_4_pt_2.py | <filename>src/other/Other_from_2020-2021/classes/class_4_pt_2.py
import class_4_pt_1
import tkinter as tk
df_save_loc = '/home/jonah/Thonny files/TXT_files/' # change to folder name where you want auto saves as def
df_name = 'testing' # you can change def save name
root = tk.Tk()
root.title('Text Editer')
root.rowcon... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/class2020/class_one1.py | import pygame
print('version 1')
pygame.init()
screen = pygame.display.set_mode([1375, 750])
pygame.display.set_caption(
"Click the color-square to change the current color; the space-bar changes the background color")
keep_going = True
mouse_down = False
# defines colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 25... |
jonahmakowski/PyWrskp | src/logs/logs.py | <gh_stars>0
import os
import json
import datetime
class Log:
def __init__(self, save_loc=None):
self.log = []
save_loc = os.getcwd() + '/save_loc.txt'
self.save_locs = self.load(save_loc)
self.loc = os.environ["HOME"]
new_or_old = input('Do you need a new txt file?')
... |
jonahmakowski/PyWrskp | src/other/Other_from_2020-2021/home/math game.py | <reponame>jonahmakowski/PyWrskp
money = 0
streak = 0
number_correct = 0
correct = 0
#import os
while True:
try:
ma = int(input('what would you like the largest number possible to be?\n'))
except:
pass
if ma < 10:
print('The largest possible number must be 10 or greater')
els... |
jonahmakowski/PyWrskp | src/alarm/alarm-time&date.py | <reponame>jonahmakowski/PyWrskp
import datetime
hour = int(input('What is the hour number? - form 1 to 24'))
mint = int(input('What is the min number? - from 0 to 59'))
day = int(input('What is the day? - from 1 to 31'))
month = int(input('What is the mounth? - from 1 to 12'))
year = int(input('What is the year?'))
n... |
jonahmakowski/PyWrskp | src/other/info_saver.py | <reponame>jonahmakowski/PyWrskp
import json
class InfoSaver:
def __init__(self):
self.loc = '../../docs/txt-files/info_saver.txt'
self.save_info = self.load(self.loc)
self.mainloop()
def mainloop(self):
user_type = input('are you a new or old user? (n/o)')
if user_type... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.