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
import os | |
import shutil | |
import hashlib | |
# Define variables | |
directory = raw_input( "Drag and drop the file or folder you want to back up." ) # Accepts input from user for source file path. | |
directory = directory.rstrip(" ") + "/" # Formats variable. | |
backup_path = raw_input( "Drag and drop the location to which you want to back up." ) # Accepts input from user for destination file path. | |
backup_path = backup_path.rstrip(" ") + "/" # Formats variable. | |
errnum = 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
# practicepython.org Ex 01 | |
name = raw_input( "Please enter your name: " ) | |
age = int(raw_input ( "Please enter your age: " )) | |
age = str( 100 - age ) | |
print ( "Hi, " + name + "! You will turn 100 years old in " + age + " years!" ) |
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
# practicepython.org Ex 02 | |
num = int(raw_input ( "Enter a number you would like divided: " )) | |
check = int(raw_input ( "Enter a number you want to divide by: ")) | |
rem = str( num % check ) | |
divby2 = num % 2 | |
if divby2 == 0: | |
print ( str(num) + " is EVEN." ) | |
else: | |
print ( str(num) + " is ODD." ) |
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
# practicepython.org Ex 03 | |
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | |
z = [] | |
for integer in a: | |
if (integer < 5): | |
z.append(integer) | |
print (z) |
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
# practicepython.org Ex 05 | |
import random as ra | |
def randrng(): | |
numlist = [] | |
rnglen = ra.randrange(10, 20) | |
while rnglen > 0: | |
numlist.append(ra.randrange(1, 100)) | |
rnglen -= 1 |
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
# practicepython.org Ex 06 | |
word_og = raw_input("Palindrome checker. Enter your palindrome: ") | |
word = word_og.replace(" ", "") | |
start = 0 | |
while (len(word) / 2) > start: | |
end = -(start + 1) | |
if word[start] == word[end]: |
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
# practicepython.org Ex 06 | |
import string | |
word = raw_input("Palindrome checker. Enter your palindrome: ") | |
#print word | |
word = word.replace(" ", "") # Removes spaces. | |
#print word |
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
# practicepython.org Ex 08 | |
import getpass as g | |
import string | |
def crush(word): # Removes all variables from input text for maximum ease of parsing. | |
word = word.replace(" ", "") # Removes spaces. | |
word = string.lower(word) # Changes all letters to lowercase. | |
for c in word: | |
if c in string.punctuation: |
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
import Tkinter as tk | |
import random | |
import string | |
root = tk.Tk() | |
frame = tk.Frame(root) | |
frame.pack() | |
# Data pile | |
about_txt = "This is where the about stuff goes..." |
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
import twitter | |
api = twitter.Api(consumer_key=[consumer key], | |
consumer_secret=[consumer secret], | |
access_token_key=[access token], | |
access_token_secret=[access token secret]) | |
status = api.PostUpdate('@madsc13ntist I\'m callin\' you out!') | |
print(status.text) |
OlderNewer