Skip to content

Instantly share code, notes, and snippets.

@ahmadali-jamali
Last active December 17, 2020 19:11
Show Gist options
  • Save ahmadali-jamali/8eba7a7f5c7f7d1434b69650cf2ca0f9 to your computer and use it in GitHub Desktop.
Save ahmadali-jamali/8eba7a7f5c7f7d1434b69650cf2ca0f9 to your computer and use it in GitHub Desktop.
Chrismath Binary colored Tree (art design, colored ) with Python
""" Name of the project : Christmas Binary colored Tree.
Ahmadali Jamali
Binary Neko
Teheran 12/15/2019"""
#Start>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#My libraries:
import time
import os
from os import system, name
#My object:
class marry_christmas:
#The methods:
#define christhmas tree:
global christhmas_tree
def christhmas_tree():
j = 1
print("\n")
for i in range(20,1,-1):
#conditions for colors and lights 32green 37twilight:
if (i ==20):
print(i*" ",j*"*")
j+=2
else:
os.system("color 1")
print(i*" ",+j*"*") #for colore print(i*" ",'\033[32m'+j*"*")
j+=2
print(19*" ","| |")
print(19*" ","| |")
return
#>>>>>>>>>>>>>>>>>>>>>>>>>
# define our clear function
global clear
def clear():
# for windows
if name == 'nt':
_ = system('cls')
# for mac and linux(here, os.name is 'posix')
else:
_ = system('clear')
#>>>>>>>>>>>>>>>>>>>>>>>>>>
#define the message wuth alarm:
def message():
print("\n")
print("\n")
time_c = 2
i = 0
while True:
christhmas_tree()
print("\n")
print(" *Merry Christmath*")
print(" *Binary Neko* ")
#tople for making a colored text in loop
color = ("color 2","color 3","color 7","color 6","color 4","color 5")
if i<=4:
os.system(color[i])
i+=1
else:
i = 0
# sleep for 2 seconds after printing output
time.sleep(time_c)
print("\n")
os.system(color[i])
print(" *Merry Christmath* ")
print(" *Binary Neko*")
christhmas_tree()
# now call function we defined above
clear()
time.sleep(1)
pass
#End of the class>>>>>>>>>>>>>>>>>>>>>>>>>
#main output:
if __name__ == '__main__':
p = marry_christmas
p.message()
input()
#End of the programm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment