-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: HelloWorld From CheverJohn (#59)
* Docs: HelloWorld From CheverJohn a interesting demo by python. * Docs: just update a .py file
- Loading branch information
John Chever
authored
Dec 3, 2021
1 parent
44364d5
commit 3394323
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
Submodule MerryChristmas
added at
64a1c3
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import termcolor | ||
import random | ||
import time, datetime | ||
import sys, os | ||
from colorama import init | ||
from termcolor import colored | ||
|
||
def clear(): | ||
if sys.platform == 'win32': # if windows | ||
return os.system('cls') | ||
else: #if *nix | ||
return os.system('clear') | ||
|
||
|
||
colors = [ | ||
'red', | ||
'green', | ||
'yellow', | ||
'blue', | ||
'magenta', | ||
'cyan', | ||
'white'] | ||
|
||
yellowlight = termcolor.colored('o', 'yellow') | ||
magentalight = termcolor.colored('o', 'magenta') | ||
cyanlight = termcolor.colored('o', 'cyan') | ||
|
||
lightlist = [yellowlight, cyanlight, magentalight] | ||
|
||
init() | ||
while True: #exit with ctrl+C | ||
print('to exit use a keyboard interrupt (ctrl+c)') | ||
for i in range(1,30,2): #tree | ||
tree = '' | ||
for j in range(i): #make lights | ||
randNum=random.randint(0,500) | ||
if (randNum <= 750) and (randNum >=250) : | ||
tree += lightlist[random.randint(0,2)] | ||
else: | ||
tree += termcolor.colored('*', 'green') | ||
string = '_'*(15-int(i/2))+tree+'_'*(15-int(i/2))+'\n' | ||
print(string,end='') | ||
trunk=colored('mWm', 'yellow') | ||
for k in range(3): #trunk | ||
outbuffer = '_'*14+trunk+'_'*14+'\n' | ||
print(outbuffer, end='') | ||
merry_Christmas =termcolor.colored('Merry Christmas', colors[random.randint(0,len(colors)-1)]) | ||
outbuffer2 = '_'*8+merry_Christmas+'_'*8+'\n' | ||
print(outbuffer2, end='') | ||
time.sleep(0.4) | ||
clear() | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Please sign your name below: | ||
# e.g.: GeMini-220 | ||
CheverJohn | ||
TerrificTerry |