Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # Filename: ipp1_0_silly_name_generator.py
- # Version: 1.0.0
- # Author: Jeoi Reqi
- """
- Description:
- - This script demonstrates "Chapter 1: Project #1 - Silly Name Generator" from the book "Impractical Python Projects" by Lee Vaughan.
- - The script generates humorous pseudonyms by combining random first names with random last names.
- - It utilizes the random module to select names from predefined lists.
- Requirements:
- - Python 3.x
- Functions:
- - generate_funny_name():
- - Description:
- -Generates a humorous pseudonym by combining a random first name and a random last name.
- - Returns:
- - str: A randomly generated pseudonym.
- Usage:
- - Ensure you have Python 3.x installed on your system.
- - Save the script to a file, for example, `funny_name_generator.py`.
- Running the Script:
- - Open a terminal or command prompt.
- - Navigate to the directory where the script is saved.
- - Run the script using the command: python funny_name_generator.py.
- Output:
- - Upon running the script, a humorous pseudonym will be generated and printed to the console.
- """
- import random
- import sys
- # Lists of first and last names
- first_names = ['Baby Oil', 'Bad News', 'Big Burps', "Bill 'Beenie-Weenie'", "Bob 'Stinkbug'", 'Bowel Noises', 'Boxelder', "Bud 'Lite'", 'Butterbean', 'Buttermilk', 'Buttocks', 'Chad', 'Chesterfield', 'Chewy', 'Chigger', "Cinnabuns", 'Cleet', 'Cornbread', 'Crab Meat', 'Crapps', 'Dark Skies', 'Dennis Clawhammer', 'Dicman', 'Elphonso', 'Fancypants', 'Figgs', 'Foncy', 'Gootsy', 'Greasy Jim', 'Huckleberry', 'Huggy', 'Ignatious', 'Jimbo', "Joe 'Pottin Soil'", 'Johnny', 'Lemongrass', 'Lil Debil', 'Longbranch', '"Lunch Money"', 'Mergatroid', '"Mr Peabody"', 'Oil-Can', 'Oinks', 'Old Scratch', 'Ovaltine', 'Pennywhistle', 'Pitchfork Ben', 'Potato Bug', 'Pushmeet', 'Rock Candy', 'Schlomo', 'Scratchensniff', 'Scut', "Sid 'The Squirts'", 'Skidmark', 'Slaps', 'Snakes', 'Snoobs', 'Snorki', 'Soupcan Sam', 'Spitzitout', 'Squids', 'Stinky', 'Storyboard', 'Sweet Tea', 'TeeTee', 'Wheezy Joe', "Winston 'Jazz Hands'", 'Worms']
- last_names = ['Appleyard', 'Bigmeat', 'Bloominshine', 'Boogerbottom', 'Breedslovetrout', 'Butterbaugh', 'Clovenhoof', 'Clutterbuck', 'Cocktoasten', 'Endicott', 'Fewhairs', 'Gooberdapple', 'Goodensmith', 'Goodpasture', 'Guster', 'Henderson', 'Hooperbag', 'Hoosenater', 'Hootkins', 'Jefferson', 'Jenkins', 'Jingley-Schmidt', 'Johnson', 'Kingfish', 'Listenbee', "M'Bembo", 'McFadden', 'Moonshine', 'Nettles', 'Noseworthy', 'Olivetti', 'Outerbridge', 'Overpeck', 'Overturf', 'Oxhandler', 'Pealike', 'Pennywhistle', 'Peterson', 'Pieplow', 'Pinkerton', 'Porkins', 'Putney', 'Quakenbush', 'Rainwater', 'Rosenthal', 'Rubbins', 'Sackrider', 'Snuggleshine', 'Splern', 'Stevens', 'Stroganoff', 'Sugar-Gold', 'Swackhamer', 'Tippins', 'Turnipseed', 'Vinaigrette', 'Walkingstick', 'Wallbanger', 'Weewax', 'Weiners', 'Whipkey', 'Wigglesworth', 'Wimplesnatch', 'Winterkorn', 'Woolysocks']
- def generate_funny_name():
- """
- Generates a humorous pseudonym by combining a random first name and a random last name.
- Returns:
- str: A randomly generated pseudonym.
- """
- first_name = random.choice(first_names)
- last_name = random.choice(last_names)
- return f"{first_name} {last_name}"
- if __name__ == "__main__":
- print("Welcome to the Funny Name Generator!\n")
- print("Generating a humorous pseudonym...\n")
- while True:
- funny_name = generate_funny_name()
- print(funny_name, file=sys.stderr)
- print("\n")
- try_again = input("Try again? (Press Enter else n to quit)\n")
- if try_again.lower() == "n":
- break
- input("\nPress Enter to exit.")
Add Comment
Please, Sign In to add comment