Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Demo of a bug in discord.py 0.10.0-alpha (tested with 53a240e) | |
# This program causes the following error to be printed when Python exits | |
# Unclosed client session | |
# client_session: <aiohttp.client.ClientSession object at 0x7f3bd7a83358> | |
import discord | |
c = discord.Client() | |
c.close() |
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
.bail on | |
begin transaction; | |
update globals set value=4 where name='dbSchemaVersion'; | |
-- remove lastGamesSince | |
delete from globals where name = 'lastGamesSince'; | |
-- add a processed column and fill it with a value |
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/env python3 | |
"A simple discord.py program to log in and receive and post messages" | |
# Configure these for a valid Discord account to log in as | |
email = FILL IN EMAIL | |
password = FILL IN PASSWORD | |
# Logging configuration. Go to DEBUG level if you want much more detail | |
import logging |
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
""" | |
Various options for a JSON type for Python. | |
My best effort at using these libraries naturally for reading and writing JSON. | |
https://nelsonslog.wordpress.com/2016/01/08/a-better-python-object-for-json/ | |
""" | |
import json, copy | |
import dotmap, attrdict, easydict, addict |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/env python2 | |
"""Demonstrate a bug in unicodecsv with non-ASCII headers | |
In version 0.11.0 this works fine. | |
In version 0.11.1 it throws an error when writing the header.""" | |
import unicodecsv | |
print "Unicode CSV version %s" % (unicodecsv.__version__) | |
fp = file("out.csv", "wb") |