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
# Reponse to gist here: https://gist.github.com/Vanyali/b72e9083175794aecc9c718ee40c4205 | |
from itertools import cycle | |
WIN_CONDITIONS = [ | |
(1, 2, 3), | |
(4, 5, 6), | |
(7, 8, 9), | |
(1, 4, 7), |
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
>>> from collections import defaultdict | |
>>> data = """Lions 3, Snakes 3 | |
... Tarantulas 1, FC Awesome 0 | |
... Lions 1, FC Awesome 1 | |
... Tarantulas 3, Snakes 1 | |
... Lions 4, Grouches 0""" | |
>>> data_list = data.splitlines() |
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
from pathlib import Path | |
import sys | |
import easygui | |
def main(): | |
choices = easygui.multenterbox( | |
msg="This tool replaces part of the file name for all files and folders in the current folder.", | |
title="Renamer", | |
fields=["Old text", "New text"], | |
values=["(e.g., Aug)", "(e.g., Sep)"], |
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
# coding: utf-8 | |
""" | |
A module to generate ############### forms given | |
a template and a spreadsheet. | |
This script: | |
1. Connects to a spreadsheet | |
2. Populates a dictionary with information from the spreadsheet/the entity | |
3. Populates template files with the information above |
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 pyxel | |
pyxel.init(128, 128) | |
resources = pyxel.load("sample.pyxel") | |
data = {} | |
data["x"] = 0 | |
data["y"] = 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
class Weapon: | |
def __init__(self, types): | |
self.types = types | |
def damageDealt(self): | |
if self.types == "dagger": | |
damage = 4 | |
elif self.types == "axe": | |
damage = 6 | |
elif self.types == "staff": |
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/python3 | |
from PyQt5.QtWidgets import (QHBoxLayout, QVBoxLayout, | |
QComboBox, QCheckBox, QLabel, | |
QPushButton, QTextEdit, QScrollArea,) | |
from ..math import charactergen | |
class Tab: |
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/python3 | |
import sys | |
from PyQt5.QtWidgets import (QApplication, QWidget, QMainWindow, | |
QVBoxLayout, QTabWidget) | |
from .gui import npc, places, items, quest, monsterbuilder | |
class App(QMainWindow): | |
def __init__(self): |
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
data = {'Account balances': [{'2008-04-04': 252216}, | |
{'2010-05-17': 3619948}, | |
{'2010-10-25': 590954}, | |
{'2014-10-01': 568340}, | |
{'2016-09-04': 2424784}, | |
{'2018-08-25': 261463}], | |
'Address book contacts': [{'2017-12-05': 20580060}], | |
'Age groups': [{'2014-02-17': 37784}, {'2017-12-31': 84011}], | |
'Ages': [{'2014-09-01': 1287073}], | |
'Apps installed on devices': [{'2017-12-05': 20580060}], |
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
SIZES = {"s": "Small", "m": "Medium", "l": "Large"} | |
PRICES = {"s": 1.5, "m": 1.75, "l": 2.0} | |
SWEETENED = {"s": "Sweetened", "u": "Unsweetened"} | |
class Beverage: | |
name = "Beverage" | |
def __init__(self, size, price): | |
self.size = size | |
self.price = price |
OlderNewer