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
| """ | |
| Compare two files: | |
| First check number of lines then number of characters | |
| Then print the two line by line one on top of the other. | |
| """ | |
| from time import sleep | |
| from multiprocessing import Process | |
| fname0 = 'a.txt' | |
| fname1 = 'b.txt' | |
| def basecompare(fname0,fname1): |
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
| """ | |
| Counts / compares the number of lines in two files. | |
| Usage: | |
| python countlines.py a.txt b.txt | |
| OR | |
| import countlines | |
| fname0 = 'a.txt' | |
| fname1 = 'b.txt' |
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
| # https://github.com/amalzaga/python-opencv/blob/master/rgb-hsv.py | |
| # Creates a solid color image wich can be changed by using two sets | |
| # of trackbars RGB and HSV. Changing one affects the other | |
| # It is a practical way to better understanding of colorspaces. | |
| # | |
| # Written by Amador Alzaga | |
| import cv2 | |
| import numpy as np | |
| def nothing(x): |
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
| Line No. :1 | |
| ROWID :1 | |
| delimiters = ['\n', ' ', ',', '.', '?', '!', ':', 'and_what_else_you_need'] | |
| words = content | |
| for delimiter in delimiters: | |
| new_words = [] | |
| for word in words: | |
| new_words += word.split(delimiter) | |
| words = new_words |
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
| """ | |
| Comparing entries in Snippets.txt by hashing the snippets | |
| I made a duplicate to text it. | |
| Hash the snippets then check set() s of the HASH for duplicates. | |
| Just playing with Python Works great. Snippets.txt is in my gists | |
| it is loaded with snippets and script. | |
| """ | |
| import hashlib | |
| import string | |
| Hash = [] |
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
| # ODD number are Code | |
| # Even numbers were created just generate an index file | |
| import sqlite3 | |
| def ViewGist(): | |
| database ="GISTstore/gist.db" | |
| conn = sqlite3.connect(database) | |
| c = conn.cursor() | |
| rowid = raw_input("ROWID : ") | |
| rowid =str(rowid) | |
| for row in c.execute('SELECT rowid, content, description, filename FROM gist \ |
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
| """ | |
| A lot to look over here. | |
| This file sets in a directory contain | |
| ./cfdg_files ( your database and the binary cfdg file ALSO a list of CFDG files on your computer) | |
| ./cfdg_files/cfdgs/ ( here is where your *.cfdg files ate generated ) | |
| ./cfdg_files/images/ ( where you image files are generated ) | |
| Using the CFDG grammar/script inside the triple apostophies: | |
| It generates a file ( filename = "cfdg_files/cfdgs/learning005.cfgd" ) rename this to save new files. | |
| Then it saves the cfdg script in a SQLITE database. Then runs the the cfdg script saves and |
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
| """ | |
| This Hashes the list items and compares it to the a Hash of the proposed entry | |
| if entry exists it prints. list and "is already in" and the entry so you may see. | |
| if it enters it the new list is printed | |
| import NoListDups | |
| entrY = "XXiX" | |
| x = ['XXX', 'yyy', 'zzz'] | |
| NoListDups.NoDupList(x, entrY) | |
| print x |
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
| """ | |
| This script just creates a color wheel | |
| it was an answer to a quested created | |
| by J Richard Snape | |
| """ | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from matplotlib import cm | |
| import matplotlib as mpl | |
| fig = plt.figure() |
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
| # Creates a solid color image wich can be changed by using two sets | |
| # of trackbars RGB and HSV. Changing one affects the other | |
| # It is a practical way to better understanding of colorspaces. | |
| # | |
| # Written by Amador Alzaga | |
| #!/usr/bin/python | |
| import cv2 | |
| import numpy as np |