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
#!/bin/sh python3.6 | |
import shelve | |
import pyperclip #pip install pyperclip | |
import sys | |
mcbShelf = shelve.open('mcb') # creating the shelve | |
if len(sys.argv) ==3 and sys.argv[1].lower() == 'save': | |
#saving the clipboard with the keyword given as a command line argument |
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
#! python3 | |
from email_validator import validate_email, EmailNotValidError | |
import base64,ast,os,sys,random,string | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives import hashes | |
from cryptography.fernet import Fernet as ft | |
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC | |
from pathlib import Path |
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
>>> whoamai.setdefault('favorite word','fuck trump') | |
>>> whoami.setdefault('favorite word','fuck trump') | |
'fuck trump' | |
>>> whoami.setdefault('favorite word','fuck who') | |
'fuck trump' |
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
>>> whoami = {'name':'putin', 'age':'google it', 'job':'president'} | |
>>> 'age' in whoami.keys() | |
True | |
>>> president in whoami.values() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
NameError: name 'president' is not defined | |
>>> 'president' in whoami.values() | |
True | |
>>> |
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
>>> whoami = {'name':'putin', 'age':'google it', 'job':'president'} | |
>>> 'age' in whoami.keys() | |
True | |
>>> president in whoami.values() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
NameError: name 'president' is not defined | |
>>> 'president' in whoami.values() | |
True | |
>>> |
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
>>> whoami = {'name':'putin', 'age':'google it', 'job':'president'} | |
>>> for i, j in whoami.items(): | |
... print(i,j, sep=' : ') | |
... | |
name : putin | |
age : google it | |
job : president |
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
>>> spam = {'color': 'red', 'age': 42} | |
>>> for v in spam.values(): | |
print(v) | |
red | |
42 | |
>>> for k in spam.keys(): | |
print(k) | |
color | |
age |
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
>>> myCat = {'size': 'fat', 'color': 'gray', 'disposition': 'loud'} | |
>>> myCat['size'] | |
'fat' | |
>>> 'My cat has ' + myCat['color'] + ' fur.' | |
'My cat has gray fur.' |
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
>>> spam = ['cat', 'bat', 'rat', 'cat', 'hat', 'cat'] | |
>>> spam.remove('cat') | |
>>> spam | |
['bat', 'rat', 'cat', 'hat', 'cat'] |
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
>>> spam = ['cat', 'dog', 'bat'] | |
>>> spam.append('moose') | |
>>> spam | |
['cat', 'dog', 'bat', 'moose'] | |
>>> spam = ['cat', 'dog', 'bat'] | |
>>> spam.insert(1, 'chicken') | |
>>> spam | |
['cat', 'chicken', 'dog', 'bat'] |
NewerOlder