Skip to content

Instantly share code, notes, and snippets.

View Yagisanatode's full-sized avatar

Yagisanatode Yagisanatode

View GitHub Profile
@Yagisanatode
Yagisanatode / ChangeTextColor.py
Created May 16, 2015 10:44
Changing The Colour Of Selected Text In Tkinter Text Wiget In Python
###Changing the colour of selected text in Tkinter Text wiget###
from tkinter import *
from tkinter import ttk
root = Tk( )
@Yagisanatode
Yagisanatode / ReturnFunction.py
Last active August 29, 2015 14:21
Returning A Value From A Function To Be Used Outside The Function
###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:")
@Yagisanatode
Yagisanatode / RemoveWhitespace.py
Last active August 29, 2015 14:21
Removing Unwanted Whitespace in a String
###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)
@Yagisanatode
Yagisanatode / TkinterScrollingWithText.py
Last active April 22, 2022 19:51
Scrolling with inserted text using ScrolledText "yview" in tkinter
###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()