Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- import random
- from colorama import init
- from colorama import Fore, Back, Style
- from colors import red, green, blue, white, black, yellow
- init()
- db_list_file = open("db_list.pbd", 'r') #Open file
- db_list_read = db_list_file.read() #Read the file
- already_db = db_list_read
- def error_missing_arguments():
- print(red('ERROR: Missing arguments. Use command "help" for more info.',style="bold"))
- print("Psssssssssssss")
- while True:
- command_input = input(green(">PrBYDA: ",style="bold"))
- if command_input=="create":
- error_missing_arguments()
- elif command_input=="create db":
- db_name = input("Enter the database name: ")
- if already_db==db_name:
- print("ALREADY DB!!!!!")
- print(yellow("Already DBS: "+already_db))
- print(green("DB Name: "+db_name))
- if not ".db" in db_name:
- print(red('ERROR: The database name needs to have .db extension.',style="bold"))
- else:
- print("Creating database...")
- database_file_created = db_name #Get file name
- database = open(database_file_created, 'w')
- database.close()
- print("Database created.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement