Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to make a operating system in python

import time
import images
import random
import datetime
from datetime import date
# ! i = 1 doesn't work for some reason!
i = 1
# * This is an operating system with a few apps!
# TODO Make more apps
today = date.today()

print("
")
day = today.strftime("%B %d, %Y")
print("d2 =", day)
print(images.password)
password = input()


# ! Wrong password
if password != "3219":
    print(images.wrongpassword)
    ta = input()


    if ta == 'yes':
        second = input("enter your password ")
        if second != '3219':
            print("You locked the phone wait 20 seconds")
            while i <= 20:
                time.sleep(1)
                print(i)
                i = i + 1
            trird = input("Type your password ")
            if trird != "3219":
                print("Your phone is locked you dont have an other try!")
            else:
                print("Ok plese enter it the first time!")
        else:
                print("Right password plese enter it at the start")


#?Password right
if password == '3219':
    print(images.home)
    main = input()


    # * The proggram app
    if main == 'program':
        print(images.proggram)
        print('type here')
        print('type here')
        print('type here')

    
    # * The calculator app
    if main == 'calculator':
        print(images.calculator)
        num = input("Your number ")
        num2 = input("Your second number ")
        num3 = input("Your third number ")
        num4 = input('do you want "+ - * multiply or / for devide" ')
        if num4 == '+':
            print('the result of', num, '+', num2, '+', num3, 'is', int(num) + int(num2) + int(num3))
        if num4 == '-':
            print('The result is', int(num) - int(num2) - int(num3))
        if num4 == '*':
            print("the result is", int(num) * int(num2) * int(num3))
        if num4 == '/':
            print('the result is', int(num) / int(num2) / int(num3))
        else:
            print('Invalaid input')
    if main == 'games':
    #*The games folder!
        time.sleep(1)
        print('do you want to play (rock, paper scissors/maths/fast typing)')
        game = input()
  
        if game == 'rock, paper, scissors':
            while True:
# ! noise
                print('what do you want rock, paper or scissors
if you want to leave press o')
                rps = input()
                ROPESC = ['rock', 'paper', 'scissors']
                RPS = random.choice(ROPESC)
                print('the bot chose', RPS)
                if rps == 'o': 
                    break
                    print('You left')
            

        if game == 'maths':
            Maths2 = ['45', '+3', '76', '8.09', '53', '21']
            Maths = ['4', '79', '89', '57', '8', '7.8', '-2', '69']
            Symbols = ['+', '-', '*', '/']

            symbols = random.choice(Symbols)
            maths = random.choice(Maths)
            print('Starting in ')
            time.sleep(1)
            print(3)
            time.sleep(1)
            print(2)
            time.sleep(1)
            print(1)
            time.sleep(1)
            print('GO!')
            maths2 = random.choice(Maths2)
            start_time = time.time()
            print('Your porblem is', maths, symbols, maths2, '=')
            maths = input()
            fin_time = time.time() - start_time
            print('It took you', fin_time, 'to figure it out')
        if game == 'fast typing':
            fastyping = ['cat', 'man', 'woman', 'python', 'VScode', 'easy', 'last']
            time.sleep(1)
            print(3)
            time.sleep(1)
            print(2)
            time.sleep(1)
            print(1)
            time.sleep(1)
            print("GO!")
            fast = random.choice(fastyping)
            ft = random.choice(fastyping)
            fasttyping = random.choice(fastyping)
            start_time = time.time()
            
            time.sleep(3)
            ft = input(fasttyping)
            time.sleep(1)
            ft2 = input(fast)
            time.sleep(0.4)
            ft3 = input(ft)
            if ft != fasttyping or ft2 != fast or ft3 != ft:
                print("You're wrong!")
            else:
                fin_time = time.time() - start_time
                print("You're right! It took you", fin_time, "to reach")
Comment

PREVIOUS NEXT
Code Example
Python :: Python Projects for Beginners: A Ten-Week Bootcamp Approach to Python Programming 
Python :: # get the largest number in a list and print its indexes 
Python :: flask set mime type 
Python :: combine for and if python 
Python :: pandas dataframe total column 
Python :: menu extension in mit app inventor 
Python :: python is instance numpy arrya 
Python :: propositional logic python 
Python :: compare list and dataframe in pandas 
Python :: Parallel Tasks python 
Python :: if a or b in python 
Python :: how to make an action repeat in python 
Python :: code error correction 
Python :: In is_lodes_form( : Missing id-axis pairings. 
Python :: Convert the below Series to pandas datetime : DoB = pd.Series(["07Sep59","01Jan55","15Dec47","11Jul42"]) 
Python :: convert code c++ to python online 
Python :: sphinx, where to write the glossary of a sofware project 
Python :: how to upgrade pip 
Shell :: restart audio ubuntu 
Shell :: what is --use-feature=2020-resolver 
Shell :: centos 7 apache restart 
Shell :: how to update git on windows 
Shell :: install ext-dom linux 
Shell :: mysqlclient install ubuntu 
Shell :: how to disable maintenance mode in magento 2 
Shell :: curl not found 
Shell :: curl file share 
Shell :: beautifulsoup python 
Shell :: remove oh my zsh ubuntu 
Shell :: find operating system linux 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =