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
###Tkinter Scrolling with Text### | |
'''Make text scroll to the bottom of the text box as new entries appear''' | |
from tkinter import * | |
from tkinter.scrolledtext import * | |
window = Tk() |
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
###Removing Unwanted Whitespace In A String### | |
Comment_1 = " How are you? " | |
Comment_2 = " How are you? " | |
def remove_whitespace_either_side(comment): | |
comment = comment.strip() | |
print(comment) | |
def remove_any_duplicated_white_space(comment): | |
comment = " ".join(comment.split()) | |
print (comment) |
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
###Using a variable in a function from outside the function### | |
###Returning a value from a function to be used outside the function.### | |
# Returns a string in lowercase | |
def Make_Lowercase(cmt): | |
cmt = cmt.lower() | |
return cmt | |
comment = "My name is SCOTT." | |
print ("Commment without lowercase formatting:") |
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
###Changing the colour of selected text in Tkinter Text wiget### | |
from tkinter import * | |
from tkinter import ttk | |
root = Tk( ) | |
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
#! Python 3.4 | |
""" | |
Open a file dialog window in tkinter using the filedialog method. | |
Tkinter has a prebuilt dialog window to access files. | |
This example is designed to show how you might use a file dialog askopenfilename | |
and use it in a program. | |
""" |
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
#! Python 3 | |
''' | |
Aim: To ping every fifth time in a count while | |
printing out the count 1 to 20 | |
''' | |
count = 1 | |
for i in range(0,4): | |
print ("ping") |
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
#! Python 3.4 | |
### using the "with" statment to open a file### | |
"""Two ways to open a file""" | |
""" The old way """ | |
file = open('example.txt', 'r') | |
read_file = file.read() |
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
''' | |
Finding an Item Between Two Characters In a String Using: | |
partition and rpartition | |
This could be handy for file creation and checking. | |
''' | |
file = 'batman(0).jpg' | |
file.partition('(')[-1].rpartition(')')[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
// Link to the tutorial: https://yagisanatode.com/2021/05/16/how-to-find-and-replace-text-in-a-google-doc-with-a-link-or-a-list-of-links-with-google-apps-script/ | |
/** | |
* Find an replace text with a single link where there is no | |
* other text in the paragraph. | |
*/ | |
function singleLink() { | |
// ## Inputs ## | |
let text = "My URL"; | |
let url = "https://yagisanatode.com/"; |
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
/* Check out the link for the full tutorial and video guide | |
* {@link https://yagisanatode.com/2021/07/03/get-a-unique-list-of-objects-in-an-array-of-object-in-javascript/ |Get a Unique List of Objects in an Array of Object in JavaScript} | |
*/ | |
const myObjArray = [ | |
{ | |
name: "Eva Devore", | |
character: "Evandra", | |
episodes: 15, | |
}, | |
{ |
OlderNewer