Skip to content

Instantly share code, notes, and snippets.

View offby1's full-sized avatar

Eric Hanchrow offby1

View GitHub Profile
certifi==2023.7.22 ; python_version >= "3.11" and python_version < "3.13" \
--hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \
--hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9
charset-normalizer==3.2.0 ; python_version >= "3.11" and python_version < "3.13" \
--hash=sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96 \
--hash=sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c \
--hash=sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710 \
--hash=sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706 \
--hash=sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020 \
--hash=sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252 \
@offby1
offby1 / gist:4607f6af5d291de01b43d7de4394cfdc
Created August 6, 2023 15:30
Typical discord session, helping someone past the "I just installed my package with pip, but python doesn't see it" problem
[7:24 AM]Deleted User: I downloaded a plugin via pip but Python doesn't recognize it
— 01/24/2021 7:24 AM
[7:25 AM]offby1: you have two or more versions of python installed
[7:26 AM]offby1: you used one of them to install the package, and are now using the other to try to run it. This doesn't work.
[7:26 AM]offby1: figure out which version you're running now, and use that version to install the package again
[7:26 AM]Deleted User: I have Python 3.9
[7:26 AM]Deleted User: I just downloaded it because my C drive got wiped
[7:26 AM]offby1: I will bet you you also have some other version as well
[7:27 AM]offby1: what exactly did you type originally when you ran pip?
[7:27 AM]Deleted User: pip install pychroma
import hashlib
for n in range(0, 100):
hash_rep = hashlib.sha256()
hash_rep.update(str(n).encode ('utf-8'))
print(hash_rep.hexdigest())
import personalData
def main():
print('Let\'s create an Address Book: ')
book = []
while True:
entry = personalData.from_console()
print('You\'ve entered the following: ')
print (entry)
[{'approved_at_utc': None,
'author': 'Philosinerd',
'author_flair_css_class': None,
'author_flair_text': None,
'banned_at_utc': None,
'body': 'Unfortunately it depends on whether or not she appears on national '
'television.',
'can_mod_post': False,
'collapsed': False,
'collapsed_reason': None,
import requests
from pprint import pprint
postID = '7dn55x'
#c=requests.get('https://api.pushshift.io/reddit/search/comment/?ids=' + ','.join(requests.get('https://api.pushshift.io/reddit/submission/comment_ids/' + postID).json()['data'])).json()['data']
import ast
c = ast.literal_eval(open ('/tmp/data').read ())
class RedditComment ():
def __init__ (self, id_, parent_id, other_stuff):
self.id_ = id_
## With a function:
def translate():
input_ = get_input()
output = english_to_pig_latin(input_)
clear_screen()
print(output)
if __name__ == "__main__":
import random
def get_locations(cell):
return (random.sample(cell,x),
random.sample(cell,x),
random.sample(cell,x))
# or the way I'd really write it
def get_locations(cell):
time racket 14.ss
837799 generates a sequence of length 525
real 0m4.389s
user 0m4.141s
sys 0m0.229s
Model Name: MacBook Pro
Model Identifier: MacBookPro10,2
Processor Name: Intel Core i5
(defun copy-buffer-file-name ()
"Puts the file name of the current buffer (or the current directory,
if the buffer isn't visiting a file) onto the kill ring, so that
it can be retrieved with \\[yank], or by another program."
(interactive)
(let ((fn (or
(buffer-file-name (current-buffer))
;; Perhaps the buffer isn't visiting a file at all. In
;; that case, let's return the directory.
(expand-file-name default-directory))))