From 69c4c9739e53fd588f8e4279a38063cae186e638 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Fri, 29 Apr 2016 10:11:01 -0400 Subject: [PATCH 01/39] Commit test,(done checking required user screen size) --- .idea/vcs.xml | 6 ++ ICS4U-PCP_GIT/ICS4U-PCP.py | 120 +++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 .idea/vcs.xml create mode 100644 ICS4U-PCP_GIT/ICS4U-PCP.py diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py new file mode 100644 index 0000000..c10949d --- /dev/null +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -0,0 +1,120 @@ +import curses +from random import randint +from curses import wrapper +import time + +stdscr = curses.initscr() +stdscr.clear() +stdscr.border(0) +stdscr.refresh() +print "hello" + +def optimize_screen(): + """ + Check user's screen and send error mesage + :return: bool + """ + # get user's screen + stdscr.refresh() + # width = curses.COLS -1 + # length = curses.LINES -1 + + length,width = stdscr.getmaxyx() + + # check the screen size, + # if width or length is less than the rquired size, send error message + + REQ_W = 112 + REQ_L = 46 + + if width < REQ_W or length < REQ_L: + #debug + stdscr.addstr(9,3,str(stdscr.getmaxyx())) + stdscr.addstr(10,3,str(width) + " " + str(length)) + stdscr.addstr(20,45,"Please make your screen size"+str(REQ_W)+"x" + +str(REQ_L)) + stdscr.addstr(21,45,"Press spacebar to continue") + + test = stdscr.getch() + + + return False + + return True + + +def coordinates(stdscr): + first_point = 0 + end_point = curses.COLS -1 + tenth_coord = 0 + + while first_point < end_point: + if first_point % 10 == 0: + stdscr.addstr(1,first_point,str(tenth_coord)) + tenth_coord += 1 + + stdscr.addstr(2,first_point,str(first_point%10)) + first_point += 1 + + first_point_2 = 0 + vertical_end_point = curses.LINES -1 + tenth_coord_2 = 0 + + while first_point_2 < vertical_end_point: + if first_point_2 % 10 == 0: + stdscr.addstr(first_point_2,1,str(tenth_coord_2)) + tenth_coord_2 += 1 + + + stdscr.addstr(first_point_2,2,str(first_point_2%10)) + first_point_2 += 1 + + +def main(stdscr): + # check user's screen size + is_small_screen = True + while is_small_screen: + #test + is_small_screen =not optimize_screen() + stdscr.addstr(7,2,str(is_small_screen)) + stdscr.getch() + + # make screen + stdscr.clear() + + # debug only + coordinates(stdscr) + # load first page + + stdscr.getch() + + """ + while 1: + event = stdscr.getch() + stdscr.addstr(10,10,str(event)) + stdscr.addstr(12,10,chr(int(event))) + stdscr.addstr(5,10,str("Press spacebar to continue!")) + if event == 27: + break + + coordinates(stdscr) + """ + + """ + if event == 32: + first_screen(stdscr) + """ + + +def first_screen(stdscr): + begin_x = 20; begin_y = 7 + height = 5; width = 40 + win = curses.newwin(height,width,begin_x,begin_y) + stdscr.clear() + curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE) + stdscr.addstr("Pretty text", curses.color_pair(1)) + stdscr.refresh() +curses.endwin() + + +wrapper(main) From 2b01e59f71989eb19c349190c5020bec49ef1aad Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Fri, 29 Apr 2016 10:15:25 -0400 Subject: [PATCH 02/39] PCP outlie (need to be updated) --- ICS4U-PCP_GIT/pcp_outline | 157 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 ICS4U-PCP_GIT/pcp_outline diff --git a/ICS4U-PCP_GIT/pcp_outline b/ICS4U-PCP_GIT/pcp_outline new file mode 100644 index 0000000..0286859 --- /dev/null +++ b/ICS4U-PCP_GIT/pcp_outline @@ -0,0 +1,157 @@ +#- Overall timeline --------------------------------------------------------------------------------------------------------------- +----------------------------------------------------- +- Brainstorm/analyze the problem - 1 week +----------------------------------------------------- +Week of Mar 20 + +TODO: + + Project: + - What's the goal? + - What's needed? + - Fun part + - Practical part + - Preview on User interface + + Python + - Practiced list and loop (wk1 - wk5) + - Vim - 2nd day of learning + +DONE: + + Goal - Make a typing game to help a computer beginner + Need + - curse python library + + - fun part + - falling speed, the number of word / sec + - Combo -> more score/sound + - best score vs current score + - Top rankers + - keep a user profile + - Show statistics + - life (+ or -) + + - Practical part + - a list of python commands + - words in dictionary + - choose your level + - grouping - alphabetic, numeric, alphanumeric, symbols + + Python + - wk4. practiced for/while over string and numbers + + +----------------------------------------------------- +- Design/Create specifications(top down design) - 2 weeks +----------------------------------------------------- +Week of Mar 27 + - Spec(Determine what the program does) + - IPO chart + - User interface + +TODO: + + Project: + - Finalize the user interface - a few of drawings + - Draw an IPO chart + Example: http://northern.lkdsb.net/Kedwell/ICS3U/Unit_ProbSolv/IPO_Chart.htm + https://dansddmajor.wordpress.com/2008/04/ + + Python: + - wk5. Learn lists + - wk5. Learn loop over lists + +DONE: + + IPO chart: + + During game + + Inputs Processes Outputs + ------ --------- -------- + alphas Display entered alphas on the screen + numbers + symbols + + space blank + shift Caps when pressed + + enter Check the entered values are same as one of falling words + esc Exit the game + + down arrow pause game + (other than above) (ignore) + + mouse (ignore) + + + User interface + + Main screen + +------------------------------------+ + | "NAME....." | + | | + | (P) Play - typing game - Easy + | - coding practice Medium + | Hard + | | + | (Q) Quit | + | | + | | + +------------------------------------+ + + Python: + - wk5. Practised lists /w loops + + +Week of Apr 3 + - Design(Determine how the program does) + - Top-down design chart + - flowChart + + TODO: + - Review design + - Wk6. Learn dict 1/2 + Learn File + review list + + - Design top-down design + + DONE: + - Done FILE - write and read a file + - Done first a user interface - drawing is available + - Exercised list and dict type + - Reviewed school homework (roll dices game) + +----------------------------------------------------- +- Development - 5 Weeks +----------------------------------------------------- +Week of Apr 10 + + TODO: + - Play with curses. Create the main page + +Week of Apr 17 + TODO: + - Complete the main page + - Create the last page - stats, read/write from/to a file + + Week of Apr 24 + Week of May 1 + Week of May 8 + +In progress: + reference: + https://docs.python.org/3.3/howto/curses.html + +Testing & Fixing - 2 Weeks + Week of May 15 + Week of May 22 + +Documentation - 1 Week + Week of May 29 + +spare time - 1 week + +Total - 12 weeks \ No newline at end of file From 76a43492e2d62ce3e1e3a648b197570d73963055 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 2 May 2016 10:28:25 -0400 Subject: [PATCH 03/39] defined debug function and created a boarder for the first screen --- ICS4U-PCP_GIT/ICS4U-PCP.py | 43 +++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index c10949d..e0194ab 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -3,12 +3,18 @@ from curses import wrapper import time +mydebugOn = True stdscr = curses.initscr() stdscr.clear() stdscr.border(0) stdscr.refresh() print "hello" +def debug(mystr): + if mydebugOn: + stdscr.addstr(30,30,"Debug:" + str(mystr)) + + def optimize_screen(): """ Check user's screen and send error mesage @@ -28,8 +34,8 @@ def optimize_screen(): REQ_L = 46 if width < REQ_W or length < REQ_L: - #debug - stdscr.addstr(9,3,str(stdscr.getmaxyx())) + debug(stdscr.getmaxyx) + #stdscr.addstr(9,3,str(stdscr.getmaxyx())) stdscr.addstr(10,3,str(width) + " " + str(length)) stdscr.addstr(20,45,"Please make your screen size"+str(REQ_W)+"x" +str(REQ_L)) @@ -43,6 +49,8 @@ def optimize_screen(): return True + + def coordinates(stdscr): first_point = 0 end_point = curses.COLS -1 @@ -73,19 +81,21 @@ def coordinates(stdscr): def main(stdscr): # check user's screen size is_small_screen = True - while is_small_screen: - #test - is_small_screen =not optimize_screen() - stdscr.addstr(7,2,str(is_small_screen)) - stdscr.getch() + #while is_small_screen: + # #test + # is_small_screen =not optimize_screen() + # stdscr.addstr(7,2,str(is_small_screen)) + # stdscr.getch() # make screen stdscr.clear() + stdscr.refresh() # debug only coordinates(stdscr) # load first page - + first_screen(stdscr) + #debug("test") stdscr.getch() """ @@ -107,13 +117,18 @@ def main(stdscr): def first_screen(stdscr): - begin_x = 20; begin_y = 7 - height = 5; width = 40 - win = curses.newwin(height,width,begin_x,begin_y) - stdscr.clear() - curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE) - stdscr.addstr("Pretty text", curses.color_pair(1)) + + # V H + title_pad = curses.newpad(10,10) + + + title_pad.addstr(2,5,"boarder") + title_pad.refresh(1,2,5,10,15,20) + + debug("test") + stdscr.refresh() + curses.endwin() From dce89aecde5222026bca282eb420b0e0ca3a1db9 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 16 May 2016 13:32:56 -0400 Subject: [PATCH 04/39] outline updated --- ICS4U-PCP_GIT/fad.py | 0 ICS4U-PCP_GIT/pcp_outline | 15 ++++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 ICS4U-PCP_GIT/fad.py diff --git a/ICS4U-PCP_GIT/fad.py b/ICS4U-PCP_GIT/fad.py new file mode 100644 index 0000000..e69de29 diff --git a/ICS4U-PCP_GIT/pcp_outline b/ICS4U-PCP_GIT/pcp_outline index 0286859..be3acf7 100644 --- a/ICS4U-PCP_GIT/pcp_outline +++ b/ICS4U-PCP_GIT/pcp_outline @@ -139,19 +139,20 @@ Week of Apr 17 Week of Apr 24 Week of May 1 +------------------------------------------------- Week of May 8 - -In progress: - reference: - https://docs.python.org/3.3/howto/curses.html - Testing & Fixing - 2 Weeks - Week of May 15 + Week of May 15 <---------- finish first delivery Week of May 22 +-------------------------------------------------- Documentation - 1 Week Week of May 29 spare time - 1 week -Total - 12 weeks \ No newline at end of file +Total - 12 weeks + +In progress: + reference: + https://docs.python.org/3.3/howto/curses.html \ No newline at end of file From 74eab0f404a68e4c2d0ee1372da03447d0b655d0 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 16 May 2016 13:36:10 -0400 Subject: [PATCH 05/39] create word and get user input --- ICS4U-PCP_GIT/ICS4U-PCP.py | 290 ++++++++++++++++++++++--------------- 1 file changed, 170 insertions(+), 120 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index e0194ab..238bcc3 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -1,135 +1,185 @@ +# SNAKES GAME +# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting +# https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py + import curses +from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN from random import randint -from curses import wrapper import time - -mydebugOn = True -stdscr = curses.initscr() -stdscr.clear() -stdscr.border(0) -stdscr.refresh() -print "hello" - -def debug(mystr): - if mydebugOn: - stdscr.addstr(30,30,"Debug:" + str(mystr)) - - -def optimize_screen(): +import threading + +ent = "" +test_val = 1 +SCR_Y_MAX = 40 +SCR_X_MAX = 60 + +def my_raw_input(stdscr, r, c, prompt_string): + curses.echo() + stdscr.addstr(r, c, prompt_string) + stdscr.refresh() + input = stdscr.getstr(r + 1, c, 20) + return input # ^^^^ reading input at next line + +def clear_line(y): + """ (int) -> None """ - Check user's screen and send error mesage - :return: bool - """ - # get user's screen - stdscr.refresh() - # width = curses.COLS -1 - # length = curses.LINES -1 - - length,width = stdscr.getmaxyx() - - # check the screen size, - # if width or length is less than the rquired size, send error message - - REQ_W = 112 - REQ_L = 46 - - if width < REQ_W or length < REQ_L: - debug(stdscr.getmaxyx) - #stdscr.addstr(9,3,str(stdscr.getmaxyx())) - stdscr.addstr(10,3,str(width) + " " + str(length)) - stdscr.addstr(20,45,"Please make your screen size"+str(REQ_W)+"x" - +str(REQ_L)) - stdscr.addstr(21,45,"Press spacebar to continue") - - test = stdscr.getch() - - - return False - - return True - - - - -def coordinates(stdscr): - first_point = 0 - end_point = curses.COLS -1 - tenth_coord = 0 - - while first_point < end_point: - if first_point % 10 == 0: - stdscr.addstr(1,first_point,str(tenth_coord)) - tenth_coord += 1 - - stdscr.addstr(2,first_point,str(first_point%10)) - first_point += 1 - - first_point_2 = 0 - vertical_end_point = curses.LINES -1 - tenth_coord_2 = 0 - - while first_point_2 < vertical_end_point: - if first_point_2 % 10 == 0: - stdscr.addstr(first_point_2,1,str(tenth_coord_2)) - tenth_coord_2 += 1 - - - stdscr.addstr(first_point_2,2,str(first_point_2%10)) - first_point_2 += 1 - - -def main(stdscr): - # check user's screen size - is_small_screen = True - #while is_small_screen: - # #test - # is_small_screen =not optimize_screen() - # stdscr.addstr(7,2,str(is_small_screen)) - # stdscr.getch() - - # make screen - stdscr.clear() - stdscr.refresh() - - # debug only - coordinates(stdscr) - # load first page - first_screen(stdscr) - #debug("test") - stdscr.getch() + empty = " " * SCR_X_MAX + win.addstr(y, 1, empty) +def debug(msg, level): + """ (str, int, int) -> None """ + y = SCR_Y_MAX - 10 + level + clear_line(y) + #win.addstr(y, 1, 'DEBUG: '+msg) + +def move_down(screen, word): + if word == None: + return + empty = " " * len(word[2]) + screen.addstr(word[0], word[1], empty) + word[0] += 1 + screen.addstr(word[0], word[1], word[2]) + +def create_work(): + + word_len = 4 + word = "" + for ch_num in range(word_len): + ch = chr(randint(ord('a'), ord('z'))) + word += ch + x = randint(0, SCR_X_MAX) + y_x_word = [ 0, x, word ] + #debug("new word: "+str(y_x_word), 2) + return y_x_word + +def create_word(screen, word): while 1: - event = stdscr.getch() - stdscr.addstr(10,10,str(event)) - stdscr.addstr(12,10,chr(int(event))) - stdscr.addstr(5,10,str("Press spacebar to continue!")) - if event == 27: - break - - coordinates(stdscr) - """ - - """ - if event == 32: - first_screen(stdscr) - """ + #screen.border(0) + global test_val + global ent -def first_screen(stdscr): + if word: + screen.addstr(12, 12, 'testval:'+str(test_val)); + move_down(screen, word) + #screen.addstr(12, 12, time.strftime("%a, %d %b %Y %H:%M:%S")) + screen.refresh() - # V H - title_pad = curses.newpad(10,10) + if ent == word[2]: + global curses + curses.beep() + word = None + word = create_work() + time.sleep(0.5) +stdscr = curses.initscr() +curses.noecho() +curses.curs_set(0) +stdscr.clear() +#stdscr.resize(50, 50) +stdscr.border(0) +stdscr.refresh() +#choice = my_raw_input(stdscr, 2, 3, "cool or hot?").lower() +#print("CHOICE: " +str(choice)) +#choice = my_raw_input(stdscr, 2, 3, "cool or hot?").lower() + +#win = curses.newwin(SCR_Y_MAX, SCR_X_MAX, 0, 0) + +#win.keypad(1) +#curses.noecho() +#curses.curs_set(0) +#win.border(0) + + +#key = KEY_RIGHT # Initializing values +#curses.delay_output(1000) +#curses.echo() + +new_word = create_work() +#win.border(0) + +#--------------------------------------- +#win = curses.newwin(10,10,0,0) +#win.border(0) +#win.addstr(0,0,'hELLo') +#win.refresh() +#--------------------------------------- + + +# pad ---------------------------------------- +#pad = curses.newpad(100, 100) +## These loops fill the pad with letters; this is +## explained in the next section +#for y in range(0, 100): +# for x in range(0, 100): +# try: +# pad.addch(y,x, ord('a') + (x*x+y*y) % 26) +# except curses.error: +# pass + +# Displays a section of the pad in the middle of the screen +#pad.refresh(0,0, 5,5, 20,75) +#win.getch() + +#win2 = curses.newwin(5,5,41,00) +# +#while key != 27: +# win2.border(0) +# win2.refresh() +# +# win.border(0) +# win.refresh() +# #win.timeout(500) +# #prevKey = key +# #win.getch() +# +# ## no key is pressed +# #if event == -1: +# # key = key +# #else: +# # key = event +# +# #debug('key: ' + str(key) + ' ' + +# # 'chr(' + str(key) + '): ' + str(chr(key)), 1) +# move_down(new_word) +# time.sleep(0.5) +# #choice = my_raw_input(stdscr, 2, 3, "cool or hot?").lower() +# #print("CHOICE: " +str(choice)) + +clock = threading.Thread(target=create_word, args=(stdscr,new_word)) +clock.daemon = True +clock.start() +saved ="" +while 1: + #time.sleep(1) + #new_word = create_work() + #clock2 = threading.Thread(target=create_word, args=(stdscr,new_word)) + #clock2.daemon = True + #clock2.start() + + #time.sleep(1) + global test_val + test_val += 1 + event = stdscr.getch() + if event != 10: + saved += chr(event) + if event == 8: + stdscr.addstr(15,10, 'backspace') + saved = saved[:-2] + stdscr.addstr(10,10, ' ') + stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) + if event == 10: + global ent + ent = saved + saved = "" + stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) + #if event == ord("q"): + if event == 27: + break - title_pad.addstr(2,5,"boarder") - title_pad.refresh(1,2,5,10,15,20) - - debug("test") - stdscr.refresh() curses.endwin() - - -wrapper(main) +#print("\nScore - " + str(score)) +print("http://bitemelater.in\n") From c99a40eaf5a5aa5f12ffc9d5bfea7f119a498c89 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 30 May 2016 10:39:09 -0400 Subject: [PATCH 06/39] Snake.py - (not mine) --- ICS4U-PCP_GIT/snake.py | 79 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 ICS4U-PCP_GIT/snake.py diff --git a/ICS4U-PCP_GIT/snake.py b/ICS4U-PCP_GIT/snake.py new file mode 100644 index 0000000..7d39483 --- /dev/null +++ b/ICS4U-PCP_GIT/snake.py @@ -0,0 +1,79 @@ +# SNAKES GAME +# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting +# https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py + +import curses +from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN +from random import randint + + +curses.initscr() +win = curses.newwin(20, 60, 0, 0) +win.keypad(1) +curses.noecho() +curses.curs_set(0) +win.border(0) +win.nodelay(1) + +key = KEY_RIGHT # Initializing values +score = 0 + +snake = [[4,10], [4,9], [4,8]] # Initial snake co-ordinates +food = [10,20] # First food co-ordinates + +win.addch(food[0], food[1], '*') # Prints the food + +while key != 27: # While Esc key is not pressed + win.border(0) + win.addstr(0, 2, 'Score : ' + str(score) + ' ') # Printing 'Score' and + win.addstr(0, 27, ' SNAKE ') # 'SNAKE' strings + #win.timeout(150 - (len(snake)/5 + len(snake)/10)%120) # Increases the speed of Snake as its length increases + win.timeout(500) + + prevKey = key # Previous key pressed + event = win.getch() + key = key if event == -1 else event + + + if key == ord(' '): # If SPACE BAR is pressed, wait for another + key = -1 # one (Pause/Resume) + while key != ord(' '): + key = win.getch() + key = prevKey + continue + + if key not in [KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN, 27]: # If an invalid key is pressed + key = prevKey + + # Calculates the new coordinates of the head of the snake. NOTE: len(snake) increases. + # This is taken care of later at [1]. + snake.insert(0, [snake[0][0] + (key == KEY_DOWN and 1) + (key == KEY_UP and -1), snake[0][1] + (key == KEY_LEFT and -1) + (key == KEY_RIGHT and 1)]) + + # If snake crosses the boundaries, make it enter from the other side + if snake[0][0] == 0: snake[0][0] = 18 + if snake[0][1] == 0: snake[0][1] = 58 + if snake[0][0] == 19: snake[0][0] = 1 + if snake[0][1] == 59: snake[0][1] = 1 + + # Exit if snake crosses the boundaries (Uncomment to enable) + #if snake[0][0] == 0 or snake[0][0] == 19 or snake[0][1] == 0 or snake[0][1] == 59: break + + # If snake runs over itself + if snake[0] in snake[1:]: break + + + if snake[0] == food: # When snake eats the food + food = [] + score += 1 + while food == []: + food = [randint(1, 18), randint(1, 58)] # Calculating next food's coordinates + if food in snake: food = [] + win.addch(food[0], food[1], '*') + else: + last = snake.pop() # [1] If it does not eat the food, length decreases + win.addch(last[0], last[1], ' ') + win.addch(snake[0][0], snake[0][1], '#') + +curses.endwin() +print("\nScore - " + str(score)) +print("http://bitemelater.in\n") From de3f54381abd10c93fc485f403ff1296dac5744b Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 30 May 2016 10:45:26 -0400 Subject: [PATCH 07/39] Able to stop words falling --- ICS4U-PCP_GIT/ICS4U-PCP.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 238bcc3..d3bba9e 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -42,7 +42,6 @@ def move_down(screen, word): screen.addstr(word[0], word[1], word[2]) def create_work(): - word_len = 4 word = "" for ch_num in range(word_len): @@ -59,7 +58,6 @@ def create_word(screen, word): global test_val global ent - if word: screen.addstr(12, 12, 'testval:'+str(test_val)); move_down(screen, word) From c1b587b4d8e5dea3fac393b1cb2474edecccbb4c Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 30 May 2016 10:53:04 -0400 Subject: [PATCH 08/39] curses tests - draw coordinates on the screen --- ICS4U-PCP_GIT/coor.py | 101 ++++++++++++++++++++++++++++++++++++++++ ICS4U-PCP_GIT/drawEX.py | 0 2 files changed, 101 insertions(+) create mode 100644 ICS4U-PCP_GIT/coor.py create mode 100644 ICS4U-PCP_GIT/drawEX.py diff --git a/ICS4U-PCP_GIT/coor.py b/ICS4U-PCP_GIT/coor.py new file mode 100644 index 0000000..89b9d28 --- /dev/null +++ b/ICS4U-PCP_GIT/coor.py @@ -0,0 +1,101 @@ +# SNAKES GAME +# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting +# https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py + +import curses +from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN +from curses.textpad import Textbox, rectangle +from random import randint +import time +import threading + +ent = "" +test_val = 1 +SCR_Y_MAX = 40 +SCR_X_MAX = 60 + +# color setting +# + +#0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and 7:white. The curses module defines named constants for each of these colors: curses.COLOR_BLACK, curses.COLOR_RED, and so forth. +# f b + +#stdscr = curses.initscr() + +def drawCoor(scr): + scr_y = curses.LINES - 1 + scr_x = curses.COLS - 1 + for x in range(scr_x): + scr.addstr(3,x, str(x%10)) + if (x % 10 == 0): + scr.addstr(2,x, str(x//10)) + + x = 0 + for y in range(scr_y): + scr.addstr(y,2, str(y%10)) + if (y % 10 == 0): + scr.addstr(y,1, str(y//10)) + + + + +def main(stdscr): + + curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE) + curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLUE ) + + #curses.noecho() + #curses.curs_set(0) + #stdscr.clear() + #stdscr.resize(50, 50) + #stdscr.border(0) + #x=input("...waiting..") + #curses.endwin() + + stdscr.border(0) + stdscr.refresh() + + stdscr_y = curses.LINES - 1 + stdscr_x = curses.COLS - 1 + + drawCoor(stdscr) + + pad = curses.newpad(20, 20) + pad2 = curses.newpad(20, 20) + + + for y in range(0, 19): + for x in range(0, 19): + pad.addch(y,x, ord('a') + (x*x+y*y) % 26) + + for y in range(0, 19): + for x in range(0, 19): + pad2.addch(y,x, ord('-')) + + pad.border(0) + pad2.border(0) + + pad2.refresh(0,0, 15,5, 65,30) + pad.refresh(0,0, 5,15, 30,40) + stdscr.refresh() + + stdscr.addstr(15, 50,"Pretty text", curses.color_pair(2)) + stdscr.addstr(10, 50, "Current mode: Typing mode", curses.A_REVERSE) + stdscr.addstr(10, 50, "HELLO") + stdscr.refresh() + + + stdscr.addstr(50, 50, "Enter IM message: (hit Ctrl-G to send)") + + + rectangle(stdscr, 40,80, 60, 100) + stdscr.refresh() + + ## Let the user edit until Ctrl-G is struck. + editwin = curses.newwin(10,10, 50,90) # height, width, begin_y, begin_x + stdscr.refresh() + box = Textbox(editwin) + box.edit() + + +curses.wrapper(main) diff --git a/ICS4U-PCP_GIT/drawEX.py b/ICS4U-PCP_GIT/drawEX.py new file mode 100644 index 0000000..e69de29 From a4013e193dd77c5197d4142ebcf000fa0938e688 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 30 May 2016 10:56:28 -0400 Subject: [PATCH 09/39] Panel practice --- ICS4U-PCP_GIT/panelEX.py | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ICS4U-PCP_GIT/panelEX.py diff --git a/ICS4U-PCP_GIT/panelEX.py b/ICS4U-PCP_GIT/panelEX.py new file mode 100644 index 0000000..80a941e --- /dev/null +++ b/ICS4U-PCP_GIT/panelEX.py @@ -0,0 +1,49 @@ +from time import sleep +import curses, curses.panel + +def make_panel(h,l, y,x, str): + win = curses.newwin(h,l, y,x) + win.erase() + win.box() + win.addstr(2, 2, str) + + panel = curses.panel.new_panel(win) + return win, panel + +def test(stdscr): + try: + curses.curs_set(0) + except: + pass + stdscr.box() + stdscr.addstr(2, 2, "panels everywhere") + win1, panel1 = make_panel(10,12, 5,5, "Panel 1") + win2, panel2 = make_panel(10,12, 8,8, "Panel 2") + + curses.panel.update_panels(); + stdscr.refresh() + + sleep(1) + + panel1.top(); curses.panel.update_panels(); stdscr.refresh() + sleep(1) + + panel1.hide(); + curses.panel.update_panels(); + stdscr.refresh() + sleep(1) + + panel1.show(); + curses.panel.update_panels(); + stdscr.refresh() + sleep(1) + + for i in range(20): + panel2.move(8, 8+i) + curses.panel.update_panels(); stdscr.refresh() + sleep(0.1) + + sleep(1) + +if __name__ == '__main__': + curses.wrapper(test) From 7a52f34d10511a5e59e2f93fa352d1aefe40176b Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 30 May 2016 11:54:40 -0400 Subject: [PATCH 10/39] coordinates don't appear on the screen --- ICS4U-PCP_GIT/ICS4U-PCP.py | 62 +++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index d3bba9e..83d694f 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -13,6 +13,20 @@ SCR_Y_MAX = 40 SCR_X_MAX = 60 +def drawCoor(scr): + scr_y = curses.LINES - 1 + scr_x = curses.COLS - 1 + for x in range(scr_x): + scr.addstr(3,x, str(x%10)) + if (x % 10 == 0): + scr.addstr(2,x, str(x//10)) + + x = 0 + for y in range(scr_y): + scr.addstr(y,2, str(y%10)) + if (y % 10 == 0): + scr.addstr(y,1, str(y//10)) + def my_raw_input(stdscr, r, c, prompt_string): curses.echo() stdscr.addstr(r, c, prompt_string) @@ -24,7 +38,7 @@ def clear_line(y): """ (int) -> None """ empty = " " * SCR_X_MAX - win.addstr(y, 1, empty) + stdscr.addstr(y, 1, empty) def debug(msg, level): """ (str, int, int) -> None @@ -176,8 +190,54 @@ def create_word(screen, word): if event == 27: break +def main(stdscr): + + #curses.noecho() + #curses.curs_set(0) + #stdscr.clear() + #stdscr.resize(50, 50) + #stdscr.border(0) + #x=input("...waiting..") + #curses.endwin() + + stdscr.border(0) + stdscr.refresh() + + stdscr_y = curses.LINES - 1 + stdscr_x = curses.COLS - 1 + + drawCoor(stdscr) + + pad = curses.newpad(20, 20) + pad2 = curses.newpad(20, 20) + # These loops fill the pad with letters; addch() is + # explained in the next section + for y in range(0, 19): + for x in range(0, 19): + pad.addch(y,x, ord('a') + (x*x+y*y) % 26) + + for y in range(0, 19): + for x in range(0, 19): + pad2.addch(y,x, ord('-')) + + pad.border(0) + pad2.border(0) + + pad2.refresh(0,0, 15,5, 25,10) + pad.refresh(0,0, 5,5, 10,10) + + stdscr.refresh() + + curses.noecho() + while 1: + event = stdscr.getch() + stdscr.addstr(20,20,str(event)) + curses.beep() + curses.flash() + #curses.echo(); curses.endwin() +curses.wrapper(main) #print("\nScore - " + str(score)) print("http://bitemelater.in\n") From 702c7bec62164a659f7e0c2089c69f0d7500ec3f Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 6 Jun 2016 10:25:29 -0400 Subject: [PATCH 11/39] Defined class and set the world length accroding to the difficulty --- ICS4U-PCP_GIT/ICS4U-PCP.py | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 83d694f..08e0f79 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -2,12 +2,74 @@ # Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting # https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py +MAX_Y = 0 # current screen Y +MAX_X = 0 # current screen X +REQ_Y = 0 # required screen size Y +REQ_X = 0 # required screen size X +ENG_WORDS = [] +ENG_WORDS_LEN = 0 +PY_WORDS = [] +PY_WORDS_LEN = 0 + import curses from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN from random import randint import time import threading +class Word(object): + """ + Representation of words + """ + def __init__(self, diffc="hard", ptype="coding"): + """ + selects a word according to user difficulty + :param diffc: str - difficulty selected by user + :param ptype: str - game type selected by user + :return: None + """ + word = "" + + # Practice + if ptype == "prac": + # Easy or medium + if diffc == "easy" or diffc == "medium": + max_word_len = 0 + if diffc == "easy": + min_word_len = 3 + max_word_len = 4 + elif diffc == "medium": + min_word_len = 5 + max_word_len = 20 + + # Create a word + word = ENG_WORDS[randint(0, ENG_WORDS_LEN - 1)].strip() + while len(word) > max_word_len or len(word) < min_word_len : + word = ENG_WORDS[randint(0, ENG_WORDS_LEN-1)].strip() + # Hard + else: + max_word_len = 7 + for dummy in range(max_word_len): + ch = chr(randint(ord('!'), ord('~'))) + word += ch + # Coding + else: + max_word_len = 0 + # Easy or medium + if diffc == "easy": + min_word_len = 3 + max_word_len = 5 + elif diffc == "medium": + min_word_len = 5 + max_word_len = 10 + # Hard + else: + min_word_len = 5 + max_word_len = 30 + + + + ent = "" test_val = 1 SCR_Y_MAX = 40 From bdda171d20fa7e3ae2c024b9735ce620023b7e02 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 6 Jun 2016 10:27:06 -0400 Subject: [PATCH 12/39] removed some comment lines --- ICS4U-PCP_GIT/ICS4U-PCP.py | 55 -------------------------------------- 1 file changed, 55 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 08e0f79..89542d7 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -158,68 +158,13 @@ def create_word(screen, word): #print("CHOICE: " +str(choice)) #choice = my_raw_input(stdscr, 2, 3, "cool or hot?").lower() -#win = curses.newwin(SCR_Y_MAX, SCR_X_MAX, 0, 0) -#win.keypad(1) -#curses.noecho() -#curses.curs_set(0) -#win.border(0) #key = KEY_RIGHT # Initializing values -#curses.delay_output(1000) -#curses.echo() - new_word = create_work() #win.border(0) -#--------------------------------------- -#win = curses.newwin(10,10,0,0) -#win.border(0) -#win.addstr(0,0,'hELLo') -#win.refresh() -#--------------------------------------- - - -# pad ---------------------------------------- -#pad = curses.newpad(100, 100) -## These loops fill the pad with letters; this is -## explained in the next section -#for y in range(0, 100): -# for x in range(0, 100): -# try: -# pad.addch(y,x, ord('a') + (x*x+y*y) % 26) -# except curses.error: -# pass - -# Displays a section of the pad in the middle of the screen -#pad.refresh(0,0, 5,5, 20,75) -#win.getch() - -#win2 = curses.newwin(5,5,41,00) -# -#while key != 27: -# win2.border(0) -# win2.refresh() -# -# win.border(0) -# win.refresh() -# #win.timeout(500) -# #prevKey = key -# #win.getch() -# -# ## no key is pressed -# #if event == -1: -# # key = key -# #else: -# # key = event -# -# #debug('key: ' + str(key) + ' ' + -# # 'chr(' + str(key) + '): ' + str(chr(key)), 1) -# move_down(new_word) -# time.sleep(0.5) -# #choice = my_raw_input(stdscr, 2, 3, "cool or hot?").lower() -# #print("CHOICE: " +str(choice)) clock = threading.Thread(target=create_word, args=(stdscr,new_word)) clock.daemon = True From 1694559a51b50fd47d4f3331ec6b0cd46f8b8fbb Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 6 Jun 2016 23:53:43 -0400 Subject: [PATCH 13/39] Fixed coordinates --- ICS4U-PCP_GIT/ICS4U-PCP.py | 95 +++++++++++--------------------------- 1 file changed, 27 insertions(+), 68 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 89542d7..d3d8c87 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -2,6 +2,8 @@ # Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting # https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py +#Init variables + MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X REQ_Y = 0 # required screen size Y @@ -10,9 +12,11 @@ ENG_WORDS_LEN = 0 PY_WORDS = [] PY_WORDS_LEN = 0 +STDSCR = "" import curses -from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN +#below code needs to be fixed +#from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN from random import randint import time import threading @@ -39,33 +43,9 @@ def __init__(self, diffc="hard", ptype="coding"): min_word_len = 3 max_word_len = 4 elif diffc == "medium": - min_word_len = 5 + min_word_len = 10 max_word_len = 20 - # Create a word - word = ENG_WORDS[randint(0, ENG_WORDS_LEN - 1)].strip() - while len(word) > max_word_len or len(word) < min_word_len : - word = ENG_WORDS[randint(0, ENG_WORDS_LEN-1)].strip() - # Hard - else: - max_word_len = 7 - for dummy in range(max_word_len): - ch = chr(randint(ord('!'), ord('~'))) - word += ch - # Coding - else: - max_word_len = 0 - # Easy or medium - if diffc == "easy": - min_word_len = 3 - max_word_len = 5 - elif diffc == "medium": - min_word_len = 5 - max_word_len = 10 - # Hard - else: - min_word_len = 5 - max_word_len = 30 @@ -75,19 +55,25 @@ def __init__(self, diffc="hard", ptype="coding"): SCR_Y_MAX = 40 SCR_X_MAX = 60 -def drawCoor(scr): - scr_y = curses.LINES - 1 - scr_x = curses.COLS - 1 - for x in range(scr_x): - scr.addstr(3,x, str(x%10)) +def drawCoor(): + """ + draws coordinates on the screen while debugging + :return: None + """ + STDSCR.clear() + STDSCR.border(0) + STDSCR.refresh() + for x in range(MAX_X): + STDSCR.addstr(2,x, str(x%10)) if (x % 10 == 0): - scr.addstr(2,x, str(x//10)) + STDSCR.addstr(1,x, str(x//10)) - x = 0 - for y in range(scr_y): - scr.addstr(y,2, str(y%10)) + for y in range(MAX_Y): + STDSCR.addstr(y,2, str(y%10)) if (y % 10 == 0): - scr.addstr(y,1, str(y//10)) + STDSCR.addstr(y,1, str(y//10)) + + STDSCR.refresh() def my_raw_input(stdscr, r, c, prompt_string): curses.echo() @@ -109,14 +95,6 @@ def debug(msg, level): clear_line(y) #win.addstr(y, 1, 'DEBUG: '+msg) -def move_down(screen, word): - if word == None: - return - empty = " " * len(word[2]) - screen.addstr(word[0], word[1], empty) - word[0] += 1 - screen.addstr(word[0], word[1], word[2]) - def create_work(): word_len = 4 word = "" @@ -136,8 +114,7 @@ def create_word(screen, word): if word: screen.addstr(12, 12, 'testval:'+str(test_val)); - move_down(screen, word) - #screen.addstr(12, 12, time.strftime("%a, %d %b %Y %H:%M:%S")) + Word.move_down(screen, word) screen.refresh() if ent == word[2]: @@ -158,9 +135,6 @@ def create_word(screen, word): #print("CHOICE: " +str(choice)) #choice = my_raw_input(stdscr, 2, 3, "cool or hot?").lower() - - - #key = KEY_RIGHT # Initializing values new_word = create_work() #win.border(0) @@ -171,13 +145,6 @@ def create_word(screen, word): clock.start() saved ="" while 1: - #time.sleep(1) - #new_word = create_work() - #clock2 = threading.Thread(target=create_word, args=(stdscr,new_word)) - #clock2.daemon = True - #clock2.start() - - #time.sleep(1) global test_val test_val += 1 event = stdscr.getch() @@ -199,21 +166,14 @@ def create_word(screen, word): def main(stdscr): - #curses.noecho() - #curses.curs_set(0) - #stdscr.clear() - #stdscr.resize(50, 50) - #stdscr.border(0) - #x=input("...waiting..") - #curses.endwin() - stdscr.border(0) stdscr.refresh() stdscr_y = curses.LINES - 1 stdscr_x = curses.COLS - 1 - - drawCoor(stdscr) + global STDSCR + STDSCR = stdscr + drawCoor(STDSCR) pad = curses.newpad(20, 20) pad2 = curses.newpad(20, 20) @@ -246,5 +206,4 @@ def main(stdscr): curses.endwin() curses.wrapper(main) -#print("\nScore - " + str(score)) -print("http://bitemelater.in\n") + From 73ec292d95d88114234ef674c07434655b776c8c Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Tue, 7 Jun 2016 21:12:39 -0400 Subject: [PATCH 14/39] Can't draw coordinates and main screen --- ICS4U-PCP_GIT/ICS4U-PCP.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index d3d8c87..e5707e1 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -2,7 +2,9 @@ # Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting # https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py -#Init variables +# ------------------------------------------------------- +# Global Varibles +# ------------------------------------------------------- MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X @@ -40,14 +42,11 @@ def __init__(self, diffc="hard", ptype="coding"): if diffc == "easy" or diffc == "medium": max_word_len = 0 if diffc == "easy": - min_word_len = 3 - max_word_len = 4 + min_word_len = 2 + max_word_len = 5 elif diffc == "medium": min_word_len = 10 - max_word_len = 20 - - - + max_word_len = 15 ent = "" @@ -114,7 +113,7 @@ def create_word(screen, word): if word: screen.addstr(12, 12, 'testval:'+str(test_val)); - Word.move_down(screen, word) + #Word.move_down(screen, word) screen.refresh() if ent == word[2]: @@ -163,8 +162,21 @@ def create_word(screen, word): #if event == ord("q"): if event == 27: break - +def mainscreen(): + option = "PLAY" + option2 = "USER STATS" + option3 = "EXIT" + + drawCoor(stdscr) + + menu_win = curses.newwin(4,10,5,30) + menu_pan = curses.panel.new_panel(menu_win) + menu_pan.top() + curses.panel.update_panels() + menu_win.noutfresh() + curses.doupdate() def main(stdscr): + mainscreen() stdscr.border(0) stdscr.refresh() From 29ddc6967e902e316a5540334c7659a34f71c496 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Tue, 7 Jun 2016 22:23:33 -0400 Subject: [PATCH 15/39] Tried to fix --- ICS4U-PCP_GIT/ICS4U-PCP.py | 58 +++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index e5707e1..a0ef543 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -2,6 +2,14 @@ # Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting # https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py +#below code needs to be fixed +#from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN +from random import randint +import time +import curses.panel +import threading + + # ------------------------------------------------------- # Global Varibles # ------------------------------------------------------- @@ -16,13 +24,6 @@ PY_WORDS_LEN = 0 STDSCR = "" -import curses -#below code needs to be fixed -#from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN -from random import randint -import time -import threading - class Word(object): """ Representation of words @@ -55,10 +56,7 @@ def __init__(self, diffc="hard", ptype="coding"): SCR_X_MAX = 60 def drawCoor(): - """ - draws coordinates on the screen while debugging - :return: None - """ + STDSCR.clear() STDSCR.border(0) STDSCR.refresh() @@ -112,7 +110,7 @@ def create_word(screen, word): global ent if word: - screen.addstr(12, 12, 'testval:'+str(test_val)); + screen.addstr(12, 12, 'testval:'+str(test_val)) #Word.move_down(screen, word) screen.refresh() @@ -162,21 +160,33 @@ def create_word(screen, word): #if event == ord("q"): if event == 27: break -def mainscreen(): - option = "PLAY" - option2 = "USER STATS" - option3 = "EXIT" - drawCoor(stdscr) +def mainGameScreen(): + STDSCR.clear() + STDSCR.refresh() + drawCoor(STDSCR) + + menu1 = "P: PLAY" + menu2 = "S: USER STATS" + menu3 = "X: EXIT" + menu_win = curses.newwin(11, 30 , 30, 78) + menu_win.addstr(1, 1, menu1) + menu_win.addstr(2, 1, menu2) + menu_win.addstr(3, 1, menu3) + menu_panel = curses.panel.new_panel(menu_win) + menu_panel.top();curses.panel.update_panels() + menu_win.noutrefresh(); curses.doupdate() - menu_win = curses.newwin(4,10,5,30) menu_pan = curses.panel.new_panel(menu_win) menu_pan.top() curses.panel.update_panels() - menu_win.noutfresh() + menu_win.noutrefresh() curses.doupdate() + + + + def main(stdscr): - mainscreen() stdscr.border(0) stdscr.refresh() @@ -187,6 +197,8 @@ def main(stdscr): STDSCR = stdscr drawCoor(STDSCR) + mainGameScreen() + pad = curses.newpad(20, 20) pad2 = curses.newpad(20, 20) # These loops fill the pad with letters; addch() is @@ -208,12 +220,6 @@ def main(stdscr): stdscr.refresh() curses.noecho() - while 1: - event = stdscr.getch() - stdscr.addstr(20,20,str(event)) - curses.beep() - curses.flash() - #curses.echo(); curses.endwin() From 8f8756f9fb88146f18d973f452b4a82cfc9e9306 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Tue, 7 Jun 2016 22:30:09 -0400 Subject: [PATCH 16/39] Fixed - able to print the menu screen --- ICS4U-PCP_GIT/ICS4U-PCP.py | 53 ++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index a0ef543..0a3c12f 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -28,7 +28,7 @@ class Word(object): """ Representation of words """ - def __init__(self, diffc="hard", ptype="coding"): + def __init__(self, diffc, ptype): """ selects a word according to user difficulty :param diffc: str - difficulty selected by user @@ -49,7 +49,6 @@ def __init__(self, diffc="hard", ptype="coding"): min_word_len = 10 max_word_len = 15 - ent = "" test_val = 1 SCR_Y_MAX = 40 @@ -128,43 +127,20 @@ def create_word(screen, word): #stdscr.resize(50, 50) stdscr.border(0) stdscr.refresh() -#choice = my_raw_input(stdscr, 2, 3, "cool or hot?").lower() -#print("CHOICE: " +str(choice)) -#choice = my_raw_input(stdscr, 2, 3, "cool or hot?").lower() #key = KEY_RIGHT # Initializing values new_word = create_work() #win.border(0) - clock = threading.Thread(target=create_word, args=(stdscr,new_word)) clock.daemon = True clock.start() saved ="" -while 1: - global test_val - test_val += 1 - event = stdscr.getch() - if event != 10: - saved += chr(event) - if event == 8: - stdscr.addstr(15,10, 'backspace') - saved = saved[:-2] - stdscr.addstr(10,10, ' ') - stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) - if event == 10: - global ent - ent = saved - saved = "" - stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) - #if event == ord("q"): - if event == 27: - break def mainGameScreen(): STDSCR.clear() STDSCR.refresh() - drawCoor(STDSCR) + drawCoor() menu1 = "P: PLAY" menu2 = "S: USER STATS" @@ -183,8 +159,25 @@ def mainGameScreen(): menu_win.noutrefresh() curses.doupdate() - - + while 1: + global test_val + test_val += 1 + event = stdscr.getch() + if event != 10: + saved += chr(event) + if event == 8: + stdscr.addstr(15,10, 'backspace') + saved = saved[:-2] + stdscr.addstr(10,10, ' ') + stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) + if event == 10: + global ent + ent = saved + saved = "" + stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) + #if event == ord("q"): + if event == 27: + break def main(stdscr): @@ -195,7 +188,7 @@ def main(stdscr): stdscr_x = curses.COLS - 1 global STDSCR STDSCR = stdscr - drawCoor(STDSCR) + drawCoor() mainGameScreen() @@ -218,10 +211,8 @@ def main(stdscr): pad.refresh(0,0, 5,5, 10,10) stdscr.refresh() - curses.noecho() - curses.endwin() curses.wrapper(main) From 766605865a88d07db43d33884ba42d1f3c3809d9 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Wed, 8 Jun 2016 21:50:12 -0400 Subject: [PATCH 17/39] Defined main game screen --- ICS4U-PCP_GIT/ICS4U-PCP.py | 59 +++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 0a3c12f..d220fb3 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -9,7 +9,6 @@ import curses.panel import threading - # ------------------------------------------------------- # Global Varibles # ------------------------------------------------------- @@ -79,17 +78,15 @@ def my_raw_input(stdscr, r, c, prompt_string): return input # ^^^^ reading input at next line def clear_line(y): - """ (int) -> None - """ empty = " " * SCR_X_MAX stdscr.addstr(y, 1, empty) def debug(msg, level): - """ (str, int, int) -> None + """ """ y = SCR_Y_MAX - 10 + level clear_line(y) - #win.addstr(y, 1, 'DEBUG: '+msg) + def create_work(): word_len = 4 @@ -110,7 +107,6 @@ def create_word(screen, word): if word: screen.addstr(12, 12, 'testval:'+str(test_val)) - #Word.move_down(screen, word) screen.refresh() if ent == word[2]: @@ -124,19 +120,62 @@ def create_word(screen, word): curses.noecho() curses.curs_set(0) stdscr.clear() -#stdscr.resize(50, 50) + stdscr.border(0) stdscr.refresh() - -#key = KEY_RIGHT # Initializing values + # Initializing values new_word = create_work() -#win.border(0) clock = threading.Thread(target=create_word, args=(stdscr,new_word)) clock.daemon = True clock.start() saved ="" +def mainGameScreen(): + + while True: + STDSCR.clear() + STDSCR.refresh() + + saved ="" + + y_entered = MAX_Y + x_entered = 10 + + enter_win = curses.newwin(1, 80, y_entered, x_entered) # l, w, y, x + enter_panel = curses.panel.new_panel(enter_win) + enter_panel.top() + + while 1: + event = STDSCR.getch() + + if event != 10 and event !=263: # enter and backspace + # saved += chr(event) + if event == 263: # backspace + saved = saved[:-1] + + enter_win.noutrefresh() + curses.doupdate() + + # enter + if event == 10: + global USER_ENT + USER_ENT = saved + saved = "" + + enter_win.addstr(0,0,saved) + enter_win.noutrefresh() + curses.doupdate() + + if event == 9: #tab to exit + EXIT_GAME = True + + if event == 27: #esc + break + + if EXIT_GAME: + break + def mainGameScreen(): STDSCR.clear() STDSCR.refresh() From 046b801cd7126af9279a0ac5a68ec02d539a7a6e Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Wed, 8 Jun 2016 22:03:30 -0400 Subject: [PATCH 18/39] gamescreen test --- ICS4U-PCP_GIT/ICS4U-PCP.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index d220fb3..36b179a 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -87,7 +87,6 @@ def debug(msg, level): y = SCR_Y_MAX - 10 + level clear_line(y) - def create_work(): word_len = 4 word = "" @@ -126,19 +125,14 @@ def create_word(screen, word): # Initializing values new_word = create_work() -clock = threading.Thread(target=create_word, args=(stdscr,new_word)) -clock.daemon = True -clock.start() saved ="" -def mainGameScreen(): - +def GameScreen(): while True: STDSCR.clear() STDSCR.refresh() saved ="" - y_entered = MAX_Y x_entered = 10 @@ -188,10 +182,10 @@ def mainGameScreen(): menu_win.addstr(1, 1, menu1) menu_win.addstr(2, 1, menu2) menu_win.addstr(3, 1, menu3) + menu_panel = curses.panel.new_panel(menu_win) menu_panel.top();curses.panel.update_panels() menu_win.noutrefresh(); curses.doupdate() - menu_pan = curses.panel.new_panel(menu_win) menu_pan.top() curses.panel.update_panels() @@ -214,23 +208,19 @@ def mainGameScreen(): ent = saved saved = "" stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) - #if event == ord("q"): + if event == 27: break def main(stdscr): - stdscr.border(0) stdscr.refresh() - stdscr_y = curses.LINES - 1 - stdscr_x = curses.COLS - 1 global STDSCR STDSCR = stdscr drawCoor() - - mainGameScreen() - + #mainGameScreen() + GameScreen() pad = curses.newpad(20, 20) pad2 = curses.newpad(20, 20) # These loops fill the pad with letters; addch() is From 859a90ce865d7085fd22f292474c6f328bca28be Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Thu, 9 Jun 2016 23:35:54 -0400 Subject: [PATCH 19/39] game play works but menu doesn't appear --- ICS4U-PCP_GIT/ICS4U-PCP.py | 67 ++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 36b179a..1a072ef 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -23,6 +23,7 @@ PY_WORDS_LEN = 0 STDSCR = "" + class Word(object): """ Representation of words @@ -98,6 +99,7 @@ def create_work(): #debug("new word: "+str(y_x_word), 2) return y_x_word + def create_word(screen, word): while 1: #screen.border(0) @@ -127,7 +129,8 @@ def create_word(screen, word): saved ="" -def GameScreen(): +def GamePlay(): + while True: STDSCR.clear() STDSCR.refresh() @@ -136,19 +139,36 @@ def GameScreen(): y_entered = MAX_Y x_entered = 10 - enter_win = curses.newwin(1, 80, y_entered, x_entered) # l, w, y, x + enter_win = curses.newwin(1, 70, y_entered, x_entered) # l, w, y, x enter_panel = curses.panel.new_panel(enter_win) enter_panel.top() + while True: - while 1: event = STDSCR.getch() + global test_val + test_val += 1 + event = stdscr.getch() + if event != 10: + saved += chr(event) + if event == 8: + stdscr.addstr(15,10, 'backspace') + saved = saved[:-2] + stdscr.addstr(10,10, ' ') + stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) + if event == 10: + global ent + ent = saved + saved = "" + stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) + + if event == 27: + break if event != 10 and event !=263: # enter and backspace # saved += chr(event) if event == 263: # backspace saved = saved[:-1] - - enter_win.noutrefresh() + enter_win.noutrefresh() curses.doupdate() # enter @@ -170,18 +190,20 @@ def GameScreen(): if EXIT_GAME: break -def mainGameScreen(): +def mainScreen(): STDSCR.clear() STDSCR.refresh() drawCoor() - menu1 = "P: PLAY" - menu2 = "S: USER STATS" - menu3 = "X: EXIT" + #Draw menu + menu1 = "[P] PLAY" + menu2 = "[S] USER STATS" + menu3 = "[X] EXIT" menu_win = curses.newwin(11, 30 , 30, 78) menu_win.addstr(1, 1, menu1) - menu_win.addstr(2, 1, menu2) - menu_win.addstr(3, 1, menu3) + menu_win.addstr(3, 1, menu2) + menu_win.addstr(5, 1, menu3) + menu_win.box() menu_panel = curses.panel.new_panel(menu_win) menu_panel.top();curses.panel.update_panels() @@ -192,26 +214,6 @@ def mainGameScreen(): menu_win.noutrefresh() curses.doupdate() - while 1: - global test_val - test_val += 1 - event = stdscr.getch() - if event != 10: - saved += chr(event) - if event == 8: - stdscr.addstr(15,10, 'backspace') - saved = saved[:-2] - stdscr.addstr(10,10, ' ') - stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) - if event == 10: - global ent - ent = saved - saved = "" - stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) - - if event == 27: - break - def main(stdscr): stdscr.border(0) stdscr.refresh() @@ -220,7 +222,8 @@ def main(stdscr): STDSCR = stdscr drawCoor() #mainGameScreen() - GameScreen() + mainScreen() + GamePlay() pad = curses.newpad(20, 20) pad2 = curses.newpad(20, 20) # These loops fill the pad with letters; addch() is From a396da7f79ea8f6f3cd8febf750f16293474dff5 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Fri, 10 Jun 2016 00:01:33 -0400 Subject: [PATCH 20/39] fix class bug --- ICS4U-PCP_GIT/ICS4U-PCP.py | 127 +++++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 56 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 1a072ef..0763bcf 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -7,7 +7,8 @@ from random import randint import time import curses.panel -import threading +#import threading +import sys # ------------------------------------------------------- # Global Varibles @@ -17,37 +18,71 @@ MAX_X = 0 # current screen X REQ_Y = 0 # required screen size Y REQ_X = 0 # required screen size X -ENG_WORDS = [] +ENG_WORDS = ["apple","hi","hello","aaron",""] ENG_WORDS_LEN = 0 PY_WORDS = [] PY_WORDS_LEN = 0 STDSCR = "" - +MIN_WORD_LEN = 0 +MAX_WORD_LEN = 0 +WORD = "" class Word(object): """ Representation of words """ - def __init__(self, diffc, ptype): + def __init__(self, diff, ptype): """ selects a word according to user difficulty :param diffc: str - difficulty selected by user :param ptype: str - game type selected by user - :return: None + :return: str - """ word = "" - # Practice + #add more difficulties if ptype == "prac": - # Easy or medium - if diffc == "easy" or diffc == "medium": - max_word_len = 0 - if diffc == "easy": - min_word_len = 2 - max_word_len = 5 - elif diffc == "medium": - min_word_len = 10 - max_word_len = 15 + if diff == "easy" or diff == "medium": + global MIN_WORD_LEN,MAX_WORD_LEN,WORD + MIN_WORD_LEN = 0 + MAX_WORD_LEN = 3 + for idx in range(len(ENG_WORDS)): + if len(ENG_WORDS[idx]) > MIN_WORD_LEN and len(ENG_WORDS[idx]) <= MAX_WORD_LEN: + Word = ENG_WORDS[idx] + + def move_down(screen, word): + word = WORD + empty = " " * len(word[2]) + screen.addstr(word[0], word[1], empty) + word[0] += 1 + screen.addstr(word[0], word[1], word[2]) + + + def create_word(screen, word): + while 1: + word_len = 4 + word = "" + for ch_num in range(word_len): + ch = chr(randint(ord('a'), ord('z'))) + word += ch + x = randint(0, SCR_X_MAX) + y_x_word = [ 0, x, word ] + #debug("new word: "+str(y_x_word), 2) + return y_x_word + #screen.border(0) + global test_val + global ent + + if word: + screen.addstr(12, 12, 'testval:'+str(test_val)) + screen.refresh() + + if ent == word[2]: + global curses + curses.beep() + word = None + + time.sleep(0.5) ent = "" test_val = 1 @@ -80,7 +115,7 @@ def my_raw_input(stdscr, r, c, prompt_string): def clear_line(y): empty = " " * SCR_X_MAX - stdscr.addstr(y, 1, empty) + STDSCR.addstr(y, 1, empty) def debug(msg, level): """ @@ -88,50 +123,16 @@ def debug(msg, level): y = SCR_Y_MAX - 10 + level clear_line(y) -def create_work(): - word_len = 4 - word = "" - for ch_num in range(word_len): - ch = chr(randint(ord('a'), ord('z'))) - word += ch - x = randint(0, SCR_X_MAX) - y_x_word = [ 0, x, word ] - #debug("new word: "+str(y_x_word), 2) - return y_x_word - - -def create_word(screen, word): - while 1: - #screen.border(0) - global test_val - global ent - - if word: - screen.addstr(12, 12, 'testval:'+str(test_val)) - screen.refresh() - - if ent == word[2]: - global curses - curses.beep() - word = None - word = create_work() - time.sleep(0.5) - -stdscr = curses.initscr() -curses.noecho() -curses.curs_set(0) -stdscr.clear() - -stdscr.border(0) -stdscr.refresh() - # Initializing values -new_word = create_work() + +class_test = Word.create_word # Initializing values +new_word = class_test(STDSCR,ENG_WORDS[randint(0,len(ENG_WORDS)-1)]) saved ="" def GamePlay(): while True: + stdscr = STDSCR STDSCR.clear() STDSCR.refresh() @@ -245,6 +246,20 @@ def main(stdscr): stdscr.refresh() curses.noecho() -curses.endwin() -curses.wrapper(main) +#curses.endwin() + + +def printError(msg): + errMsg_x = 3 + errMsg_y = 1 + STDSCR.addstr(errMsg_y, errMsg_x, "ERROR:" + msg) + STDSCR.refresh() + STDSCR.getch() + curses.endwin() + sys.exit() + +############################################################################### +# START +############################################################################### +curses.wrapper(main) \ No newline at end of file From 1094cd49a70ce6c89650084df7d5ff0cf582b2b4 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Fri, 10 Jun 2016 18:06:53 -0400 Subject: [PATCH 21/39] . --- ICS4U-PCP_GIT/ICS4U-PCP.py | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 0763bcf..a9ab77a 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -84,6 +84,13 @@ def create_word(screen, word): time.sleep(0.5) + def getX(self): + + return self.x + + def getY(self): + + return self.y ent = "" test_val = 1 SCR_Y_MAX = 40 @@ -165,6 +172,12 @@ def GamePlay(): if event == 27: break + + #stats screen + if chr(event) == 's' or 'S': + enter_panel.hide() + userstats() + if event != 10 and event !=263: # enter and backspace # saved += chr(event) if event == 263: # backspace @@ -215,6 +228,21 @@ def mainScreen(): menu_win.noutrefresh() curses.doupdate() + #initialize + main_screen_num = 0 + + while True: + event = STDSCR.getch() + #event_low = event.lowwer() + + if event == 263: + continue + + if chr(event) == "e": + main_screen_num = 0 + break + + def main(stdscr): stdscr.border(0) stdscr.refresh() @@ -248,6 +276,17 @@ def main(stdscr): #curses.endwin() +def userstats(): + stat_win = curses.newwin(30, 10, 10, 15) + stat_win.addstr(5,6,"This is userstats window") + stat_win.box() + score_formatline = [] + + stat_win.addstr(6,6,"user name: ") + stat_win.addstr(7,6,"level#: ") + stat_win.addstr(8,6,"score#: ") + + def printError(msg): errMsg_x = 3 From afb839e5857b54592aa282dd36c120f1e5aa4aa9 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Sat, 11 Jun 2016 18:51:35 -0400 Subject: [PATCH 22/39] main screen and user selection in progress --- ICS4U-PCP_GIT/ICS4U-PCP.py | 245 +++++++++++++++++++++++++++++-------- 1 file changed, 191 insertions(+), 54 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index a9ab77a..d061a34 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -1,3 +1,5 @@ + + # SNAKES GAME # Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting # https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py @@ -13,6 +15,7 @@ # ------------------------------------------------------- # Global Varibles # ------------------------------------------------------- +IS_DEBUG = False MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X @@ -57,7 +60,6 @@ def move_down(screen, word): word[0] += 1 screen.addstr(word[0], word[1], word[2]) - def create_word(screen, word): while 1: word_len = 4 @@ -131,8 +133,8 @@ def debug(msg, level): clear_line(y) -class_test = Word.create_word # Initializing values -new_word = class_test(STDSCR,ENG_WORDS[randint(0,len(ENG_WORDS)-1)]) + # Initializing values + saved ="" @@ -204,77 +206,191 @@ def GamePlay(): if EXIT_GAME: break -def mainScreen(): + +#------------------------------------------------------------------------------ +# main +#------------------------------------------------------------------------------ +def main(stdscr): + #colors + curses.init_pair(1,curses.COLOR_RED,curses.COLOR_BLACK) + curses.init_pair(2,curses.COLOR_GREEN,curses.COLOR_BLACK) + curses.init_pair(3,curses.COLOR_YELLOW,curses.COLOR_BLACK) + curses.init_pair(4,curses.COLOR_WHITE,curses.COLOR_BLACK) + curses.init_pair(5,curses.COLOR_MAGENTA,curses.COLOR_BLACK) + curses.init_pair(6,curses.COLOR_CYAN,curses.COLOR_BLACK) + curses.init_pair(7,curses.COLOR_BLUE,curses.COLOR_BLACK) + + global EXIT_GAME + + # Set up for debug + global STDSCR + STDSCR = stdscr + + # Check the required window size + checkReq() + + # clear and draw coordinates + if IS_DEBUG: + drawCoor() + + #define this after the window's created. + #horizontal line decides whether user missed or not. + global MISS_Y + MISS_Y = MAX_Y - 3 + + while 1: + # re-initialize + EXIT_GAME = False + + # main game screen + rc = mainGameScreen() + + # reset + if rc == 4: + STDSCR.clear(); STDSCR.refresh() + + # exit + if rc == 0: + break + + curses.endwin() + +############################################################################### +# +# Screens +# +############################################################################### + +def mainGameScreen(): + """ + makes the main screen of the game + :return: int - assigned number of the each screen + """ STDSCR.clear() STDSCR.refresh() - drawCoor() + # debug + if IS_DEBUG: + drawCoor() - #Draw menu + # Draw menu menu1 = "[P] PLAY" - menu2 = "[S] USER STATS" + menu2 = "[S] Statistics" menu3 = "[X] EXIT" - menu_win = curses.newwin(11, 30 , 30, 78) - menu_win.addstr(1, 1, menu1) - menu_win.addstr(3, 1, menu2) - menu_win.addstr(5, 1, menu3) - menu_win.box() - + menu_win = curses.newwin(11, len(menu2) + 4 , 30, 78) # h, l, y, x + menu_win.addstr(1, 1, menu1,curses.A_BOLD) + menu_win.addstr(2+3, 1, menu2,curses.A_BOLD) + menu_win.addstr(3+6, 1, menu3,curses.A_BOLD) menu_panel = curses.panel.new_panel(menu_win) menu_panel.top();curses.panel.update_panels() menu_win.noutrefresh(); curses.doupdate() - menu_pan = curses.panel.new_panel(menu_win) - menu_pan.top() - curses.panel.update_panels() - menu_win.noutrefresh() - curses.doupdate() #initialize - main_screen_num = 0 + main_rc = 0 - while True: + while 1: + # Get an input from a user event = STDSCR.getch() - #event_low = event.lowwer() - if event == 263: continue - - if chr(event) == "e": - main_screen_num = 0 + #exit + if chr(event) == 'x': + main_rc = 0 break + #stats screen + elif chr(event) == 's': + #title_panel.hide() + menu_panel.hide() + main_rc = 1 + + #Play + elif chr(event) == 'p': + play1 = "[P] Practice - English words" + play2 = "[C] Coding - Python related words" + play_win = curses.newwin(6, len(play2) + 4, 32, 83) #h,l,y,x + play_win.box() + play_win.addstr(1+1, 1, play1,curses.A_BOLD) + play_win.addstr(2+1, 1, play2,curses.A_BOLD) + play1_panel = curses.panel.new_panel(play_win) + play1_panel.top() + curses.panel.update_panels() + STDSCR.noutrefresh() + curses.doupdate() -def main(stdscr): - stdscr.border(0) - stdscr.refresh() - - global STDSCR - STDSCR = stdscr - drawCoor() - #mainGameScreen() - mainScreen() - GamePlay() - pad = curses.newpad(20, 20) - pad2 = curses.newpad(20, 20) - # These loops fill the pad with letters; addch() is - # explained in the next section - for y in range(0, 19): - for x in range(0, 19): - pad.addch(y,x, ord('a') + (x*x+y*y) % 26) + event = STDSCR.getch() - for y in range(0, 19): - for x in range(0, 19): - pad2.addch(y,x, ord('-')) + while event == 263: + event = STDSCR.getch() + + event_lower = chr(event).lower() + + while event_lower != "p" and event_lower != "c": + event = STDSCR.getch() + event_lower = chr(event).lower() + + ptype = "" + if event_lower == "p": + ptype = "prac" + else: + ptype = "coding" + + while 1: + if ptype == "prac": + play1 = "[E] Easy - words length of 3 - 4" + play2 = "[M] Medium - words length of 5 and more" + play3 = "[H] Hard - random char and symbols" + play4 = "[R] reset" + else: + play1 = "[E] Easy - words length of 3 - 5" + play2 = "[M] Medium - words lenght of 5 - 10" + play3 = "[H] Hard - words length of 5 and more" + play4 = "[R] reset" + + play2_win = curses.newwin(9, len(play2) + 4, 34, 90) + play2_win.box() + play2_win.addstr(1 + 1, 1, play1,curses.A_BOLD) + play2_win.addstr(2 + 1, 1, play2,curses.A_BOLD) + play2_win.addstr(3 + 1, 1, play3,curses.A_BOLD) + play2_win.addstr(4 + 1, 1, play4,curses.A_BOLD) + play2_panel = curses.panel.new_panel(play2_win) + play2_panel.top() + curses.panel.update_panels() + STDSCR.noutrefresh(); curses.doupdate() + + event = STDSCR.getch() + while event == 263: + event = STDSCR.getch() + event_lower = chr(event).lower() + + if event_lower == 'e' or event_lower == 'm' or event_lower == 'h': + + #title_panel.hide() + menu_panel.hide() + play1_panel.hide() + play2_panel.hide() + + # Start the game + if event_lower == 'e': + diffc = "easy" + elif event_lower == 'm': + diffc = "medium" + elif event_lower == 'h': + diffc = "hard" + + main_rc = 1 + break - pad.border(0) - pad2.border(0) + # reset + elif event_lower.lower() == 'r': + main_rc = 4 + break - pad2.refresh(0,0, 15,5, 25,10) - pad.refresh(0,0, 5,5, 10,10) + # stat/startGame(1) or reset(4) -> go to main screen + if main_rc == 1 or main_rc == 4: + break - stdscr.refresh() - curses.noecho() + return main_rc -#curses.endwin() def userstats(): stat_win = curses.newwin(30, 10, 10, 15) @@ -286,19 +402,40 @@ def userstats(): stat_win.addstr(7,6,"level#: ") stat_win.addstr(8,6,"score#: ") +def checkReq(): + """ + checks whether the game screen fits the user screen size + If user screen is smaller than required size, print error message until they + meet the requirments + :return: None + """ + global MAX_Y, MAX_X + MAX_Y = curses.LINES - 1 + MAX_X = curses.COLS - 1 + if MAX_Y < REQ_Y: + printError("Resize your window. " + + "Current: " + str(MAX_X) + " X " + str(MAX_Y) + ". " + "Required: " + str(REQ_X) + " X " + str(REQ_Y) ) def printError(msg): + """ + prints the given error message + on the user screen + :param msg: str - The error message that is given to the function + :return: None + """ errMsg_x = 3 errMsg_y = 1 - STDSCR.addstr(errMsg_y, errMsg_x, "ERROR:" + msg) + STDSCR.addstr(errMsg_y, errMsg_x, "ERROR:" + msg + "\n\n...Terminating...press Enter...") STDSCR.refresh() STDSCR.getch() curses.endwin() + #exit program sys.exit() ############################################################################### # START ############################################################################### -curses.wrapper(main) \ No newline at end of file +curses.wrapper(main) From bc9685b05f65030b514242e6227c00384dab36c8 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Sun, 12 Jun 2016 21:32:32 -0400 Subject: [PATCH 23/39] added title -(colored,blinks) - main screen done --- ICS4U-PCP_GIT/ICS4U-PCP.py | 150 ++++++++++++++++++++++++++++++++----- 1 file changed, 132 insertions(+), 18 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index d061a34..249ce9c 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -1,5 +1,3 @@ - - # SNAKES GAME # Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting # https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py @@ -15,7 +13,10 @@ # ------------------------------------------------------- # Global Varibles # ------------------------------------------------------- -IS_DEBUG = False +IS_DEBUG = True +WORD_START_PAUSE = 0.2 # Initial word speed. Lower is Faster +ENTER_Y_OFFSET = 5 +GO_NEXT = False MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X @@ -131,11 +132,7 @@ def debug(msg, level): """ y = SCR_Y_MAX - 10 + level clear_line(y) - - - # Initializing values - - + # Initializing value saved ="" def GamePlay(): @@ -197,12 +194,6 @@ def GamePlay(): enter_win.noutrefresh() curses.doupdate() - if event == 9: #tab to exit - EXIT_GAME = True - - if event == 27: #esc - break - if EXIT_GAME: break @@ -211,7 +202,11 @@ def GamePlay(): # main #------------------------------------------------------------------------------ def main(stdscr): - #colors + """ + set up for the game to start and runs by calling the main page + :param stdscr: window - standard window screen + :return: None + """ curses.init_pair(1,curses.COLOR_RED,curses.COLOR_BLACK) curses.init_pair(2,curses.COLOR_GREEN,curses.COLOR_BLACK) curses.init_pair(3,curses.COLOR_YELLOW,curses.COLOR_BLACK) @@ -222,6 +217,9 @@ def main(stdscr): global EXIT_GAME + #mouse cursor + curses.curs_set(0) + # Set up for debug global STDSCR STDSCR = stdscr @@ -260,7 +258,9 @@ def main(stdscr): # Screens # ############################################################################### - +#------------------------------------------------------------------------------ +# main Game screen +#------------------------------------------------------------------------------ def mainGameScreen(): """ makes the main screen of the game @@ -272,6 +272,26 @@ def mainGameScreen(): if IS_DEBUG: drawCoor() + # Draw Title + title1 = r'TTTTT\ EEEEE\ X X\ TTTTT\ BBBB\ L\ A SSSSS\ TTTTT\ EEEEE\ RRRR ' + title2 = r'\\T\\\ E\\\\\ X X\ \\T\\\ B\\\B\ L\ A\A S\\\\\ \\T\\\ E\\\\\ R\\\R\ ' + title3 = r' T\ EEEEE\ X\ T\ BBBB\\ L\ AAAAA SSSSS\ T\ EEEEE\ RRRR\\ ' + title4 = r' T\ E\\\\\ X\X T\ B\\\B\ L\ A\ A\ \\\\S\ T\ E\\\\\ R\ R\ ' + title5 = r' T\ EEEEE\ X\ X\ T\ BBBB\\ LLLLL\ A\ A\ SSSSS\ T\ EEEEE\ R\ R\ ' + title6 = r' \\ \\\\\\ \\ \\ \\ \\\\\ \\\\\\ \\ \\ \\\\\\ \\ \\\\\\ \\ \\ ' + + # h l y x + title_win = curses.newwin(9, len(title1)+4, 5, int(MAX_X/2 - len(title1)/2)) + title_win.addstr(0+1, 1+1, title1, curses.color_pair(1)|curses.A_BLINK) + title_win.addstr(1+1, 1+1, title2, curses.color_pair(2)|curses.A_BLINK) + title_win.addstr(2+1, 1+1, title3, curses.color_pair(3)|curses.A_BLINK) + title_win.addstr(3+1, 1+1, title4, curses.color_pair(4)|curses.A_BLINK) + title_win.addstr(4+1, 1+1, title5, curses.color_pair(5)|curses.A_BLINK) + title_win.addstr(5+1, 1+1, title6, curses.color_pair(6)|curses.A_BLINK) + + title_panel = curses.panel.new_panel(title_win) + title_panel.top();curses.panel.update_panels() + # Draw menu menu1 = "[P] PLAY" menu2 = "[S] Statistics" @@ -299,7 +319,7 @@ def mainGameScreen(): #stats screen elif chr(event) == 's': - #title_panel.hide() + title_panel.hide() menu_panel.hide() main_rc = 1 @@ -364,7 +384,7 @@ def mainGameScreen(): if event_lower == 'e' or event_lower == 'm' or event_lower == 'h': - #title_panel.hide() + title_panel.hide() menu_panel.hide() play1_panel.hide() play2_panel.hide() @@ -378,6 +398,7 @@ def mainGameScreen(): diffc = "hard" main_rc = 1 + gameScreen(WORD_START_PAUSE, diffc, ptype) break # reset @@ -391,6 +412,92 @@ def mainGameScreen(): return main_rc +#------------------------------------------------------------------------------ +# game screen +#------------------------------------------------------------------------------ +def gameScreen(pauseSec, diffc, ptype): + """ + makes game screen on the user screen to run the game + :param pauseSec: int - amount of pause seconds + :param diffc: str - difficulty of the game + :param ptype: str - user selected game type + :return: None + """ + while True: + # 1 = every 1 sec, words are falling down + STDSCR.clear() + STDSCR.refresh() + if IS_DEBUG: + drawCoor() + + global EXIT_GAME + #exit whenever i want + saved = "" + + y_entered = MAX_Y - ENTER_Y_OFFSET + x_entered = 10 + enter_win = curses.newwin(1, 80, y_entered, x_entered) # l, w, y, x + enter_panel = curses.panel.new_panel(enter_win) + enter_panel.top() + # Take an input from a user + msg = "" + while 1: + event = STDSCR.getch() + if event == -1: + # EXIT_GAME is True when the life comes 0 + if EXIT_GAME or GO_NEXT: + STDSCR.timeout(-1) + # Go back to main screen + break + + else: + if event != 10 and event != 263: # enter and backspace + saved += chr(event) + + if event == 263: # backspace + saved = saved[:-1] + + msg = " " * len(msg) + enter_win.addstr(0,0,msg) + + msg = "> " + str(saved) + enter_win.addstr(0,0,msg) + enter_win.noutrefresh() + curses.doupdate() + + # enter + if event == 10: + global USER_ENT + USER_ENT = saved + saved = "" + msg = " " * len(msg) + enter_win.addstr(0,0,msg) + enter_win.noutrefresh() + curses.doupdate() + + if event == 9: #tab to exit + STDSCR.timeout(-1) + EXIT_GAME = True + + if event == 27: #esc + #wait for input + STDSCR.timeout(-1) + break + + if GO_NEXT: + STDSCR.addstr(5,20,"****** Completed ********") + pauseSec = pauseSec /2 + + #speed + global NEW_WORD_FREQ + NEW_WORD_FREQ = NEW_WORD_FREQ - 1 + if NEW_WORD_FREQ < 8: + NEW_WORD_FREQ = 8 + + if EXIT_GAME: + break + + def userstats(): stat_win = curses.newwin(30, 10, 10, 15) @@ -402,6 +509,10 @@ def userstats(): stat_win.addstr(7,6,"level#: ") stat_win.addstr(8,6,"score#: ") + +# ------------------------------------------------------------------------------ +# Check requirements +# ------------------------------------------------------------------------------ def checkReq(): """ checks whether the game screen fits the user screen size @@ -418,6 +529,9 @@ def checkReq(): "Required: " + str(REQ_X) + " X " + str(REQ_Y) ) +# ------------------------------------------------------------------------------ +# Print error message +# ------------------------------------------------------------------------------ def printError(msg): """ prints the given error message From d8eb89cd472713ab79fdcf9f54103dd85c4fdeed Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 13 Jun 2016 10:54:32 -0400 Subject: [PATCH 24/39] news article for words --- ICS4U-PCP_GIT/engwords.data | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ICS4U-PCP_GIT/engwords.data diff --git a/ICS4U-PCP_GIT/engwords.data b/ICS4U-PCP_GIT/engwords.data new file mode 100644 index 0000000..1cd0f30 --- /dev/null +++ b/ICS4U-PCP_GIT/engwords.data @@ -0,0 +1,49 @@ +MIAMI — The Toronto Raptors have one game left in the Eastern Conference semifinals — to either make history, or see their season come to an end. + +Kyle Lowry had 36 points, while DeMar DeRozan battled through a thumb injury to add 23, but they got little help from their teammates as the Miami Heat beat Toronto 103-91 to even their NBA Eastern Conference semifinal series at three wins apiece. + +To Raptors coach Dwane Casey, it was a huge opportunity lost. + +"We came here to try to win the game, we didn't come here with a seven-game series in mind," Casey said. "It's been a great series, they're a championship calibre team. . . but we came here to try to win the game. We weren't coming in wanting a Game 7." + +Bismack Biyombo grabbed 13 rebounds for the Raptors, who had just their two all-stars score in double-digits. + +And while Casey has hammered home "defence first" all season long, that message was somehow lost on his team Friday, as the Raptors allowed Goran Dragic to drive to rim at will for 30 points. Dwyane Wade added 22. + +"It is just our one-on-one defence," said DeRozan. "We have to buckle down and not rely on help so much. Everyone has to man up and do their job." + +The Raptors, who are now 1-5 in road closeout chances, were keen to end this series in Miami and avoid another game against the Heat in what's already been their longest post-season in franchise history. Awaiting the winner is a well-rested Cleveland team, which dispatched Detroit in four straight before sweeping Atlanta in the second round. + +But the Heat dominated for most of the night, and when Dragic drilled a three-pointer late in the third quarter, it put Miami up by 13 points. The Heat took an 82-72 advantage into the fourth. + +Lowry scored eight straight points to pull Toronto to within six with 8:45 to play, but the all-star guard also picked up his fifth foul two minutes later, and six quick points from Wade had the Heat back up by 12. Two Lowry free throws had the Raptors within eight before Joe Johnson threw up a three-point dagger with 2:15 to play, essentially spelling the end for Toronto. + +The Raptors find themselves in the same situation as the opening round of the playoffs against Indiana — a must-win Game 7 back home Sunday at the Air Canada Centre. + +"Every series is different but I guess we like to play with our backs against the wall so to speak, I don't know why," Cory Joseph said. + +The Raptors allowed the Heat to shoot 48 per cent, while shooting 42 per cent themselves. + +Lowry and DeRozan, who have struggled mightily at times through the post-season, were solid all night, but the all-stars scoffed at their scoring in a sombre post-game press conference. + +"It means nothing," DeRozan said. "If we score 10 each and everyone else does something, collectively that's fine." + +No-one else did much Friday however; the Raptors bench combined for 15 points. + +Injuries have ravaged both teams. DeRozan spent every timeout having his thumb wrapped in a red shoelace by the team's sport science guru Alex McKechnie. DeMarre Carroll played with his left wrist taped — hidden under a wristband — after injuring it on Wednesday night. + +The Raptors were already without Jonas Valanciunas (ankle) for the series, while the Heat is missing Hassan Whiteside. + +Heat coach Erik Spoelstra talked about the excitement of the back-and-forth series that saw three of the first four games go to overtime, saying "It's an absolute privilege" to be a part of. + +"I've said it again to our guys, to be in a competitive series against an opponent like we're facing right now," Spoelstra said. "It's a darn good opponent that's challenging us, that's testing us, that's pushing us, making us uncomfortable." + +A couple hundred Toronto fans made the trip south hoping to see the Raptors make history. The American Airlines Arena was otherwise a sea of white, including one fan who held up a "We The South" sign. + +The Raptors, who won a franchise-best 56 games in the regular season, are playing in the conference semifinals for just the second time in the team's 21-year history. They made the conference semifinals in 2001 and were a Vince Carter miss away from beating Philadelphia and advancing to the conference final. + +Lowry and DeRozan combined for 13 points in an ugly first quarter. The two teams made just 15-of-41 shots and neither squad led by more than three points. The Heat took a 21-20 lead into the second. + +Josh Richardson drilled a three midway through the second that put the Heat up by nine, and they took a 53-44 advantage into the locker-room at halftime. + +By Lori Ewing, The Canadian Press \ No newline at end of file From 7a554ab3b40efb2918b7b0435a9dc66fd7a8193c Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 13 Jun 2016 11:06:42 -0400 Subject: [PATCH 25/39] added methods --- ICS4U-PCP_GIT/ICS4U-PCP.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 249ce9c..7c20b86 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -54,12 +54,13 @@ def __init__(self, diff, ptype): if len(ENG_WORDS[idx]) > MIN_WORD_LEN and len(ENG_WORDS[idx]) <= MAX_WORD_LEN: Word = ENG_WORDS[idx] - def move_down(screen, word): - word = WORD - empty = " " * len(word[2]) - screen.addstr(word[0], word[1], empty) - word[0] += 1 - screen.addstr(word[0], word[1], word[2]) + def move_down(self,screen, word): + self.panel.move(self.y, self.x) + curses.panel.update_panels(); + self.win.noutrefresh(); curses.doupdate() + self.y += 1 + + def create_word(screen, word): while 1: @@ -94,6 +95,16 @@ def getX(self): def getY(self): return self.y + + def getPanel(self): + return self.panel + + def _eq__(self,other): + return self.word == other.word + + def __str__(self): + return self.word + ent = "" test_val = 1 SCR_Y_MAX = 40 @@ -549,6 +560,8 @@ def printError(msg): sys.exit() + + ############################################################################### # START ############################################################################### From 42de5a0234364d171ddfafd09709c7a117efdf3c Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 13 Jun 2016 11:33:58 -0400 Subject: [PATCH 26/39] added draws --- ICS4U-PCP_GIT/ICS4U-PCP.py | 58 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 7c20b86..623d4fa 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -9,6 +9,8 @@ import curses.panel #import threading import sys +import threading + # ------------------------------------------------------- # Global Varibles @@ -17,6 +19,7 @@ WORD_START_PAUSE = 0.2 # Initial word speed. Lower is Faster ENTER_Y_OFFSET = 5 GO_NEXT = False +is_word_down_thread_stop = False MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X @@ -30,6 +33,7 @@ MIN_WORD_LEN = 0 MAX_WORD_LEN = 0 WORD = "" +word_down_thread = "" class Word(object): """ @@ -105,6 +109,16 @@ def _eq__(self,other): def __str__(self): return self.word + def delWord(self): + self.panel.hide() + # curses.panel.update_panels(); self.win.refresh() not working + curses.panel.update_panels(); STDSCR.refresh() + + # Debug + def display(self): + # y, x + curses.panel.update_panels(); STDSCR.refresh() + ent = "" test_val = 1 SCR_Y_MAX = 40 @@ -207,8 +221,6 @@ def GamePlay(): if EXIT_GAME: break - - #------------------------------------------------------------------------------ # main #------------------------------------------------------------------------------ @@ -315,6 +327,8 @@ def mainGameScreen(): menu_panel.top();curses.panel.update_panels() menu_win.noutrefresh(); curses.doupdate() + + #initialize main_rc = 0 @@ -560,6 +574,46 @@ def printError(msg): sys.exit() +############################################################################### +# +# Draws +# +############################################################################### +def drawLife(lose): + global EXIT_NOW + + life_win = curses.newwin(MAX_Y-3 ,3, 3, 3) + + if 1 * lose > MAX_Y-3: + EXIT_NOW =True + for y in range(1 * lose, MAX_Y-3): + life_win.addch(y, 1, ord('=')) + life_win.box() + + life_pan = curses.panel.new_panel(life_win) + life_pan.top(); + curses.panel.update_panels(); + life_win.noutrefresh();curses.doupdate() + + return life_pan + +def drawCombo(combo = 0, score = 0): + # Create a combo window/panel + l = 3 + w = 40 + #if LAST_COMBO != "": + # LAST_COMBO.hide() + combo_win = curses.newwin(l, w,3,60) + combo_win.addstr(1,2, "COMBO: " + str(combo) + " ( +"+ str(score) + ")") + combo_win.box() + combo_pan = curses.panel.new_panel(combo_win) + combo_pan.top() + curses.panel.update_panels(); + combo_win.noutrefresh();curses.doupdate() + return combo_pan + + + ############################################################################### From 7b4ef3bd1f7bb8c8f8edc43d0a420656612b2ea5 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Mon, 13 Jun 2016 19:57:24 -0400 Subject: [PATCH 27/39] added methods and python, engwords data files --- ICS4U-PCP_GIT/ICS4U-PCP.py | 139 +- ICS4U-PCP_GIT/python.dat | 7991 ++++++++++++++++++++++++++++++++++++ ICS4U-PCP_GIT/words.dat | 1000 +++++ 3 files changed, 9093 insertions(+), 37 deletions(-) create mode 100755 ICS4U-PCP_GIT/python.dat create mode 100755 ICS4U-PCP_GIT/words.dat diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 623d4fa..0604943 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -1,17 +1,10 @@ -# SNAKES GAME -# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting -# https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py - -#below code needs to be fixed -#from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN from random import randint -import time import curses.panel -#import threading +import time + import sys import threading - # ------------------------------------------------------- # Global Varibles # ------------------------------------------------------- @@ -20,11 +13,15 @@ ENTER_Y_OFFSET = 5 GO_NEXT = False is_word_down_thread_stop = False +ENG_FILE = "words.dat" +PY_FILE = "python.dat" MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X -REQ_Y = 0 # required screen size Y -REQ_X = 0 # required screen size X +REQ_Y = 55/2 # required screen size Y +REQ_X = 200/2 # required screen size X +DEBUG_CURR_Y = 50 +DEBUG_CURR_X = 3 ENG_WORDS = ["apple","hi","hello","aaron",""] ENG_WORDS_LEN = 0 PY_WORDS = [] @@ -34,6 +31,7 @@ MAX_WORD_LEN = 0 WORD = "" word_down_thread = "" +is_demo = False class Word(object): """ @@ -64,9 +62,7 @@ def move_down(self,screen, word): self.win.noutrefresh(); curses.doupdate() self.y += 1 - - - def create_word(screen, word): + def create_word(screen, word): while 1: word_len = 4 word = "" @@ -93,11 +89,9 @@ def create_word(screen, word): time.sleep(0.5) def getX(self): - return self.x def getY(self): - return self.y def getPanel(self): @@ -111,7 +105,6 @@ def __str__(self): def delWord(self): self.panel.hide() - # curses.panel.update_panels(); self.win.refresh() not working curses.panel.update_panels(); STDSCR.refresh() # Debug @@ -125,7 +118,6 @@ def display(self): SCR_X_MAX = 60 def drawCoor(): - STDSCR.clear() STDSCR.border(0) STDSCR.refresh() @@ -153,16 +145,22 @@ def clear_line(y): STDSCR.addstr(y, 1, empty) def debug(msg, level): - """ - """ y = SCR_Y_MAX - 10 + level clear_line(y) # Initializing value saved ="" +def my_raw_input(r, c, prompt_string): + curses.echo() + STDSCR.addstr(r, c, prompt_string) + STDSCR.refresh() + input = STDSCR.getstr(r + 1, c, 20) + return input # + def GamePlay(): while True: + my_raw_input(3,10,"test") stdscr = STDSCR STDSCR.clear() STDSCR.refresh() @@ -291,17 +289,22 @@ def mainGameScreen(): """ STDSCR.clear() STDSCR.refresh() + + global word_down_thread, is_word_down_thread_stop + global EXIT_NOW + is_word_down_thread_stop = False + word_down_thread = threading.Thread(target=start_fall_word, args=[False]) # debug if IS_DEBUG: drawCoor() # Draw Title - title1 = r'TTTTT\ EEEEE\ X X\ TTTTT\ BBBB\ L\ A SSSSS\ TTTTT\ EEEEE\ RRRR ' - title2 = r'\\T\\\ E\\\\\ X X\ \\T\\\ B\\\B\ L\ A\A S\\\\\ \\T\\\ E\\\\\ R\\\R\ ' - title3 = r' T\ EEEEE\ X\ T\ BBBB\\ L\ AAAAA SSSSS\ T\ EEEEE\ RRRR\\ ' - title4 = r' T\ E\\\\\ X\X T\ B\\\B\ L\ A\ A\ \\\\S\ T\ E\\\\\ R\ R\ ' - title5 = r' T\ EEEEE\ X\ X\ T\ BBBB\\ LLLLL\ A\ A\ SSSSS\ T\ EEEEE\ R\ R\ ' - title6 = r' \\ \\\\\\ \\ \\ \\ \\\\\ \\\\\\ \\ \\ \\\\\\ \\ \\\\\\ \\ \\ ' + title1 = r'TTTTTT\ EEEEE\ X X\ TTTTT\ BBBB\ L\ A SSSSS\ TTTTT\ EEEEE\ RRRR ' + title2 = r'\\T\\\ E\\\\\ X X\ \\T\\\ B\\\B\ L\ A\A S\\\\\ \\T\\\ E\\\\\ R\\\R\ ' + title3 = r' T\ EEEEE\ X\ T\ BBBB\\ L\ AAAAA SSSSS\ T\ EEEEE\ RRRR\\ ' + title4 = r' T\ E\\\\\ X\X T\ B\\\B\ L\ A\ A\ \\\\S\ T\ E\\\\\ R\ R\ ' + title5 = r' T\ EEEEE\ X\ X\ T\ BBBB\\ LLLLL\ A\ A\ SSSSS\ T\ EEEEE\ R\ R\ ' + title6 = r' \\ \\\\\\ \\ \\ \\ \\\\\ \\\\\\ \\ \\ \\\\\\ \\ \\\\\\ \\ \\ ' # h l y x title_win = curses.newwin(9, len(title1)+4, 5, int(MAX_X/2 - len(title1)/2)) @@ -327,8 +330,6 @@ def mainGameScreen(): menu_panel.top();curses.panel.update_panels() menu_win.noutrefresh(); curses.doupdate() - - #initialize main_rc = 0 @@ -385,6 +386,7 @@ def mainGameScreen(): play2 = "[M] Medium - words length of 5 and more" play3 = "[H] Hard - random char and symbols" play4 = "[R] reset" + else: play1 = "[E] Easy - words length of 3 - 5" play2 = "[M] Medium - words lenght of 5 - 10" @@ -522,8 +524,6 @@ def gameScreen(pauseSec, diffc, ptype): if EXIT_GAME: break - - def userstats(): stat_win = curses.newwin(30, 10, 10, 15) stat_win.addstr(5,6,"This is userstats window") @@ -535,6 +535,78 @@ def userstats(): stat_win.addstr(8,6,"score#: ") +def start_fall_word(is_demo): + count_worddown = 0 + word_wordObj = {} + + comboTimerCount = 1 + showCombo = False + + # Create a combo window/panel + combo_win = curses.newwin(10,10,5,5) + combo_pan = curses.panel.new_panel(combo_win) + combo_pan.hide() + + # + new_word_interval = 0 + combo_count = 0 + lastSaved = "" + lose_count = 0 + score_count = 0 + + dummyCombo = "" + # Score + if not is_demo: + dummyScore = 0 + dummy = drawLife(lose_count) + + while not is_word_down_thread_stop: + # + # Words falling down + if new_word_interval % NEW_WORD_FREQ == 0: + wordObj = Word() + word_wordObj[wordObj.word] = wordObj + new_word_interval = 0 + + # move down each words + words = word_wordObj.copy() + for word in words: + wordObj = word_wordObj[word] + + # Y boundary + if wordObj.getY() >= MAX_Y-3: + del word_wordObj[word] + wordObj.delWord() + lose_count += 1 + if not is_demo: + dummy = drawLife(lose_count) + + else: + wordObj.moveDown() + new_word_interval += 1 + count_worddown = 0 + + if not is_demo: + # Check what a user types + if lastSaved != ent: + if word_wordObj.get(ent): + combo_count += 1 + score_count += 10 + word_wordObj[ent].remove_same(ent) + del word_wordObj[ent] + + # show combo and score + each_score = 300 + bonus = 13 * (combo_count) + cu_score = 300 * score_count + bonus + + showCombo = True + # Miss! + else: + combo_count = 0 + + lastSaved = ent + # ------------------------------------------------------------------------------ # Check requirements # ------------------------------------------------------------------------------ @@ -553,7 +625,6 @@ def checkReq(): "Current: " + str(MAX_X) + " X " + str(MAX_Y) + ". " "Required: " + str(REQ_X) + " X " + str(REQ_Y) ) - # ------------------------------------------------------------------------------ # Print error message # ------------------------------------------------------------------------------ @@ -573,7 +644,6 @@ def printError(msg): #exit program sys.exit() - ############################################################################### # # Draws @@ -594,7 +664,6 @@ def drawLife(lose): life_pan.top(); curses.panel.update_panels(); life_win.noutrefresh();curses.doupdate() - return life_pan def drawCombo(combo = 0, score = 0): @@ -612,10 +681,6 @@ def drawCombo(combo = 0, score = 0): combo_win.noutrefresh();curses.doupdate() return combo_pan - - - - ############################################################################### # START ############################################################################### diff --git a/ICS4U-PCP_GIT/python.dat b/ICS4U-PCP_GIT/python.dat new file mode 100755 index 0000000..7ea0ed4 --- /dev/null +++ b/ICS4U-PCP_GIT/python.dat @@ -0,0 +1,7991 @@ +A-LAW +ABC +ABCMeta +ACTIONS +ADPCM +AF_CAN +AF_INET +AF_INET6 +AF_LINK +AF_RDS +AF_UNIX +AIFF +AIFF-C +ALERT_DESCRIPTION_HANDSHAKE_FAILURE +ALERT_DESCRIPTION_INTERNAL_ERROR +ALT_DIGITS +ALWAYS_TYPED_ACTIONS +AMPER +AMPEREQUAL +ANY +API +APPDATA +ASCII +AST +ASYNC +AS_IS +AT +ATEQUAL +AUDIODEV +AUDIO_FILE_ENCODING_ADPCM_G721 +AUDIO_FILE_ENCODING_ADPCM_G722 +AUDIO_FILE_ENCODING_ADPCM_G723_3 +AUDIO_FILE_ENCODING_ADPCM_G723_5 +AUDIO_FILE_ENCODING_ALAW_8 +AUDIO_FILE_ENCODING_DOUBLE +AUDIO_FILE_ENCODING_FLOAT +AUDIO_FILE_ENCODING_LINEAR_16 +AUDIO_FILE_ENCODING_LINEAR_24 +AUDIO_FILE_ENCODING_LINEAR_32 +AUDIO_FILE_ENCODING_LINEAR_8 +AUDIO_FILE_ENCODING_MULAW_8 +AUDIO_FILE_MAGIC +AWAIT +AbstractBasicAuthHandler +AbstractDigestAuthHandler +AbstractEventLoopPolicy +AbstractFormatter +AbstractSet +AbstractWriter +Action +AddPackagePath() +Address +AddressHeader +AddressValueError +Any +ArgumentDefaultsHelpFormatter +ArgumentError +ArgumentParser +ArithmeticError +Array +Array() +AssertionError +AsyncIterable +AsyncIterator +AsyncResult +AttlistDeclHandler() +AttributeError +AttributesImpl +AttributesNSImpl +Audio +AuthenticationError +Awaitable +BDADDR_ANY +BDADDR_LOCAL +BDFL +BEFORE_ASYNC_WITH +BINARY_ADD +BINARY_AND +BINARY_FLOOR_DIVIDE +BINARY_LSHIFT +BINARY_MATRIX_MULTIPLY +BINARY_MODULO +BINARY_MULTIPLY +BINARY_OR +BINARY_POWER +BINARY_RSHIFT +BINARY_SUBSCR +BINARY_SUBTRACT +BINARY_TRUE_DIVIDE +BINARY_XOR +BNF +BOM +BOM_BE +BOM_LE +BOM_UTF16 +BOM_UTF16_BE +BOM_UTF16_LE +BOM_UTF32 +BOM_UTF32_BE +BOM_UTF32_LE +BOM_UTF8 +BOOLEAN_STATES +BREAK_LOOP +BROWSER +BUILD_LIST +BUILD_MAP +BUILD_SET +BUILD_SLICE +BUILD_TUPLE +BYTECODE_SUFFIXES +BZ2Compressor +BZ2Decompressor +BZ2File +Babyl +BabylMessage +BadStatusLine +BadZipFile +BadZipfile +Balloon +Barrier +Barrier() +BaseCGIHandler +BaseCookie +BaseEventLoop +BaseException +BaseHTTPRequestHandler +BaseHandler +BaseHeader +BaseManager +BaseProxy +BaseRequestHandler +BaseRotatingHandler +BaseSelector +BaseServer +BaseSubprocessTransport +BaseTransport +BasicContext +BasicInterpolation +Bdb +BdbQuit +Beep() +Benchmarking +BigEndianStructure +Binary +BlockingIOError +Boolean +BoundArguments +BoundaryError +BoundedSemaphore +BoundedSemaphore() +Breakpoint +BrokenBarrierError +BrokenPipeError +BrokenProcessPool +BsdDbShelf +BufferError +BufferTooShort +BufferedIOBase +BufferedRWPair +BufferedRandom +BufferedReader +BufferedWriter +BufferingHandler +BuiltinFunctionType +BuiltinImporter +BuiltinMethodType +ButtonBox +ByteString +Bytecode +Bytecode.codeobj +Bytecode.first_line +BytesFeedParser +BytesGenerator +BytesIO +BytesParser +BytesWarning +C-contiguous +CAB +CALL_FUNCTION +CALL_FUNCTION_KW +CALL_FUNCTION_VAR +CALL_FUNCTION_VAR_KW +CAN_BCM +CAN_RAW_FD_FRAMES +CC +CCompiler +CDLL +CERT_NONE +CERT_OPTIONAL +CERT_REQUIRED +CFLAGS +CFUNCTYPE() +CGI +CGIHTTPRequestHandler +CGIHandler +CGIXMLRPCRequestHandler +CHANNEL_BINDING_TYPES +CHAR_MAX +CIRCUMFLEX +CIRCUMFLEXEQUAL +CLD_CONTINUED +CLD_DUMPED +CLD_EXITED +CLD_TRAPPED +CLOCK_HIGHRES +CLOCK_MONOTONIC +CLOCK_MONOTONIC_RAW +CLOCK_PROCESS_CPUTIME_ID +CLOCK_REALTIME +CLOCK_THREAD_CPUTIME_ID +CMSG_LEN() +CMSG_SPACE() +CODESET +COLON +COLS +COLUMNS +COMMA +COMMENT +COMPARE_OP +COMPARISON_FLAGS +COMSPEC +CONTINUE_LOOP +CO_FUTURE_DIVISION +CPP +CPPFLAGS +CPU +CPython +CRC +CREATE_NEW_CONSOLE +CREATE_NEW_PROCESS_GROUP +CRNCYSTR +CTRL_BREAK_EVENT +CTRL_C_EVENT +C_BUILTIN +C_EXTENSION +CacheFTPHandler +Calendar +Callable +CallableProxyType +CalledProcessError +CancelledError +CannotSendHeader +CannotSendRequest +Capsule +CertificateError +ChainMap +CharacterDataHandler() +Charset +Check +CheckList +ChildProcessError +Chunk +Clamped +Class +Clear +ClearData() +Client() +Close() +CloseKey() +Cmd +CodeType +CodecInfo +Codecs +ComboBox +Combobox +Command +CommandCompiler +Comment() +CommentHandler() +Commit() +Common +Compat32 +Compile +CompletedProcess +Complex +CompressionError +Condition +Condition() +Conditional +ConfigParser +ConnectRegistry() +Connection +ConnectionAbortedError +ConnectionError +ConnectionRefusedError +ConnectionResetError +Consortium +Container +ContentDispositionHeader +ContentHandler +ContentManager +ContentTooShortError +ContentTransferEncoding +ContentTypeHeader +Context +ContextDecorator +Control +ConversionError +Cookie +CookieError +CookieJar +CookiePolicy +Coordinated +Copy +Copyright +Coroutine +CoroutineType +Counter +CoverageResults +CreateKey() +CreateKeyEx() +CreateRecord() +Created +CurrentByteIndex +CurrentColumnNumber +CurrentLineNumber +Cursor +Cut +Cyclic +DEBUG +DEBUG_BYTECODE_SUFFIXES +DEBUG_COLLECTABLE +DEBUG_LEAK +DEBUG_SAVEALL +DEBUG_STATS +DEBUG_UNCOLLECTABLE +DEDENT +DEFAULT +DEFAULT_BUFFER_SIZE +DEFAULT_FORMAT +DEFAULT_IGNORES +DEFAULT_PROTOCOL +DELETE_ATTR +DELETE_DEREF +DELETE_FAST +DELETE_GLOBAL +DELETE_NAME +DELETE_SUBSCR +DER_cert_to_PEM_cert() +DES +DEVNULL +DISTUTILS_DEBUG +DOMEventStream +DOMException +DONT_ACCEPT_BLANKLINE +DONT_ACCEPT_TRUE_FOR_1 +DOT +DOTALL +DOUBLESLASH +DOUBLESLASHEQUAL +DOUBLESTAR +DOUBLESTAREQUAL +DTDHandler +DUP_TOP +DUP_TOP_TWO +D_FMT +D_T_FMT +Data +DataHandler +DatagramHandler +DatagramProtocol +DatagramRequestHandler +DateHeader +DateTime +Daylight +DbfilenameShelf +DebugRunner +DebuggingServer +Decimal +DecimalException +DecodedGenerator +DefaultContext +DefaultCookiePolicy +DefaultHandler() +DefaultHandlerExpand() +DefaultSelector +DefragResult +DefragResultBytes +DeleteKey() +DeleteKeyEx() +DeleteValue() +DeprecationWarning +Detach() +Development +DevpollSelector +Dialect +Dialog +Dict +DictReader +DictWriter +Differ +DirEntry +DirList +DirSelectBox +DirSelectDialog +DirTree +Directory +DisableReflectionKey() +Distribution +DivisionByZero +DllCanUnloadNow() +DllGetClassObject() +DocCGIXMLRPCRequestHandler +DocFileSuite() +DocTest +DocTestFailure +DocTestFinder +DocTestParser +DocTestRunner +DocTestSuite() +DocXMLRPCRequestHandler +DocXMLRPCServer +Documentation +DomainLiberal +DomainRFC2965Match +DomainStrict +DomainStrictNoDots +DomainStrictNonDomain +DomstringSizeErr +DumbWriter +DuplicateOptionError +DuplicateSectionError +DynamicClassAttribute() +E2BIG +EACCES +EADDRINUSE +EADDRNOTAVAIL +EADV +EAFNOSUPPORT +EAFP +EAGAIN +EALREADY +EBADE +EBADF +EBADFD +EBADMSG +EBADR +EBADRQC +EBADSLT +EBFONT +EBUSY +ECHILD +ECHRNG +ECOMM +ECONNABORTED +ECONNREFUSED +ECONNRESET +EDEADLK +EDEADLOCK +EDESTADDRREQ +EDOM +EDOTDOT +EDQUOT +EEXIST +EFAULT +EFBIG +EHOSTDOWN +EHOSTUNREACH +EIDRM +EILSEQ +EINPROGRESS +EINTR +EINVAL +EIO +EISCONN +EISDIR +EISNAM +EL2HLT +EL2NSYNC +EL3HLT +EL3RST +ELIBACC +ELIBBAD +ELIBEXEC +ELIBMAX +ELIBSCN +ELLIPSIS +ELNRNG +ELOOP +EMFILE +EMLINK +EMPTY_NAMESPACE +EMSGSIZE +EMULTIHOP +ENABLE_USER_SITE +ENAMETOOLONG +ENAVAIL +ENCODING +ENDMARKER +END_FINALLY +ENETDOWN +ENETRESET +ENETUNREACH +ENFILE +ENOANO +ENOBUFS +ENOCSI +ENODATA +ENODEV +ENOENT +ENOEXEC +ENOLCK +ENOLINK +ENOMEM +ENOMSG +ENONET +ENOPKG +ENOPROTOOPT +ENOSPC +ENOSR +ENOSTR +ENOSYS +ENOTBLK +ENOTCONN +ENOTDIR +ENOTEMPTY +ENOTNAM +ENOTSOCK +ENOTTY +ENOTUNIQ +ENXIO +EOFError +EOPNOTSUPP +EOVERFLOW +EPERM +EPFNOSUPPORT +EPIPE +EPROTO +EPROTONOSUPPORT +EPROTOTYPE +EQEQUAL +EQUAL +ERA +ERANGE +ERA_D_FMT +ERA_D_T_FMT +ERA_T_FMT +EREMCHG +EREMOTE +EREMOTEIO +ERESTART +EROFS +ERR +ERRORTOKEN +ESHUTDOWN +ESOCKTNOSUPPORT +ESPIPE +ESRCH +ESRMNT +ESTALE +ESTRPIPE +ETIME +ETIMEDOUT +ETOOMANYREFS +ETXTBSY +EUCLEAN +EUNATCH +EUSERS +EWOULDBLOCK +EXCEPTION +EXDEV +EXEC_PREFIX +EXFULL +EXTENDED_ARG +EXTENSION_SUFFIXES +EX_CANTCREAT +EX_CONFIG +EX_DATAERR +EX_IOERR +EX_NOHOST +EX_NOINPUT +EX_NOPERM +EX_NOTFOUND +EX_NOUSER +EX_OK +EX_OSERR +EX_OSFILE +EX_PROTOCOL +EX_SOFTWARE +EX_TEMPFAIL +EX_UNAVAILABLE +EX_USAGE +Editor +Element +ElementDeclHandler() +ElementTree +Ellinghouse +Ellipsis +EmailMessage +EmailPolicy +Empty +EnableReflectionKey() +EncodedFile() +EndCdataSectionHandler() +EndDoctypeDeclHandler() +EndElementHandler() +EndNamespaceDeclHandler() +Enhancement +Enter +EntityDeclHandler() +EntityResolver +Enum +EnumKey() +EnumValue() +EnvBuilder +Environment +EnvironmentError +EnvironmentVarGuard +Environments +EpollSelector +Error +ErrorByteIndex +ErrorCode +ErrorColumnNumber +ErrorHandler +ErrorLineNumber +ErrorString() +Errors +Etiny() +Etop() +Event +Event() +ExFileSelectBox +Example +Exception +Executable +Execute() +ExecutionLoader +Executor +ExitStack +ExpandEnvironmentStrings() +Expat +ExpatError +ExtendedContext +ExtendedInterpolation +Extension +ExtensionFileLoader +External +ExternalClashError +ExternalEntityParserCreate() +ExternalEntityRefHandler() +ExtractError +FAIL_FAST +FCICreate() +FILE_ATTRIBUTE_ARCHIVE +FILE_ATTRIBUTE_COMPRESSED +FILE_ATTRIBUTE_DEVICE +FILE_ATTRIBUTE_DIRECTORY +FILE_ATTRIBUTE_ENCRYPTED +FILE_ATTRIBUTE_HIDDEN +FILE_ATTRIBUTE_INTEGRITY_STREAM +FILE_ATTRIBUTE_NORMAL +FILE_ATTRIBUTE_NOT_CONTENT_INDEXED +FILE_ATTRIBUTE_NO_SCRUB_DATA +FILE_ATTRIBUTE_OFFLINE +FILE_ATTRIBUTE_READONLY +FILE_ATTRIBUTE_REPARSE_POINT +FILE_ATTRIBUTE_SPARSE_FILE +FILE_ATTRIBUTE_SYSTEM +FILE_ATTRIBUTE_TEMPORARY +FILE_ATTRIBUTE_VIRTUAL +FILTER_DIR +FMT_BINARY +FMT_XML +FOR_ITER +FTP +FTPHandler +FTP_TLS +F_LOCK +F_OK +F_TEST +F_TLOCK +F_ULOCK +False +FancyGetopt +FancyURLopener +Fault +Feature +FeedParser +Fetch() +File +FileCookieJar +FileEntry +FileExistsError +FileFinder +FileHandler +FileIO +FileInput +FileLoader +FileNotFoundError +FileSelectBox +FileType +FileWrapper +Files +Filter +Finder +FloatOperation +FloatingPointError +FlushKey() +ForkingMixIn +ForkingTCPServer +ForkingUDPServer +Form +Format +FormatError +FormatError() +Formatter +Fortran +Found +Foundation +Foundation. +Fraction +Frame +FrameSummary +FrameType +FrozenImporter +Full +Function +FunctionTestCase +FunctionType +Future +FutureWarning +G.722 +GET_AITER +GET_ANEXT +GET_AWAITABLE +GET_ITER +GET_YIELD_FROM_ITER +GIL +GNOME +GNU_FORMAT +GREATER +GREATEREQUAL +GUI +Gateway +Generator +GeneratorExit +GeneratorType +Generic +Geoff +GetBase() +GetColumnInfo() +GetFieldCount() +GetInputContext() +GetInteger() +GetLastError() +GetPassWarning +GetProperty() +GetPropertyCount() +GetSetDescriptorType +GetString() +GetSummaryInformation() +GetoptError +Go +Graphical +Greenwich +Group +GzipFile +HAS_ALPN +HAS_ECDH +HAS_NPN +HAS_SNI +HAVE_ARGUMENT +HAVE_THREADS +HCI_DATA_DIR +HCI_FILTER +HCI_TIME_STAMP +HIGHEST_PROTOCOL +HKEY_CLASSES_ROOT +HKEY_CURRENT_CONFIG +HKEY_CURRENT_USER +HKEY_DYN_DATA +HKEY_LOCAL_MACHINE +HKEY_PERFORMANCE_DATA +HKEY_USERS +HList +HOME +HOMEDRIVE +HOMEPATH +HRESULT +HTML +HTMLCalendar +HTMLParser +HTTP +HTTPBasicAuthHandler +HTTPConnection +HTTPCookieProcessor +HTTPDefaultErrorHandler +HTTPDigestAuthHandler +HTTPError +HTTPErrorProcessor +HTTPException +HTTPHandler +HTTPPasswordMgr +HTTPPasswordMgrWithDefaultRealm +HTTPPasswordMgrWithPriorAuth +HTTPRedirectHandler +HTTPResponse +HTTPSConnection +HTTPSHandler +HTTPS_PORT +HTTPServer +HTTPStatus +HTTP_PORT +Handle +Hashable +Header +HeaderError +HeaderParseError +HeaderRegistry +Headers +HierarchyRequestErr +HtmlDiff +I/O +IDLE +IDLESTARTUP +IEEE-754 +IGNORECASE +IGNORE_EXCEPTION_DETAIL +IISCGIHandler +IMAP4 +IMAP4.abort +IMAP4.error +IMAP4.readonly +IMAP4_SSL +IMAP4_stream +IMPORT_FROM +IMPORT_NAME +IMPORT_STAR +INDENT +INPLACE_ADD +INPLACE_AND +INPLACE_FLOOR_DIVIDE +INPLACE_LSHIFT +INPLACE_MATRIX_MULTIPLY +INPLACE_MODULO +INPLACE_MULTIPLY +INPLACE_OR +INPLACE_POWER +INPLACE_RSHIFT +INPLACE_SUBTRACT +INPLACE_TRUE_DIVIDE +INPLACE_XOR +IOBase +IOError +IPv4Address +IPv4Interface +IPv4Network +IPv6Address +IPv6Interface +IPv6Network +ISEOF() +ISNONTERMINAL() +ISTERMINAL() +IS_CHARACTER_JUNK() +IS_LINE_JUNK() +ITIMER_PROF +ITIMER_REAL +ITIMER_VIRTUAL +ImpImporter +ImpLoader +ImportError +ImportWarning +ImproperConnectionState +Incomplete +IncompleteRead +IncompleteReadError +IncrementalDecoder +IncrementalEncoder +IncrementalNewlineDecoder +IncrementalParser +IndentationError +Index +IndexError +IndexSizeErr +Inexact +Infinity +InputOnly +InputSource +InspectLoader +Instruction +Instruction.arg +Instruction.argrepr +Instruction.argval +Instruction.is_jump_target +Instruction.offset +Instruction.opcode +Instruction.opname +Instruction.starts_line +Int2AP() +IntEnum +Integral +Integrated +Intel/DVI +InteractiveConsole +InteractiveInterpreter +Interchange +Interface +Internaldate2tuple() +Internet +InterpolationDepthError +InterpolationError +InterpolationMissingOptionError +InterpolationSyntaxError +InterruptedError +InuseAttributeErr +InvalidAccessErr +InvalidCharacterErr +InvalidModificationErr +InvalidOperation +InvalidStateErr +InvalidStateError +InvalidURL +IsADirectoryError +ItemsView +Iterable +Iterator +ItimerError +JSONDecodeError +JSONDecoder +JSONEncoder +JUMP_ABSOLUTE +JUMP_FORWARD +JUMP_IF_FALSE_OR_POP +JUMP_IF_TRUE_OR_POP +Jack +Jansen +Java +JoinableQueue +KDEDIR +KEY_ALL_ACCESS +KEY_CREATE_LINK +KEY_CREATE_SUB_KEY +KEY_ENUMERATE_SUB_KEYS +KEY_EXECUTE +KEY_NOTIFY +KEY_QUERY_VALUE +KEY_READ +KEY_SET_VALUE +KEY_WOW64_32KEY +KEY_WOW64_64KEY +KEY_WRITE +KeyError +KeyboardInterrupt +KeysView +KqueueSelector +LANG +LANGUAGE +LBRACE +LBYL +LC_ALL +LC_COLLATE +LC_CTYPE +LC_MESSAGES +LC_MONETARY +LC_NUMERIC +LC_TIME +LDCXXSHARED +LDFLAGS +LEFTSHIFT +LEFTSHIFTEQUAL +LESS +LESSEQUAL +LINES +LIST_APPEND +LK_LOCK +LK_NBLCK +LK_NBRLCK +LK_RLCK +LK_UNLCK +LMTP +LNAME +LOAD_ATTR +LOAD_BUILD_CLASS +LOAD_CLASSDEREF +LOAD_CLOSURE +LOAD_CONST +LOAD_DEREF +LOAD_FAST +LOAD_GLOBAL +LOAD_NAME +LOCALE +LOGNAME +LONG_MAX +LPAR +LSQB +LWPCookieJar +LZMACompressor +LZMADecompressor +LZMAError +LZMAFile +LabelEntry +LabelFrame +LambdaType +Lance +LargeZipFile +Last +Layer +LazyLoader +LibraryLoader +LifoQueue +LineTooLong +List +ListNoteBook +Listener +LittleEndianStructure +LoadError +LoadKey() +LoadLibrary() +Loader +LocaleHTMLCalendar +LocaleTextCalendar +Locator +Lock +Lock() +LockType +LogRecord +Logger +LoggerAdapter +LookupError +MAGIC_NUMBER +MAKE_CLOSURE +MAKE_FUNCTION +MAP_ADD +MAXYEAR +MAX_EMAX +MAX_INTERPOLATION_DEPTH +MAX_PREC +MB_ICONASTERISK +MB_ICONEXCLAMATION +MB_ICONHAND +MB_ICONQUESTION +MB_OK +MD5 +METHOD_CRYPT +METHOD_MD5 +METHOD_SHA256 +METHOD_SHA512 +METH_CLASS +METH_COEXIST +METH_KEYWORDS +METH_NOARGS +METH_O +METH_STATIC +METH_VARARGS +MH +MHMessage +MIME +MIMEApplication +MIMEAudio +MIMEBase +MIMEImage +MIMEMessage +MIMEMultipart +MIMENonMultipart +MIMEPart +MIMEText +MIMEVersionHeader +MINEQUAL +MINUS +MINYEAR +MIN_EMIN +MIN_ETINY +MIXERDEV +MMDF +MMDFMessage +MRO +MULTILINE +MagicMock +Mail +Mailbox +Maildir +MaildirMessage +MailmanProxy +Mapping +MappingProxyType +MappingView +May +Mean +Media +MemberDescriptorType +MemoryBIO +MemoryError +MemoryHandler +Message +MessageBeep() +MessageClass +MessageError +MessageParseError +MetaPathFinder +MetavarTypeHelpFormatter +Meter +MethodType +MimeTypes +MissingSectionHeaderError +Mock +Modify() +ModuleFinder +ModuleSpec +ModuleType +Morsel +MozillaCookieJar +MultiCall +MultipartConversionError +MutableMapping +MutableSequence +MutableSet +NAME +NAMESPACE_DNS +NAMESPACE_OID +NAMESPACE_URL +NAMESPACE_X500 +NEWLINE +NL +NNTP +NNTPDataError +NNTPError +NNTPPermanentError +NNTPProtocolError +NNTPReplyError +NNTPTemporaryError +NNTP_SSL +NOEXPR +NOP +NORMALIZE_WHITESPACE +NOTEQUAL +NSIG +NTEventLogHandler +NT_OFFSET +NUMBER +N_TOKENS +NaN +NameError +NamedTemporaryFile() +NamedTuple() +Namespace +Namespace() +NamespaceErr +NannyNag +NetmaskValueError +NetrcParseError +Network +News +NoDataAllowedErr +NoModificationAllowedErr +NoOptionError +NoSectionError +NoSuchMailboxError +NodeTransformer +NodeVisitor +NonCallableMagicMock +NonCallableMock +None +NotADirectoryError +NotConnected +NotEmptyError +NotFoundErr +NotImplemented +NotImplementedError +NotStandaloneHandler() +NotSupportedErr +NotationDeclHandler() +NoteBook +Notebook +NullFormatter +NullHandler +NullImporter +NullTranslations +NullWriter +Number +Numerical +OK +OP +OPENSSL_VERSION +OPENSSL_VERSION_INFO +OPENSSL_VERSION_NUMBER +OPTIMIZED_BYTECODE_SUFFIXES +OP_ALL +OP_CIPHER_SERVER_PREFERENCE +OP_NO_COMPRESSION +OP_NO_SSLv2 +OP_NO_SSLv3 +OP_NO_TLSv1 +OP_NO_TLSv1_1 +OP_NO_TLSv1_2 +OP_SINGLE_DH_USE +OP_SINGLE_ECDH_USE +OSError +OSSAudioError +O_APPEND +O_ASYNC +O_BINARY +O_CLOEXEC +O_CREAT +O_DIRECT +O_DIRECTORY +O_DSYNC +O_EXCL +O_EXLOCK +O_NDELAY +O_NOATIME +O_NOCTTY +O_NOFOLLOW +O_NOINHERIT +O_NONBLOCK +O_PATH +O_RANDOM +O_RDONLY +O_RDWR +O_RSYNC +O_SEQUENTIAL +O_SHLOCK +O_SHORT_LIVED +O_SYNC +O_TEMPORARY +O_TEXT +O_TMPFILE +O_TRUNC +O_WRONLY +OleDLL +OpenDatabase() +OpenKey() +OpenKeyEx() +OpenSSL +OpenView() +OpenerDirector +Option +OptionGroup +OptionMenu +OptionParser +Optional +OrderedDict +OutputChecker +OutputString() +Overflow +OverflowError +PAGER +PARSE_COLNAMES +PARSE_DECLTYPES +PATH +PATHEXT +PAX_FORMAT +PEM_cert_to_DER_cert() +PEP +PERCENT +PERCENTEQUAL +PF_CAN +PF_RDS +PIPE +PIPE_BUF +PKG_DIRECTORY +PLAT +PLUS +PLUSEQUAL +POINTER() +POP3 +POP3_SSL +POP_BLOCK +POP_EXCEPT +POP_JUMP_IF_FALSE +POP_JUMP_IF_TRUE +POP_TOP +POSIX +POSIXLY_CORRECT +POSIX_FADV_DONTNEED +POSIX_FADV_NOREUSE +POSIX_FADV_NORMAL +POSIX_FADV_RANDOM +POSIX_FADV_SEQUENTIAL +POSIX_FADV_WILLNEED +PREFIX +PREFIXES +PRINT_EXPR +PRIO_PGRP +PRIO_PROCESS +PRIO_USER +PROTOCOL_SSLv2 +PROTOCOL_SSLv23 +PROTOCOL_SSLv3 +PROTOCOL_TLSv1 +PROTOCOL_TLSv1_1 +PROTOCOL_TLSv1_2 +PROTOCOL_VERSION +PYFUNCTYPE() +PYTHON* +PYTHONASYNCIODEBUG +PYTHONCASEOK +PYTHONDEBUG +PYTHONDOCS +PYTHONDONTWRITEBYTECODE +PYTHONDUMPREFS +PYTHONEXECUTABLE +PYTHONFAULTHANDLER +PYTHONHASHSEED +PYTHONHOME +PYTHONINSPECT +PYTHONIOENCODING +PYTHONMALLOCSTATS +PYTHONNOUSERSITE +PYTHONOPTIMIZE +PYTHONPATH +PYTHONSTARTUP +PYTHONTHREADDEBUG +PYTHONTRACEMALLOC +PYTHONUNBUFFERED +PYTHONUSERBASE +PYTHONVERBOSE +PYTHONWARNINGS +PYTHON_DOM +PY_COMPILED +PY_FROZEN +PY_SOURCE +PY_SSIZE_T_MAX +P_ALL +P_DETACH +P_NOWAIT +P_NOWAITO +P_OVERLAY +P_PGID +P_PID +P_WAIT +Package +Packer +PanedWindow +Parameter +ParameterizedMIMEHeader +Parse() +ParseError +ParseFile() +ParseFlags() +ParseResult +ParseResultBytes +Parser +ParserCreate() +ParserError +ParsingError +Paste +Path +PathEntryFinder +PathFinder +Pdb +PendingDeprecationWarning +Performance +PermissionError +Persist() +Philbrick +PickleError +Pickler +PicklingError +Pipe() +PlaySound() +Please +Policy +PollSelector +Pool +Popen +PopupMenu +PosixPath +PrettyPrinter +PriorityQueue +ProactorEventLoop +Process +ProcessError +ProcessLookupError +ProcessPoolExecutor +ProcessingInstruction() +ProcessingInstructionHandler() +Profile +Progressbar +PropertyMock +Proposals +Protocol +ProtocolError +ProxyBasicAuthHandler +ProxyDigestAuthHandler +ProxyHandler +ProxyType +ProxyTypes +PullDom +PurePath +PurePath.anchor +PurePath.drive +PurePath.name +PurePath.parent +PurePath.parents +PurePath.parts +PurePath.path +PurePath.root +PurePath.stem +PurePath.suffix +PurePath.suffixes +PurePosixPath +PureProxy +PureWindowsPath +Purpose.CLIENT_AUTH +Purpose.SERVER_AUTH +PyASCIIObject +PyAnySet_Check +PyAnySet_CheckExact +PyArg_Parse +PyArg_ParseTuple +PyArg_ParseTuple() +PyArg_ParseTupleAndKeywords +PyArg_ParseTupleAndKeywords() +PyArg_UnpackTuple +PyArg_VaParse +PyArg_VaParseTupleAndKeywords +PyArg_ValidateKeywordArguments +PyAsyncMethods +PyAsyncMethods.am_aiter +PyAsyncMethods.am_anext +PyAsyncMethods.am_await +PyBUF_ANY_CONTIGUOUS +PyBUF_CONTIG +PyBUF_CONTIG_RO +PyBUF_C_CONTIGUOUS +PyBUF_FORMAT +PyBUF_FULL +PyBUF_FULL_RO +PyBUF_F_CONTIGUOUS +PyBUF_INDIRECT +PyBUF_ND +PyBUF_RECORDS +PyBUF_RECORDS_RO +PyBUF_SIMPLE +PyBUF_STRIDED +PyBUF_STRIDED_RO +PyBUF_STRIDES +PyBUF_WRITABLE +PyBool_Check +PyBool_FromLong +PyBufferProcs +PyBufferProcs.bf_getbuffer +PyBufferProcs.bf_releasebuffer +PyBuffer_FillContiguousStrides +PyBuffer_FillInfo +PyBuffer_IsContiguous +PyBuffer_Release +PyBuffer_SizeFromFormat +PyByteArrayObject +PyByteArray_AS_STRING +PyByteArray_AsString +PyByteArray_Check +PyByteArray_CheckExact +PyByteArray_Concat +PyByteArray_FromObject +PyByteArray_FromStringAndSize +PyByteArray_GET_SIZE +PyByteArray_Resize +PyByteArray_Size +PyByteArray_Type +PyBytesObject +PyBytes_AS_STRING +PyBytes_AsString +PyBytes_AsStringAndSize +PyBytes_Check +PyBytes_CheckExact +PyBytes_Concat +PyBytes_ConcatAndDel +PyBytes_FromFormat +PyBytes_FromFormatV +PyBytes_FromObject +PyBytes_FromString +PyBytes_FromStringAndSize +PyBytes_GET_SIZE +PyBytes_Size +PyBytes_Type +PyCFunction +PyCFunctionWithKeywords +PyCallIter_Check +PyCallIter_New +PyCallIter_Type +PyCallable_Check +PyCapsule +PyCapsule_CheckExact +PyCapsule_Destructor +PyCapsule_GetContext +PyCapsule_GetDestructor +PyCapsule_GetName +PyCapsule_GetPointer +PyCapsule_Import +PyCapsule_IsValid +PyCapsule_New +PyCapsule_SetContext +PyCapsule_SetDestructor +PyCapsule_SetName +PyCapsule_SetPointer +PyCellObject +PyCell_Check +PyCell_GET +PyCell_Get +PyCell_New +PyCell_SET +PyCell_Set +PyCell_Type +PyCodeObject +PyCode_Check +PyCode_GetNumFree +PyCode_New +PyCode_NewEmpty +PyCode_Type +PyCodec_BackslashReplaceErrors +PyCodec_Decode +PyCodec_Decoder +PyCodec_Encode +PyCodec_Encoder +PyCodec_IgnoreErrors +PyCodec_IncrementalDecoder +PyCodec_IncrementalEncoder +PyCodec_KnownEncoding +PyCodec_LookupError +PyCodec_NameReplaceErrors +PyCodec_Register +PyCodec_RegisterError +PyCodec_ReplaceErrors +PyCodec_StreamReader +PyCodec_StreamWriter +PyCodec_StrictErrors +PyCodec_XMLCharRefReplaceErrors +PyCompactUnicodeObject +PyCompileError +PyCompilerFlags +PyComplexObject +PyComplex_AsCComplex +PyComplex_Check +PyComplex_CheckExact +PyComplex_FromCComplex +PyComplex_FromDoubles +PyComplex_ImagAsDouble +PyComplex_RealAsDouble +PyComplex_Type +PyCoroObject +PyCoro_CheckExact +PyCoro_New +PyCoro_Type +PyDLL +PyDateTime_Check +PyDateTime_CheckExact +PyDateTime_DATE_GET_HOUR +PyDateTime_DATE_GET_MICROSECOND +PyDateTime_DATE_GET_MINUTE +PyDateTime_DATE_GET_SECOND +PyDateTime_DELTA_GET_DAYS +PyDateTime_DELTA_GET_MICROSECOND +PyDateTime_DELTA_GET_SECONDS +PyDateTime_FromDateAndTime +PyDateTime_FromTimestamp +PyDateTime_GET_DAY +PyDateTime_GET_MONTH +PyDateTime_GET_YEAR +PyDateTime_TIME_GET_HOUR +PyDateTime_TIME_GET_MICROSECOND +PyDateTime_TIME_GET_MINUTE +PyDateTime_TIME_GET_SECOND +PyDate_Check +PyDate_CheckExact +PyDate_FromDate +PyDate_FromTimestamp +PyDelta_Check +PyDelta_CheckExact +PyDelta_FromDSU +PyDescr_IsData +PyDescr_NewClassMethod +PyDescr_NewGetSet +PyDescr_NewMember +PyDescr_NewMethod +PyDescr_NewWrapper +PyDictObject +PyDictProxy_New +PyDict_Check +PyDict_CheckExact +PyDict_Clear +PyDict_ClearFreeList +PyDict_Contains +PyDict_Copy +PyDict_DelItem +PyDict_DelItemString +PyDict_GetItem +PyDict_GetItemString +PyDict_GetItemWithError +PyDict_Items +PyDict_Keys +PyDict_Merge +PyDict_MergeFromSeq2 +PyDict_New +PyDict_Next +PyDict_SetDefault +PyDict_SetItem +PyDict_SetItemString +PyDict_Size +PyDict_Type +PyDict_Update +PyDict_Values +PyErr_BadArgument +PyErr_BadInternalCall +PyErr_CheckSignals +PyErr_Clear +PyErr_Clear() +PyErr_ExceptionMatches +PyErr_ExceptionMatches() +PyErr_Fetch +PyErr_Fetch() +PyErr_Format +PyErr_FormatV +PyErr_GetExcInfo +PyErr_GivenExceptionMatches +PyErr_NewException +PyErr_NewExceptionWithDoc +PyErr_NoMemory +PyErr_NormalizeException +PyErr_Occurred +PyErr_Occurred() +PyErr_Print +PyErr_PrintEx +PyErr_Restore +PyErr_Restore() +PyErr_SetExcFromWindowsErr +PyErr_SetExcFromWindowsErrWithFilename +PyErr_SetExcFromWindowsErrWithFilenameObject +PyErr_SetExcFromWindowsErrWithFilenameObjects +PyErr_SetExcInfo +PyErr_SetFromErrno +PyErr_SetFromErrnoWithFilename +PyErr_SetFromErrnoWithFilenameObject +PyErr_SetFromErrnoWithFilenameObjects +PyErr_SetFromWindowsErr +PyErr_SetFromWindowsErrWithFilename +PyErr_SetImportError +PyErr_SetInterrupt +PyErr_SetNone +PyErr_SetObject +PyErr_SetString +PyErr_SetString() +PyErr_SyntaxLocation +PyErr_SyntaxLocationEx +PyErr_SyntaxLocationObject +PyErr_WarnEx +PyErr_WarnExplicit +PyErr_WarnExplicitObject +PyErr_WarnFormat +PyErr_WriteUnraisable +PyEval_AcquireLock +PyEval_AcquireThread +PyEval_AcquireThread() +PyEval_EvalCode +PyEval_EvalCodeEx +PyEval_EvalFrame +PyEval_EvalFrameEx +PyEval_GetBuiltins +PyEval_GetCallStats +PyEval_GetFrame +PyEval_GetFuncDesc +PyEval_GetFuncName +PyEval_GetGlobals +PyEval_GetLocals +PyEval_InitThreads +PyEval_InitThreads() +PyEval_MergeCompilerFlags +PyEval_ReInitThreads +PyEval_ReleaseLock +PyEval_ReleaseThread +PyEval_ReleaseThread() +PyEval_RestoreThread +PyEval_RestoreThread() +PyEval_SaveThread +PyEval_SaveThread() +PyEval_SetProfile +PyEval_SetTrace +PyEval_ThreadsInitialized +PyExc_ArithmeticError +PyExc_AssertionError +PyExc_AttributeError +PyExc_BaseException +PyExc_BlockingIOError +PyExc_BrokenPipeError +PyExc_ConnectionAbortedError +PyExc_ConnectionError +PyExc_ConnectionRefusedError +PyExc_ConnectionResetError +PyExc_EOFError +PyExc_EnvironmentError +PyExc_Exception +PyExc_FileExistsError +PyExc_FileNotFoundError +PyExc_FloatingPointError +PyExc_IOError +PyExc_ImportError +PyExc_IndexError +PyExc_InterruptedError +PyExc_IsADirectoryError +PyExc_KeyError +PyExc_KeyboardInterrupt +PyExc_LookupError +PyExc_MemoryError +PyExc_NameError +PyExc_NotADirectoryError +PyExc_NotImplementedError +PyExc_OSError +PyExc_OverflowError +PyExc_PermissionError +PyExc_ProcessLookupError +PyExc_RecursionError +PyExc_ReferenceError +PyExc_RuntimeError +PyExc_SyntaxError +PyExc_SystemError +PyExc_SystemExit +PyExc_TimeoutError +PyExc_TypeError +PyExc_ValueError +PyExc_WindowsError +PyExc_ZeroDivisionError +PyException_GetCause +PyException_GetContext +PyException_GetTraceback +PyException_SetCause +PyException_SetContext +PyException_SetTraceback +PyFile_FromFd +PyFile_GetLine +PyFile_WriteObject +PyFile_WriteString +PyFloatObject +PyFloat_AS_DOUBLE +PyFloat_AsDouble +PyFloat_Check +PyFloat_CheckExact +PyFloat_ClearFreeList +PyFloat_FromDouble +PyFloat_FromString +PyFloat_GetInfo +PyFloat_GetMax +PyFloat_GetMin +PyFloat_Type +PyFrameObject +PyFrame_GetLineNumber +PyFrozenSet_Check +PyFrozenSet_CheckExact +PyFrozenSet_New +PyFrozenSet_Type +PyFunctionObject +PyFunction_Check +PyFunction_GetAnnotations +PyFunction_GetClosure +PyFunction_GetCode +PyFunction_GetDefaults +PyFunction_GetGlobals +PyFunction_GetModule +PyFunction_New +PyFunction_NewWithQualName +PyFunction_SetAnnotations +PyFunction_SetClosure +PyFunction_SetDefaults +PyFunction_Type +PyGILState_Check +PyGILState_Ensure +PyGILState_GetThisThreadState +PyGILState_Release +PyGenObject +PyGen_Check +PyGen_CheckExact +PyGen_New +PyGen_NewWithQualName +PyGen_Type +PyImport_AddModule +PyImport_AddModuleObject +PyImport_AppendInittab +PyImport_Cleanup +PyImport_ExecCodeModule +PyImport_ExecCodeModuleEx +PyImport_ExecCodeModuleObject +PyImport_ExecCodeModuleWithPathnames +PyImport_ExtendInittab +PyImport_FrozenModules +PyImport_GetImporter +PyImport_GetMagicNumber +PyImport_GetMagicTag +PyImport_GetModuleDict +PyImport_Import +PyImport_ImportFrozenModule +PyImport_ImportFrozenModuleObject +PyImport_ImportModule +PyImport_ImportModuleEx +PyImport_ImportModuleLevel +PyImport_ImportModuleLevelObject +PyImport_ImportModuleNoBlock +PyImport_ReloadModule +PyIndex_Check +PyInit_modulename +PyInstanceMethod_Check +PyInstanceMethod_Function +PyInstanceMethod_GET_FUNCTION +PyInstanceMethod_New +PyInstanceMethod_Type +PyInterpreterState +PyInterpreterState_Clear +PyInterpreterState_Delete +PyInterpreterState_Head +PyInterpreterState_New +PyInterpreterState_Next +PyInterpreterState_ThreadHead +PyIter_Check +PyIter_Next +PyListObject +PyList_Append +PyList_AsTuple +PyList_Check +PyList_CheckExact +PyList_ClearFreeList +PyList_GET_ITEM +PyList_GET_SIZE +PyList_GetItem +PyList_GetItem() +PyList_GetSlice +PyList_Insert +PyList_New +PyList_Reverse +PyList_SET_ITEM +PyList_SetItem +PyList_SetItem() +PyList_SetSlice +PyList_Size +PyList_Sort +PyList_Type +PyLongObject +PyLong_AsDouble +PyLong_AsLong +PyLong_AsLongAndOverflow +PyLong_AsLongLong +PyLong_AsLongLongAndOverflow +PyLong_AsSize_t +PyLong_AsSsize_t +PyLong_AsUnsignedLong +PyLong_AsUnsignedLongLong +PyLong_AsUnsignedLongLongMask +PyLong_AsUnsignedLongMask +PyLong_AsVoidPtr +PyLong_Check +PyLong_CheckExact +PyLong_FromDouble +PyLong_FromLong +PyLong_FromLongLong +PyLong_FromSize_t +PyLong_FromSsize_t +PyLong_FromString +PyLong_FromUnicode +PyLong_FromUnicodeObject +PyLong_FromUnsignedLong +PyLong_FromUnsignedLongLong +PyLong_FromVoidPtr +PyLong_Type +PyMappingMethods +PyMappingMethods.mp_ass_subscript +PyMappingMethods.mp_length +PyMappingMethods.mp_subscript +PyMapping_Check +PyMapping_DelItem +PyMapping_DelItemString +PyMapping_GetItemString +PyMapping_HasKey +PyMapping_HasKeyString +PyMapping_Items +PyMapping_Keys +PyMapping_Length +PyMapping_SetItemString +PyMapping_Size +PyMapping_Values +PyMarshal_ReadLastObjectFromFile +PyMarshal_ReadLongFromFile +PyMarshal_ReadObjectFromFile +PyMarshal_ReadObjectFromString +PyMarshal_ReadShortFromFile +PyMarshal_WriteLongToFile +PyMarshal_WriteObjectToFile +PyMarshal_WriteObjectToString +PyMemAllocatorDomain +PyMemAllocatorEx +PyMem_Calloc +PyMem_Del +PyMem_Free +PyMem_GetAllocator +PyMem_Malloc +PyMem_New +PyMem_RawCalloc +PyMem_RawFree +PyMem_RawMalloc +PyMem_RawRealloc +PyMem_Realloc +PyMem_Resize +PyMem_SetAllocator +PyMem_SetupDebugHooks +PyMemberDef +PyMemoryView_Check +PyMemoryView_FromBuffer +PyMemoryView_FromMemory +PyMemoryView_FromObject +PyMemoryView_GET_BASE +PyMemoryView_GET_BUFFER +PyMemoryView_GetContiguous +PyMethodDef +PyMethod_Check +PyMethod_ClearFreeList +PyMethod_Function +PyMethod_GET_FUNCTION +PyMethod_GET_SELF +PyMethod_New +PyMethod_Self +PyMethod_Type +PyModuleDef +PyModuleDef.m_base +PyModuleDef.m_clear +PyModuleDef.m_doc +PyModuleDef.m_free +PyModuleDef.m_methods +PyModuleDef.m_name +PyModuleDef.m_reload +PyModuleDef.m_size +PyModuleDef.m_slots +PyModuleDef.m_traverse +PyModuleDef_Init +PyModuleDef_Slot +PyModuleDef_Slot.slot +PyModuleDef_Slot.value +PyModule_AddFunctions +PyModule_AddIntConstant +PyModule_AddIntMacro +PyModule_AddObject +PyModule_AddStringConstant +PyModule_AddStringMacro +PyModule_Check +PyModule_CheckExact +PyModule_Create +PyModule_Create2 +PyModule_ExecDef +PyModule_FromDefAndSpec +PyModule_FromDefAndSpec2 +PyModule_GetDef +PyModule_GetDict +PyModule_GetFilename +PyModule_GetFilenameObject +PyModule_GetName +PyModule_GetNameObject +PyModule_GetState +PyModule_New +PyModule_NewObject +PyModule_SetDocString +PyModule_Type +PyNumberMethods +PyNumber_Absolute +PyNumber_Add +PyNumber_And +PyNumber_AsSsize_t +PyNumber_Check +PyNumber_Divmod +PyNumber_Float +PyNumber_FloorDivide +PyNumber_InPlaceAdd +PyNumber_InPlaceAnd +PyNumber_InPlaceFloorDivide +PyNumber_InPlaceLshift +PyNumber_InPlaceMatrixMultiply +PyNumber_InPlaceMultiply +PyNumber_InPlaceOr +PyNumber_InPlacePower +PyNumber_InPlaceRemainder +PyNumber_InPlaceRshift +PyNumber_InPlaceSubtract +PyNumber_InPlaceTrueDivide +PyNumber_InPlaceXor +PyNumber_Index +PyNumber_Invert +PyNumber_Long +PyNumber_Lshift +PyNumber_MatrixMultiply +PyNumber_Multiply +PyNumber_Negative +PyNumber_Or +PyNumber_Positive +PyNumber_Power +PyNumber_Remainder +PyNumber_Rshift +PyNumber_Subtract +PyNumber_ToBase +PyNumber_TrueDivide +PyNumber_Xor +PyOS_AfterFork +PyOS_CheckStack +PyOS_InputHook +PyOS_ReadlineFunctionPointer +PyOS_double_to_string +PyOS_getsig +PyOS_setsig +PyOS_snprintf +PyOS_stricmp +PyOS_string_to_double +PyOS_strnicmp +PyOS_vsnprintf +PyObject +PyObject._ob_next +PyObject._ob_prev +PyObject.ob_refcnt +PyObject.ob_type +PyObjectArenaAllocator +PyObject_ASCII +PyObject_AsCharBuffer +PyObject_AsFileDescriptor +PyObject_AsReadBuffer +PyObject_AsWriteBuffer +PyObject_Bytes +PyObject_Call +PyObject_CallFunction +PyObject_CallFunctionObjArgs +PyObject_CallMethod +PyObject_CallMethodObjArgs +PyObject_CallObject +PyObject_CallObject() +PyObject_CheckBuffer +PyObject_CheckReadBuffer +PyObject_Del +PyObject_DelAttr +PyObject_DelAttrString +PyObject_DelItem +PyObject_Dir +PyObject_GC_Del +PyObject_GC_New +PyObject_GC_NewVar +PyObject_GC_Resize +PyObject_GC_Track +PyObject_GC_UnTrack +PyObject_GenericGetAttr +PyObject_GenericGetDict +PyObject_GenericSetAttr +PyObject_GenericSetDict +PyObject_GetArenaAllocator +PyObject_GetAttr +PyObject_GetAttrString +PyObject_GetBuffer +PyObject_GetItem +PyObject_GetIter +PyObject_HEAD +PyObject_HEAD_INIT +PyObject_HasAttr +PyObject_HasAttrString +PyObject_Hash +PyObject_HashNotImplemented +PyObject_Init +PyObject_InitVar +PyObject_IsInstance +PyObject_IsSubclass +PyObject_IsTrue +PyObject_Length +PyObject_LengthHint +PyObject_New +PyObject_NewVar +PyObject_Not +PyObject_Print +PyObject_Repr +PyObject_RichCompare +PyObject_RichCompareBool +PyObject_SetArenaAllocator +PyObject_SetAttr +PyObject_SetAttrString +PyObject_SetItem +PyObject_Size +PyObject_Str +PyObject_Type +PyObject_TypeCheck +PyObject_VAR_HEAD +PyPI +PyParser_SimpleParseFile +PyParser_SimpleParseFileFlags +PyParser_SimpleParseString +PyParser_SimpleParseStringFlags +PyParser_SimpleParseStringFlagsFilename +PyProperty_Type +PyRun_AnyFile +PyRun_AnyFileEx +PyRun_AnyFileExFlags +PyRun_AnyFileFlags +PyRun_File +PyRun_FileEx +PyRun_FileExFlags +PyRun_FileFlags +PyRun_InteractiveLoop +PyRun_InteractiveLoopFlags +PyRun_InteractiveOne +PyRun_InteractiveOneFlags +PyRun_SimpleFile +PyRun_SimpleFileEx +PyRun_SimpleFileExFlags +PyRun_SimpleString +PyRun_SimpleStringFlags +PyRun_String +PyRun_StringFlags +PySeqIter_Check +PySeqIter_New +PySeqIter_Type +PySequenceMethods +PySequenceMethods.sq_ass_item +PySequenceMethods.sq_concat +PySequenceMethods.sq_contains +PySequenceMethods.sq_inplace_concat +PySequenceMethods.sq_inplace_repeat +PySequenceMethods.sq_item +PySequenceMethods.sq_length +PySequenceMethods.sq_repeat +PySequence_Check +PySequence_Concat +PySequence_Contains +PySequence_Count +PySequence_DelItem +PySequence_DelSlice +PySequence_Fast +PySequence_Fast_GET_ITEM +PySequence_Fast_GET_SIZE +PySequence_Fast_ITEMS +PySequence_GetItem +PySequence_GetItem() +PySequence_GetSlice +PySequence_ITEM +PySequence_InPlaceConcat +PySequence_InPlaceRepeat +PySequence_Index +PySequence_Length +PySequence_List +PySequence_Repeat +PySequence_SetItem +PySequence_SetSlice +PySequence_Size +PySequence_Tuple +PySetObject +PySet_Add +PySet_Check +PySet_Clear +PySet_ClearFreeList +PySet_Contains +PySet_Discard +PySet_GET_SIZE +PySet_New +PySet_Pop +PySet_Size +PySet_Type +PySignal_SetWakeupFd +PySlice_Check +PySlice_GetIndices +PySlice_GetIndicesEx +PySlice_New +PySlice_Type +PyState_AddModule +PyState_FindModule +PyState_RemoveModule +PyStructSequence_Desc +PyStructSequence_Field +PyStructSequence_GET_ITEM +PyStructSequence_GetItem +PyStructSequence_InitType +PyStructSequence_InitType2 +PyStructSequence_New +PyStructSequence_NewType +PyStructSequence_SET_ITEM +PyStructSequence_SetItem +PyStructSequence_UnnamedField +PySys_AddWarnOption +PySys_AddWarnOptionUnicode +PySys_AddXOption +PySys_FormatStderr +PySys_FormatStdout +PySys_GetObject +PySys_GetXOptions +PySys_ResetWarnOptions +PySys_SetArgv +PySys_SetArgv() +PySys_SetArgvEx +PySys_SetArgvEx() +PySys_SetObject +PySys_SetPath +PySys_WriteStderr +PySys_WriteStdout +PyTZInfo_Check +PyTZInfo_CheckExact +PyThreadState +PyThreadState_Clear +PyThreadState_Delete +PyThreadState_Get +PyThreadState_GetDict +PyThreadState_New +PyThreadState_Next +PyThreadState_SetAsyncExc +PyThreadState_Swap +PyTime_Check +PyTime_CheckExact +PyTime_FromTime +PyTrace_CALL +PyTrace_C_CALL +PyTrace_C_EXCEPTION +PyTrace_C_RETURN +PyTrace_EXCEPTION +PyTrace_LINE +PyTrace_RETURN +PyTupleObject +PyTuple_Check +PyTuple_CheckExact +PyTuple_ClearFreeList +PyTuple_GET_ITEM +PyTuple_GET_SIZE +PyTuple_GetItem +PyTuple_GetSlice +PyTuple_New +PyTuple_Pack +PyTuple_SET_ITEM +PyTuple_SetItem +PyTuple_SetItem() +PyTuple_Size +PyTuple_Type +PyTypeObject +PyTypeObject.tp_alloc +PyTypeObject.tp_allocs +PyTypeObject.tp_as_buffer +PyTypeObject.tp_base +PyTypeObject.tp_bases +PyTypeObject.tp_basicsize +PyTypeObject.tp_cache +PyTypeObject.tp_call +PyTypeObject.tp_clear +PyTypeObject.tp_dealloc +PyTypeObject.tp_descr_get +PyTypeObject.tp_descr_set +PyTypeObject.tp_dict +PyTypeObject.tp_dictoffset +PyTypeObject.tp_doc +PyTypeObject.tp_finalize +PyTypeObject.tp_flags +PyTypeObject.tp_free +PyTypeObject.tp_frees +PyTypeObject.tp_getattr +PyTypeObject.tp_getattro +PyTypeObject.tp_getset +PyTypeObject.tp_hash +PyTypeObject.tp_init +PyTypeObject.tp_is_gc +PyTypeObject.tp_itemsize +PyTypeObject.tp_iter +PyTypeObject.tp_iternext +PyTypeObject.tp_maxalloc +PyTypeObject.tp_members +PyTypeObject.tp_methods +PyTypeObject.tp_mro +PyTypeObject.tp_name +PyTypeObject.tp_new +PyTypeObject.tp_next +PyTypeObject.tp_print +PyTypeObject.tp_repr +PyTypeObject.tp_richcompare +PyTypeObject.tp_setattr +PyTypeObject.tp_setattro +PyTypeObject.tp_str +PyTypeObject.tp_subclasses +PyTypeObject.tp_traverse +PyTypeObject.tp_weaklist +PyTypeObject.tp_weaklistoffset +PyType_Check +PyType_CheckExact +PyType_ClearCache +PyType_FromSpec +PyType_FromSpecWithBases +PyType_GenericAlloc +PyType_GenericNew +PyType_GetFlags +PyType_GetSlot +PyType_HasFeature +PyType_IS_GC +PyType_IsSubtype +PyType_Modified +PyType_Ready +PyType_Type +PyUnicodeDecodeError_Create +PyUnicodeDecodeError_GetEncoding +PyUnicodeDecodeError_GetEnd +PyUnicodeDecodeError_GetObject +PyUnicodeDecodeError_GetReason +PyUnicodeDecodeError_GetStart +PyUnicodeDecodeError_SetEnd +PyUnicodeDecodeError_SetReason +PyUnicodeDecodeError_SetStart +PyUnicodeEncodeError_Create +PyUnicodeEncodeError_GetEncoding +PyUnicodeEncodeError_GetEnd +PyUnicodeEncodeError_GetObject +PyUnicodeEncodeError_GetReason +PyUnicodeEncodeError_GetStart +PyUnicodeEncodeError_SetEnd +PyUnicodeEncodeError_SetReason +PyUnicodeEncodeError_SetStart +PyUnicodeObject +PyUnicodeTranslateError_Create +PyUnicodeTranslateError_GetEnd +PyUnicodeTranslateError_GetObject +PyUnicodeTranslateError_GetReason +PyUnicodeTranslateError_GetStart +PyUnicodeTranslateError_SetEnd +PyUnicodeTranslateError_SetReason +PyUnicodeTranslateError_SetStart +PyUnicode_1BYTE_DATA +PyUnicode_1BYTE_KIND +PyUnicode_2BYTE_DATA +PyUnicode_2BYTE_KIND +PyUnicode_4BYTE_DATA +PyUnicode_4BYTE_KIND +PyUnicode_AS_DATA +PyUnicode_AS_UNICODE +PyUnicode_AsASCIIString +PyUnicode_AsCharmapString +PyUnicode_AsEncodedString +PyUnicode_AsLatin1String +PyUnicode_AsMBCSString +PyUnicode_AsRawUnicodeEscapeString +PyUnicode_AsUCS4 +PyUnicode_AsUCS4Copy +PyUnicode_AsUTF16String +PyUnicode_AsUTF32String +PyUnicode_AsUTF8 +PyUnicode_AsUTF8AndSize +PyUnicode_AsUTF8String +PyUnicode_AsUnicode +PyUnicode_AsUnicodeAndSize +PyUnicode_AsUnicodeCopy +PyUnicode_AsUnicodeEscapeString +PyUnicode_AsWideChar +PyUnicode_AsWideCharString +PyUnicode_Check +PyUnicode_CheckExact +PyUnicode_ClearFreeList +PyUnicode_Compare +PyUnicode_CompareWithASCIIString +PyUnicode_Concat +PyUnicode_Contains +PyUnicode_CopyCharacters +PyUnicode_Count +PyUnicode_DATA +PyUnicode_Decode +PyUnicode_DecodeASCII +PyUnicode_DecodeCharmap +PyUnicode_DecodeFSDefault +PyUnicode_DecodeFSDefaultAndSize +PyUnicode_DecodeLatin1 +PyUnicode_DecodeLocale +PyUnicode_DecodeLocaleAndSize +PyUnicode_DecodeMBCS +PyUnicode_DecodeMBCSStateful +PyUnicode_DecodeRawUnicodeEscape +PyUnicode_DecodeUTF16 +PyUnicode_DecodeUTF16Stateful +PyUnicode_DecodeUTF32 +PyUnicode_DecodeUTF32Stateful +PyUnicode_DecodeUTF7 +PyUnicode_DecodeUTF7Stateful +PyUnicode_DecodeUTF8 +PyUnicode_DecodeUTF8Stateful +PyUnicode_DecodeUnicodeEscape +PyUnicode_Encode +PyUnicode_EncodeASCII +PyUnicode_EncodeCharmap +PyUnicode_EncodeCodePage +PyUnicode_EncodeFSDefault +PyUnicode_EncodeLatin1 +PyUnicode_EncodeLocale +PyUnicode_EncodeMBCS +PyUnicode_EncodeRawUnicodeEscape +PyUnicode_EncodeUTF16 +PyUnicode_EncodeUTF32 +PyUnicode_EncodeUTF7 +PyUnicode_EncodeUTF8 +PyUnicode_EncodeUnicodeEscape +PyUnicode_FSConverter +PyUnicode_FSDecoder +PyUnicode_Fill +PyUnicode_Find +PyUnicode_FindChar +PyUnicode_Format +PyUnicode_FromEncodedObject +PyUnicode_FromFormat +PyUnicode_FromFormatV +PyUnicode_FromKindAndData +PyUnicode_FromObject +PyUnicode_FromString +PyUnicode_FromString() +PyUnicode_FromStringAndSize +PyUnicode_FromUnicode +PyUnicode_FromWideChar +PyUnicode_GET_DATA_SIZE +PyUnicode_GET_LENGTH +PyUnicode_GET_SIZE +PyUnicode_GetLength +PyUnicode_GetSize +PyUnicode_InternFromString +PyUnicode_InternInPlace +PyUnicode_Join +PyUnicode_KIND +PyUnicode_MAX_CHAR_VALUE +PyUnicode_New +PyUnicode_READ +PyUnicode_READY +PyUnicode_READ_CHAR +PyUnicode_ReadChar +PyUnicode_Replace +PyUnicode_RichCompare +PyUnicode_Split +PyUnicode_Splitlines +PyUnicode_Substring +PyUnicode_Tailmatch +PyUnicode_TransformDecimalToASCII +PyUnicode_Translate +PyUnicode_TranslateCharmap +PyUnicode_Type +PyUnicode_WCHAR_KIND +PyUnicode_WRITE +PyUnicode_WriteChar +PyVarObject +PyVarObject.ob_size +PyVarObject_HEAD_INIT +PyWeakref_Check +PyWeakref_CheckProxy +PyWeakref_CheckRef +PyWeakref_GET_OBJECT +PyWeakref_GetObject +PyWeakref_NewProxy +PyWeakref_NewRef +PyWrapper_New +PyZipFile +Py_AddPendingCall +Py_AddPendingCall() +Py_AtExit +Py_BEGIN_ALLOW_THREADS +Py_BLOCK_THREADS +Py_BuildValue +Py_CLEAR +Py_CompileString +Py_CompileString() +Py_CompileStringExFlags +Py_CompileStringFlags +Py_CompileStringObject +Py_DECREF +Py_DECREF() +Py_DecodeLocale +Py_END_ALLOW_THREADS +Py_EncodeLocale +Py_EndInterpreter +Py_EnterRecursiveCall +Py_Exit +Py_False +Py_FatalError +Py_FatalError() +Py_FdIsInteractive +Py_Finalize +Py_Finalize() +Py_GetBuildInfo +Py_GetCompiler +Py_GetCopyright +Py_GetExecPrefix +Py_GetExecPrefix() +Py_GetPath +Py_GetPath() +Py_GetPlatform +Py_GetPrefix +Py_GetPrefix() +Py_GetProgramFullPath +Py_GetProgramFullPath() +Py_GetProgramName +Py_GetPythonHome +Py_GetVersion +Py_INCREF +Py_INCREF() +Py_Initialize +Py_Initialize() +Py_InitializeEx +Py_IsInitialized +Py_IsInitialized() +Py_LeaveRecursiveCall +Py_Main +Py_NewInterpreter +Py_None +Py_NotImplemented +Py_PRINT_RAW +Py_REFCNT +Py_RETURN_FALSE +Py_RETURN_NONE +Py_RETURN_NOTIMPLEMENTED +Py_RETURN_TRUE +Py_ReprEnter +Py_ReprLeave +Py_SIZE +Py_SetPath +Py_SetPath() +Py_SetProgramName +Py_SetProgramName() +Py_SetPythonHome +Py_SetStandardStreamEncoding +Py_TPFLAGS_BASETYPE +Py_TPFLAGS_BASE_EXC_SUBCLASS +Py_TPFLAGS_BYTES_SUBCLASS +Py_TPFLAGS_DEFAULT +Py_TPFLAGS_DICT_SUBCLASS +Py_TPFLAGS_HAVE_FINALIZE +Py_TPFLAGS_HAVE_GC +Py_TPFLAGS_HEAPTYPE +Py_TPFLAGS_LIST_SUBCLASS +Py_TPFLAGS_LONG_SUBCLASS +Py_TPFLAGS_READY +Py_TPFLAGS_READYING +Py_TPFLAGS_TUPLE_SUBCLASS +Py_TPFLAGS_TYPE_SUBCLASS +Py_TPFLAGS_UNICODE_SUBCLASS +Py_TYPE +Py_True +Py_UCS1 +Py_UCS2 +Py_UCS4 +Py_UCS4_strcat +Py_UCS4_strchr +Py_UCS4_strcmp +Py_UCS4_strcpy +Py_UCS4_strlen +Py_UCS4_strncmp +Py_UCS4_strncpy +Py_UCS4_strrchr +Py_UNBLOCK_THREADS +Py_UNICODE +Py_UNICODE_ISALNUM +Py_UNICODE_ISALPHA +Py_UNICODE_ISDECIMAL +Py_UNICODE_ISDIGIT +Py_UNICODE_ISLINEBREAK +Py_UNICODE_ISLOWER +Py_UNICODE_ISNUMERIC +Py_UNICODE_ISPRINTABLE +Py_UNICODE_ISSPACE +Py_UNICODE_ISTITLE +Py_UNICODE_ISUPPER +Py_UNICODE_IS_HIGH_SURROGATE +Py_UNICODE_IS_LOW_SURROGATE +Py_UNICODE_IS_SURROGATE +Py_UNICODE_JOIN_SURROGATES +Py_UNICODE_TODECIMAL +Py_UNICODE_TODIGIT +Py_UNICODE_TOLOWER +Py_UNICODE_TONUMERIC +Py_UNICODE_TOTITLE +Py_UNICODE_TOUPPER +Py_VISIT +Py_VaBuildValue +Py_XDECREF +Py_XDECREF() +Py_XINCREF +Py_buffer +Py_buffer.buf +Py_buffer.format +Py_buffer.internal +Py_buffer.itemsize +Py_buffer.len +Py_buffer.ndim +Py_buffer.obj +Py_buffer.readonly +Py_buffer.shape +Py_buffer.strides +Py_buffer.suboffsets +Py_complex +Py_eval_input +Py_file_input +Py_mod_create +Py_mod_exec +Py_single_input +Py_tracefunc +Python +Pythonic +QName +QUOTE_ALL +QUOTE_MINIMAL +QUOTE_NONE +QUOTE_NONNUMERIC +QueryInfoKey() +QueryReflectionKey() +QueryValue() +QueryValueEx() +Queue +Queue() +QueueEmpty +QueueFull +QueueHandler +QueueListener +Quick +RADIXCHAR +RAISE_VARARGS +RAND_add() +RAND_bytes() +RAND_egd() +RAND_pseudo_bytes() +RAND_status() +RARROW +RBRACE +READABLE +READONLY +READ_RESTRICTED +REG_BINARY +REG_DWORD +REG_DWORD_BIG_ENDIAN +REG_DWORD_LITTLE_ENDIAN +REG_EXPAND_SZ +REG_FULL_RESOURCE_DESCRIPTOR +REG_LINK +REG_MULTI_SZ +REG_NONE +REG_RESOURCE_LIST +REG_RESOURCE_REQUIREMENTS_LIST +REG_SZ +REPORTING_FLAGS +REPORT_CDIFF +REPORT_NDIFF +REPORT_ONLY_FIRST_FAILURE +REPORT_UDIFF +RESERVED_FUTURE +RESERVED_MICROSOFT +RESERVED_NCS +RESTRICTED +RETURN_VALUE +RFC +RFC_4122 +RIGHTSHIFT +RIGHTSHIFTEQUAL +RLIMIT_AS +RLIMIT_CORE +RLIMIT_CPU +RLIMIT_DATA +RLIMIT_FSIZE +RLIMIT_MEMLOCK +RLIMIT_MSGQUEUE +RLIMIT_NICE +RLIMIT_NOFILE +RLIMIT_NPROC +RLIMIT_NPTS +RLIMIT_OFILE +RLIMIT_RSS +RLIMIT_RTPRIO +RLIMIT_RTTIME +RLIMIT_SBSIZE +RLIMIT_SIGPENDING +RLIMIT_STACK +RLIMIT_SWAP +RLIMIT_VMEM +RLIM_INFINITY +RLock +RLock() +RMFF +ROT_THREE +ROT_TWO +ROUND_05UP +ROUND_CEILING +ROUND_DOWN +ROUND_FLOOR +ROUND_HALF_DOWN +ROUND_HALF_EVEN +ROUND_HALF_UP +ROUND_UP +RPAR +RSQB +RTLD_DEEPBIND +RTLD_GLOBAL +RTLD_LAZY +RTLD_LOCAL +RTLD_NODELETE +RTLD_NOLOAD +RTLD_NOW +RUSAGE_BOTH +RUSAGE_CHILDREN +RUSAGE_SELF +RUSAGE_THREAD +R_OK +RadioButtonGroup +Rational +RawArray() +RawConfigParser +RawDescriptionHelpFormatter +RawIOBase +RawPen +RawTextHelpFormatter +RawTurtle +RawValue() +ReadError +ReadTransport +Real +RecursionError +Redundancy +ReferenceError +ReferenceType +RemoteDisconnected +ReplacePackage() +Repr +Representation +Request +RequestHandlerClass +ResourceDenied +ResourceLoader +ResourceWarning +ResponseNotReady +Reversible +RobotFileParser +RotatingFileHandler +Rounded +Row +Run +RuntimeError +RuntimeWarning +SAX2DOM +SAXException +SAXNotRecognizedException +SAXNotSupportedException +SAXParseException +SCHED_BATCH +SCHED_FIFO +SCHED_IDLE +SCHED_OTHER +SCHED_RESET_ON_FORK +SCHED_RR +SCHED_SPORADIC +SECTCRE +SEEK_CUR +SEEK_END +SEEK_SET +SEMI +SETUP_ASYNC_WITH +SETUP_EXCEPT +SETUP_FINALLY +SETUP_LOOP +SETUP_WITH +SET_ADD +SF_APPEND +SF_ARCHIVED +SF_IMMUTABLE +SF_MNOWAIT +SF_NODISKIO +SF_NOUNLINK +SF_SNAPSHOT +SF_SYNC +SHA1 +SHA224 +SHA256 +SHA384 +SHA512 +SIGINT +SIG_BLOCK +SIG_DFL +SIG_IGN +SIG_SETMASK +SIG_UNBLOCK +SKIP +SLASH +SLASHEQUAL +SMTP +SMTPAuthenticationError +SMTPChannel +SMTPConnectError +SMTPDataError +SMTPException +SMTPHandler +SMTPHeloError +SMTPNotSupportedError +SMTPRecipientsRefused +SMTPResponseException +SMTPSenderRefused +SMTPServer +SMTPServerDisconnected +SMTPUTF8 +SMTP_SSL +SND_ALIAS +SND_ASYNC +SND_FILENAME +SND_LOOP +SND_MEMORY +SND_NODEFAULT +SND_NOSTOP +SND_NOWAIT +SND_PURGE +SOCK_CLOEXEC +SOCK_DGRAM +SOCK_NONBLOCK +SOCK_RAW +SOCK_RDM +SOCK_SEQPACKET +SOCK_STREAM +SOL_RDS +SOMAXCONN +SOURCE_SUFFIXES +SSL +SSLContext +SSLEOFError +SSLError +SSLObject +SSLSocket +SSLSyscallError +SSLWantReadError +SSLWantWriteError +SSLZeroReturnError +STAR +STAREQUAL +STARTF_USESHOWWINDOW +STARTF_USESTDHANDLES +STARTUPINFO +STDOUT +STD_ERROR_HANDLE +STD_INPUT_HANDLE +STD_OUTPUT_HANDLE +STORE_ACTIONS +STORE_ATTR +STORE_DEREF +STORE_FAST +STORE_GLOBAL +STORE_NAME +STORE_SUBSCR +STRING +STType +ST_ATIME +ST_CTIME +ST_DEV +ST_GID +ST_INO +ST_MODE +ST_MTIME +ST_NLINK +ST_SIZE +ST_UID +SW_HIDE +S_ENFMT +S_IEXEC +S_IFBLK +S_IFCHR +S_IFDIR +S_IFDOOR +S_IFIFO +S_IFLNK +S_IFMT() +S_IFPORT +S_IFREG +S_IFSOCK +S_IFWHT +S_IMODE() +S_IREAD +S_IRGRP +S_IROTH +S_IRUSR +S_IRWXG +S_IRWXO +S_IRWXU +S_ISBLK() +S_ISCHR() +S_ISDIR() +S_ISDOOR() +S_ISFIFO() +S_ISGID +S_ISLNK() +S_ISPORT() +S_ISREG() +S_ISSOCK() +S_ISUID +S_ISVTX +S_ISWHT() +S_IWGRP +S_IWOTH +S_IWRITE +S_IWUSR +S_IXGRP +S_IXOTH +S_IXUSR +SameFileError +SaveKey() +Saving +Screen +ScrolledCanvas +Secure +Security +Select +SelectSelector +SelectorEventLoop +SelectorKey +Semaphore +Semaphore() +Sequence +SequenceMatcher +Server +ServerProxy +Set +SetBase() +SetInteger() +SetParamEntityParsing() +SetProperty() +SetStream() +SetString() +SetValue() +SetValueEx() +Shape +Shelf +Signature +Simple +SimpleCookie +SimpleHTTPRequestHandler +SimpleHandler +SimpleNamespace +SimpleQueue +SimpleXMLRPCRequestHandler +SimpleXMLRPCServer +SingleAddressHeader +Sized +SkipTest +Snapshot +Sniffer +SocketHandler +SocketType +Sockets +Software +SourceFileLoader +SourceLoader +SourcelessFileLoader +Sphinx +SplitResult +SplitResultBytes +SpooledTemporaryFile() +StackSummary +Standard +StartCdataSectionHandler() +StartDoctypeDeclHandler() +StartElementHandler() +StartNamespaceDeclHandler() +Statistic +StatisticDiff +StatisticsError +Stats +StdButtonBox +StopAsyncIteration +StopIteration +StreamError +StreamHandler +StreamReader +StreamReaderProtocol +StreamReaderWriter +StreamRecoder +StreamRequestHandler +StreamWriter +StringIO +Struct +Structure +Style +SubElement() +Subnormal +SubprocessError +SubprocessProtocol +SupportsAbs +SupportsFloat +SupportsInt +SupportsRound +SuppressCrashReport +Symbol +SymbolTable +Symbols +SyncManager +SyntaxErr +SyntaxError +SyntaxWarning +SysLogHandler +SystemError +SystemExit +SystemRandom +SystemRoot +TCL_LIBRARY +TCPServer +TEMP +TERM +TESTFN +THOUSEP +TILDE +TIMEOUT_MAX +TIX_LIBRARY +TK_LIBRARY +TLS +TList +TMP +TMPDIR +TYPED_ACTIONS +TYPES +TYPE_CHECKER +TZ +T_FMT +T_FMT_AMPM +TabError +TarError +TarFile +TarInfo +Task +Tcl() +Telnet +Template +TemporaryDirectory() +TemporaryFile() +TestCase +TestFailed +TestLoader +TestResult +TestSuite +TextCalendar +TextFile +TextIOBase +TextIOWrapper +TextTestResult +TextTestRunner +TextWrapper +Textbox +The +Thread +ThreadPoolExecutor +ThreadingMixIn +ThreadingTCPServer +ThreadingUDPServer +Time +Time2Internaldate() +TimedRotatingFileHandler +TimeoutError +TimeoutExpired +Timer +Tix +Tk +Tkinter +ToASCII() +ToUnicode() +TokenError +Trace +Traceback +TracebackException +TracebackType +Transfer +TransientResource +Transport +Tree +TreeBuilder +Treeview +True +Tuple +Turtle +TurtleScreen +TypeError +TypeVar +Types +UDPServer +UF_APPEND +UF_COMPRESSED +UF_HIDDEN +UF_IMMUTABLE +UF_NODUMP +UF_NOUNLINK +UF_OPAQUE +ULONG_MAX +UNARY_INVERT +UNARY_NEGATIVE +UNARY_NOT +UNARY_POSITIVE +UNC +UNIX +UNPACK_EX +UNPACK_SEQUENCE +URL +URLError +URLopener +USER +USERNAME +USERPROFILE +USER_BASE +USER_SITE +USTAR_FORMAT +UTC +UUID +UnboundLocalError +Underflow +UnexpectedException +Unicode +UnicodeDecodeError +UnicodeEncodeError +UnicodeError +UnicodeTranslateError +UnicodeWarning +UnimplementedFileMode +Union +Universal +UnixDatagramServer +UnixStreamServer +UnknownHandler +UnknownProtocol +UnknownTransferEncoding +Unpacker +UnparsedEntityDeclHandler() +Unpickler +UnpicklingError +UnstructuredHeader +UnsupportedOperation +UseForeignDTD() +User +UserDict +UserList +UserString +UserWarning +UuidCreate() +VBAR +VBAREQUAL +VERBOSE +VERIFY_CRL_CHECK_CHAIN +VERIFY_CRL_CHECK_LEAF +VERIFY_DEFAULT +VERIFY_X509_STRICT +VERIFY_X509_TRUSTED_FIRST +Value() +ValueError +ValuesView +Vec2D +WCONTINUED +WCOREDUMP() +WEXITED +WEXITSTATUS() +WIFCONTINUED() +WIFEXITED() +WIFSIGNALED() +WIFSTOPPED() +WINFUNCTYPE() +WITH_CLEANUP_FINISH +WITH_CLEANUP_START +WNOHANG +WNOWAIT +WRITABLE +WRITE_RESTRICTED +WSGIRequestHandler +WSGIServer +WSTOPPED +WSTOPSIG() +WTERMSIG() +WUNTRACED +WWW +W_OK +Warning +WarningsRecorder +WatchedFileHandler +WeakKeyDictionary +WeakMethod +WeakSet +WeakValueDictionary +Web +What's +Wide +Widget +WinDLL +WinError() +WinSock +Windows +WindowsError +WindowsPath +WindowsRegistryFinder +World +WriteTransport +WrongDocumentErr +X509 +XATTR_CREATE +XATTR_REPLACE +XATTR_SIZE_MAX +XDR +XHTML +XHTML_NAMESPACE +XML() +XMLFilterBase +XMLGenerator +XMLID() +XMLNS_NAMESPACE +XMLParser +XMLParserType +XMLPullParser +XMLReader +XML_ERROR_ABORTED +XML_ERROR_ASYNC_ENTITY +XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF +XML_ERROR_BAD_CHAR_REF +XML_ERROR_BINARY_ENTITY_REF +XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING +XML_ERROR_DUPLICATE_ATTRIBUTE +XML_ERROR_ENTITY_DECLARED_IN_PE +XML_ERROR_EXTERNAL_ENTITY_HANDLING +XML_ERROR_FEATURE_REQUIRES_XML_DTD +XML_ERROR_FINISHED +XML_ERROR_INCOMPLETE_PE +XML_ERROR_INCORRECT_ENCODING +XML_ERROR_INVALID_TOKEN +XML_ERROR_JUNK_AFTER_DOC_ELEMENT +XML_ERROR_MISPLACED_XML_PI +XML_ERROR_NOT_STANDALONE +XML_ERROR_NOT_SUSPENDED +XML_ERROR_NO_ELEMENTS +XML_ERROR_NO_MEMORY +XML_ERROR_PARAM_ENTITY_REF +XML_ERROR_PARTIAL_CHAR +XML_ERROR_PUBLICID +XML_ERROR_RECURSIVE_ENTITY_REF +XML_ERROR_SUSPENDED +XML_ERROR_SUSPEND_PE +XML_ERROR_SYNTAX +XML_ERROR_TAG_MISMATCH +XML_ERROR_TEXT_DECL +XML_ERROR_UNBOUND_PREFIX +XML_ERROR_UNCLOSED_CDATA_SECTION +XML_ERROR_UNCLOSED_TOKEN +XML_ERROR_UNDECLARING_PREFIX +XML_ERROR_UNDEFINED_ENTITY +XML_ERROR_UNEXPECTED_STATE +XML_ERROR_UNKNOWN_ENCODING +XML_ERROR_XML_DECL +XML_NAMESPACE +X_OK +XmlDeclHandler() +Y2K +YESEXPR +YIELD_FROM +YIELD_VALUE +Year +ZIP_BZIP2 +ZIP_DEFLATED +ZIP_LZMA +ZIP_STORED +ZLIB_RUNTIME_VERSION +ZLIB_VERSION +Zen +ZeroDivisionError +Zip +ZipFile +ZipImportError +ZipInfo +a-LAW +a2b_base64() +a2b_hex() +a2b_hqx() +a2b_qp() +a2b_uu() +a85decode() +a85encode() +aRepr +abc +abiflags +abort() +above() +abs +abs() +abspath() +abstract +abstractclassmethod() +abstractmethod() +abstractproperty() +abstractstaticmethod() +accept() +access() +accumulate() +acos() +acosh() +acquire() +acquire_lock() +action +active_children() +active_count() +add() +addCleanup() +addError() +addExpectedFailure() +addFailure() +addFilter() +addHandler() +addLevelName() +addSkip() +addSubTest() +addSuccess() +addTest() +addTests() +addTypeEqualityFunc() +addUnexpectedSuccess() +add_alias() +add_alternative() +add_argument() +add_argument_group() +add_attachment() +add_cgi_vars() +add_charset() +add_codec() +add_cookie_header() +add_data() +add_done_callback() +add_fallback() +add_file() +add_flag() +add_flowing_data() +add_folder() +add_get_handler() +add_handler() +add_header() +add_history() +add_hor_rule() +add_include_dir() +add_label() +add_label_data() +add_library() +add_library_dir() +add_line_break() +add_link_object() +add_literal_data() +add_mutually_exclusive_group() +add_option() +add_parent() +add_password() +add_reader() +add_related() +add_runtime_library_dir() +add_section() +add_sequence() +add_set_handler() +add_signal_handler() +add_stream() +add_subparsers() +add_tables() +add_type() +add_unredirected_header() +add_writer() +addch() +addcomponent() +addfile() +addition +addnstr() +addr +addr_spec +address +address_exclude() +address_family +address_string() +addresses +addressof() +addshape() +addsitedir() +addstr() +adjusted() +adler32() +adpcm2lin() +aifc +aifc() +aiff() +alarm() +alaw2lin() +algorithm +algorithms_available +algorithms_guaranteed +alias +alignment() +alive +all() +all_errors +all_features +all_frames +all_properties +all_suffixes() +all_tasks() +allocate_lock() +allow_reuse_address +allowed_domains() +alt() +altsep +altzone +an +analysis +and +and_() +annotation +annotations +announce() +anonymous +answer_challenge() +anticipate_failure() +any() +api_version +apop() +append() +appendChild() +append_history_file() +appendleft() +application_uri() +apply +apply() +apply_async() +apply_defaults() +architecture() +archive +argparse +args +argtypes +argument +arguments +argv +arithmetic +array +arrays +article() +as +as_bytes() +as_completed() +as_integer_ratio() +as_posix() +as_string() +as_tuple() +as_uri() +ascii +ascii() +ascii_letters +ascii_lowercase +ascii_uppercase +asctime() +asin() +asinh() +assert +assertAlmostEqual() +assertCountEqual() +assertDictEqual() +assertEqual() +assertFalse() +assertGreater() +assertGreaterEqual() +assertIn() +assertIs() +assertIsInstance() +assertIsNone() +assertIsNot() +assertIsNotNone() +assertLess() +assertLessEqual() +assertListEqual() +assertLogs() +assertMultiLineEqual() +assertNotAlmostEqual() +assertNotEqual() +assertNotIn() +assertNotIsInstance() +assertNotRegex() +assertRaises() +assertRaisesRegex() +assertRegex() +assertSequenceEqual() +assertSetEqual() +assertTrue() +assertTupleEqual() +assertWarns() +assertWarnsRegex() +assert_any_call() +assert_called_once_with() +assert_called_with() +assert_has_calls() +assert_line_data() +assert_not_called() +assertions +asserts +assignment +ast +astimezone() +async +async() +async_chat +async_chat.ac_in_buffer_size +async_chat.ac_out_buffer_size +asynchat +asynchronous +asyncio +asyncio.subprocess.DEVNULL +asyncio.subprocess.PIPE +asyncio.subprocess.Process +asyncio.subprocess.STDOUT +asyncore +at_eof() +atan() +atan2() +atanh() +atexit +atof() +atoi() +atom +attach() +attach_mock() +attrgetter() +attrib +attribute +attributes +attroff() +attron() +attrset() +audioop +augmented +auth() +authenticate() +authenticators() +authkey +avg() +avgpp() +avoids_symlink_attacks +await +awaitable +b16decode() +b16encode() +b2a_base64() +b2a_hex() +b2a_hqx() +b2a_qp() +b2a_uu() +b32decode() +b32encode() +b64decode() +b64encode() +b85decode() +b85encode() +back() +backslash +backslashreplace_errors() +backward() +base +base64 +base_exec_prefix +base_prefix +based +basename() +basestring +basicConfig() +baudrate() +bbox() +bdb +bdist_msi +beep() +begin_fill() +begin_poly() +below() +benchmarking +betavariate() +bgcolor() +bgpic() +bias() +bidirectional() +bin() +binary +binascii +bind +bind() +bind_partial() +bind_port() +bind_textdomain_codeset() +binding +bindtextdomain() +binhex +binhex() +bisect +bisect() +bisect_left() +bisect_right() +bit_length() +bitmap() +bitwise +bk() +bkgd() +bkgdset() +blank +block +block_size +blocked_domains() +body() +body_encode() +body_encoding +body_line_iterator() +bool +bootstrap() +border() +bottom() +bottom_panel() +box() +bpformat() +bpprint() +break +break_anywhere() +break_here() +break_long_words +break_on_hyphens +breakpoints +broadcast_address +broken +browser +buffer +buffer_info() +buffer_size +buffer_text +buffer_used +buffering +bufsize() +bug? +build_opener() +build_py +build_py_2to3 +built-in +builtin_module_names +builtins +bye() +byref() +byte +byte-code +byte_compile() +bytearray +bytearray.splitlines +bytecode +byteorder +bytes +bytes-like +bytes.splitlines +bytes_le +byteswap() +bz2 +cProfile +c_bool +c_byte +c_char +c_char_p +c_contiguous +c_double +c_float +c_int +c_int16 +c_int32 +c_int64 +c_int8 +c_long +c_longdouble +c_longlong +c_short +c_size_t +c_ssize_t +c_ubyte +c_uint +c_uint16 +c_uint32 +c_uint64 +c_uint8 +c_ulong +c_ulonglong +c_ushort +c_void_p +c_wchar +c_wchar_p +cache_from_source() +cached +calcsize() +calendar +calendar() +call +call() +call_args +call_args_list +call_at() +call_count +call_exception_handler() +call_later() +call_list() +call_soon() +call_soon_threadsafe() +call_tracing() +callable +callable() +callback +callback() +callback_args +callback_kwargs +callbacks +called +calloc() +calls +can_change_color() +can_fetch() +can_symlink() +can_write_eof() +cancel() +cancel_dump_traceback_later() +cancel_join_thread() +cancelled() +canonic() +canonical() +capa() +capitalize() +captureWarnings() +captured_stderr() +captured_stdin() +captured_stdout() +capwords() +casefold() +cast() +cat() +catch_warnings +category() +cbreak() +ccc() +ceil() +center() +cert_store_stats() +cert_time_to_seconds() +certificate +certificates +cgi +cgi_directories +cgitb +chain() +chaining +change_cwd() +change_root() +changing +channel_class +channels() +character +characters() +characters_written +charset() +chdir() +check +check() +check_call() +check_environ() +check_hostname +check_output() +check_returncode() +check_unused_args() +check_warnings() +checkbox() +checkcache() +checkfuncname() +checksum +chflags() +chgat() +childNodes +chmod() +choice() +choices +chown() +chr +chr() +chroot() +chunk +cipher +cipher() +circle() +class +classmethod +classmethod() +clause +clean() +cleandoc() +cleanup +clear +clear() +clear_all_breaks() +clear_all_file_breaks() +clear_bpbynumber() +clear_break() +clear_cache() +clear_content() +clear_flags() +clear_frames() +clear_history() +clear_session_cookies() +clear_traces() +clear_traps() +clearcache() +clearok() +clearscreen() +clearstamp() +clearstamps() +client_address +clock() +clock_getres() +clock_gettime() +clock_settime() +clone() +cloneNode() +close() +close_connection +close_when_done() +closed +closelog() +closerange() +closing() +clrtobot() +clrtoeol() +cmath +cmd +cmdloop() +cmdqueue +cmp() +cmp_op +cmp_to_key() +cmpfiles() +co_argcount +co_cellvars +co_code +co_consts +co_filename +co_firstlineno +co_flags +co_freevars +co_lnotab +co_name +co_names +co_nlocals +co_stacksize +co_varnames +code +code_info() +codecs +coded_value +codeop +codepoint2name +codes +coding +coercion +col_offset +collapse_addresses() +collapse_rfc2231_value() +collect() +collect_incoming_data() +collection +collections +collections.abc +colno +color() +color_content() +color_pair() +colormode() +colorsys +column() +columns +combinations() +combinations_with_replacement() +combine() +combining() +comma +command +commands +comment +comment_url +commenters +commit() +common +common_dirs +common_files +common_funny +common_types +commonpath() +commonprefix() +communicate() +compare() +compare_digest() +compare_networks() +compare_signal() +compare_to() +compare_total() +compare_total_mag() +comparing +comparison +comparisons +compat32 +compile +compile() +compile_command() +compile_dir() +compile_file() +compile_path() +compileall +compilest() +complete() +complete_statement() +completedefault() +complex +compound +comprehension +comprehensions +compress() +compress_size +compress_type +compressed +compression() +compressobj() +concat() +concatenation +concurrent.futures +condition +condition() +conditional +configparser +configuration +configure() +configure_mock() +confstr() +confstr_names +conjugate() +conn +connect() +connect_ex() +connect_read_pipe() +connect_write_pipe() +connection +connection_lost() +connection_made() +const +constant +constructor +constructor() +container +contains() +content +content_manager +content_type +contents +context +context_diff() +contextlib +contextmanager() +contiguous +continuation +continue +control +control() +controlnames +controls() +conversion +conversions +convert_arg_line_to_args() +convert_field() +convert_path() +cookiejar +copy +copy() +copy2() +copy_abs() +copy_decimal() +copy_file() +copy_location() +copy_negate() +copy_sign() +copy_tree() +copyfile() +copyfileobj() +copying +copymode() +copyreg +copyright +copysign() +copystat() +copytree() +coroutine +coroutine() +corporation. +cos() +cosh() +count +count() +countOf() +countTestCases() +count_diff +counting +cpu_count() +crc32() +crc_hqx() +create() +createAttribute() +createAttributeNS() +createComment() +createDocument() +createDocumentType() +createElement() +createElementNS() +createLock() +createProcessingInstruction() +createSocket() +createTextNode() +create_aggregate() +create_archive() +create_autospec() +create_collation() +create_configuration() +create_connection() +create_datagram_endpoint() +create_decimal() +create_decimal_from_float() +create_default_context() +create_function() +create_module +create_module() +create_server() +create_shortcut() +create_socket() +create_static_lib() +create_stats() +create_string_buffer() +create_subprocess_exec() +create_subprocess_shell() +create_system +create_task() +create_tree() +create_unicode_buffer() +create_unix_connection() +create_unix_server() +create_version +createfilehandler() +creating +credits +critical() +cross() +crypt +crypt() +crypt(3) +cryptography +csv +csv.reader +cte +cte_type +ctermid() +ctime() +ctrl() +ctypes +curdir +currency() +current() +current_process() +current_task() +current_thread() +currentframe() +curs_set() +curses +curses.ascii +curses.panel +curses.textpad +cursor() +cursyncup() +customize_compiler() +cwd() +cycle() +daemon +dangling +data +data() +data_open() +data_received() +database +databases +datagram_received() +date +date() +date_time +date_time_string() +datetime +datum +day +day_abbr +day_name +daylight +dbm +dbm.dumb +dbm.gnu +dbm.ndbm +deallocation +debug +debug() +debug_print() +debug_src() +debugger +debugging +debuglevel +decimal +decimal() +declarations +decode +decode() +decode_header() +decode_params() +decode_rfc2231() +decode_source() +decodebytes() +decodestring() +decomposition() +decompress() +decompressobj() +decorator +dedent() +deepcopy() +def +def_prog_mode() +def_shell_mode() +default +default() +defaultTestLoader +defaultTestResult() +default_bufsize +default_exception_handler() +default_factory +default_open() +default_timer() +defaultdict +defaults() +defects +define_macro() +definition +definitions +defpath +degrees() +del +del_param() +delattr() +delay() +delay_output() +delayload +delch() +dele() +delete() +deleteMe() +deleteacl() +deletefilehandler() +deleteln() +deleting +deletion +delimiter +delimiters +delitem() +deliver_challenge() +delocalize() +demo_app() +denominator +deque +dequeue() +derwin() +description +description() +descriptions() +descriptor +dest +destructor +detach() +detect_encoding() +detect_language() +deterministic +device_encoding() +devnull +devpoll() +dgettext() +dialect +dict +dict() +dictConfig() +dictionary +diff_bytes() +diff_files +difference +difference() +difference_update() +difflib +digest +digest() +digest_size +digit() +digits +dir() +dircmp +directory +directory_created() +dirname() +dis +dis() +disable +disable() +disable_interspersed_args() +disassemble() +discard +discard() +discard_buffers() +disco() +discover() +disk_usage() +dispatch +dispatch_call() +dispatch_exception() +dispatch_line() +dispatch_return() +dispatch_table +dispatcher +dispatcher_with_send +display +display_name +displayhook() +dist() +distance() +distb() +distutils +distutils.archive_util +distutils.bcppcompiler +distutils.ccompiler +distutils.cmd +distutils.command +distutils.command.bdist +distutils.command.bdist_dumb +distutils.command.bdist_msi +distutils.command.bdist_packager +distutils.command.bdist_rpm +distutils.command.bdist_wininst +distutils.command.build +distutils.command.build_clib +distutils.command.build_ext +distutils.command.build_py +distutils.command.build_scripts +distutils.command.check +distutils.command.clean +distutils.command.config +distutils.command.install +distutils.command.install_data +distutils.command.install_headers +distutils.command.install_lib +distutils.command.install_scripts +distutils.command.register +distutils.command.sdist +distutils.core +distutils.cygwinccompiler +distutils.debug +distutils.dep_util +distutils.dir_util +distutils.dist +distutils.errors +distutils.extension +distutils.fancy_getopt +distutils.file_util +distutils.filelist +distutils.log +distutils.msvccompiler +distutils.spawn +distutils.sysconfig +distutils.text_file +distutils.unixccompiler +distutils.util +distutils.version +divide() +divide_int() +division +divmod +divmod() +dllhandle +dngettext() +doCleanups() +doRollover() +do_GET() +do_HEAD() +do_POST() +do_clear() +do_command() +do_handshake() +doc +doc_header +docmd() +docstring +docstrings +doctest +doctype() +documentElement +documentation +domain +domain_initial_dot +domain_return_ok() +domain_specified +donate. +done() +dont_write_bytecode +dot() +doublequote +doupdate() +down +down() +drain() +drop_whitespace +dropwhile() +dst() +duck-typing +dummy_threading +dump() +dump_stats() +dump_traceback() +dump_traceback_later() +dumps() +dup() +dup2() +dwFlags +east_asian_width() +echo() +echochar() +edit() +effective +effective() +ehlo() +ehlo_or_helo_if_needed() +element_create() +element_names() +element_options() +elements() +elif +else +email +email.charset +email.contentmanager +email.encoders +email.errors +email.generator +email.header +email.headerregistry +email.iterators +email.message +email.mime +email.parser +email.policy +email.utils +emit() +empty +empty() +emptyline() +enable +enable() +enable_callback_tracebacks() +enable_interspersed_args() +enable_load_extension() +enable_traversal() +enclose() +encode +encode() +encodePriority() +encode_7or8bit() +encode_base64() +encode_noop() +encode_quopri() +encode_rfc2231() +encodebytes() +encodestring() +encoding +encodings.idna +encodings.mbcs +encodings.utf_8_sig +encodings_map +end +end() +endDocument() +endElement() +endElementNS() +endPrefixMapping() +end_fill() +end_headers() +end_paragraph() +end_poly() +endheaders() +endpos +endswith() +endwin() +enqueue() +enqueue_sentinel() +ensure_directories() +ensure_future() +ensurepip +enter() +enter_context() +enterabs() +entities +entitydefs +entry +enum +enum_certificates() +enum_crls() +enumerate() +environ +environb +environment +eof +eof_received() +epilogue +epoch +epoll() +eq() +erase() +erasechar() +erf() +erfc() +errcheck +errcode +errmsg +errno +error +error() +error_body +error_content_type +error_headers +error_leader() +error_message_format +error_output() +error_perm +error_proto +error_received() +error_reply +error_status +error_temp +errorcode +errors +escape +escape() +escapechar +escapedquotes +eval +eval() +evaluation +event +event() +events +example +examples +exc_info +exc_info() +exc_msg +exc_type +excel +excel_tab +except +excepthook() +exception +exception() +exceptions +exclusive +exec +exec() +exec_module +exec_module() +exec_prefix +execfile +execl() +execle() +execlp() +execlpe() +executable +executable_filename() +execute() +executemany() +executescript() +execution +execv() +execve() +execvp() +execvpe() +exists() +exit +exit() +exitcode +exitfunc +exitonclick() +exp() +expand() +expandNode() +expand_tabs +expandtabs() +expanduser() +expandvars() +expansion +expect() +expected +expectedFailure() +expectedFailures +expires +exploded +expm1() +expovariate() +expr() +expression +expunge() +extend() +extend_path() +extendleft() +extension +extensions_map +external_attr +extra +extract() +extract_cookies() +extract_stack() +extract_tb() +extract_version +extractall() +extractfile() +extsep +f_back +f_builtins +f_code +f_contiguous +f_globals +f_lasti +f_lineno +f_locals +f_trace +fabs() +factorial() +factory() +fail() +failfast +failureException +failures +false +family +fancy_getopt() +fast +fatalError() +faultCode +faultString +faulthandler +fchdir() +fchmod() +fchown() +fcntl +fcntl() +fd +fd() +fdatasync() +fdopen() +feature_external_ges +feature_external_pes +feature_namespace_prefixes +feature_namespaces +feature_string_interning +feature_validation +feed() +feed_data() +feed_eof() +fetch() +fetchall() +fetchmany() +fetchone() +fflags +field_size_limit() +fieldnames +fields +file +file-like +fileConfig() +file_created() +file_dispatcher +file_open() +file_size +file_wrapper +filecmp +fileinput +filelineno() +filemode() +filename +filename() +filename2 +filename_only +filename_pattern +filenames +fileno() +fileobj +files +fill() +fillcolor() +filling() +filter +filter() +filter_traces() +filterfalse() +filterwarnings() +finalization +finalize +finalize_options() +finally +find() +findCaller() +find_class() +find_library() +find_library_file() +find_loader() +find_longest_match() +find_module() +find_msvcrt() +find_spec +find_spec() +find_unused_port() +find_user_password() +findall() +finder +findfactor() +findfile() +findfit() +finditer() +findlabels() +findlinestarts() +findmatch() +findmax() +findtext() +finish() +finish_request() +firstChild +firstkey() +firstweekday() +fix_missing_locations() +fix_sentence_endings +fixer) +flag_bits +flags +flash() +flatten() +flattening +float +float_info +float_repr_style +floating +flock() +floor +floor() +floordiv() +flush() +flush_headers() +flush_softspace() +flushinp() +fma() +fmod() +fnmatch +fnmatch() +fnmatchcase() +focus() +fold() +fold_binary() +for +forget() +fork() +forkpty() +form +format +format() +formatException() +formatStack() +formatTime() +format_datetime() +format_exc() +format_exception() +format_exception_only() +format_field() +format_help() +format_list() +format_map() +format_stack() +format_stack_entry() +format_string() +format_tb() +format_usage() +formataddr() +formatargspec() +formatargvalues() +formatdate() +formatmonth() +formatter +formatting +formatwarning() +formatyear() +formatyearpage() +forward() +found_terminator() +fpathconf() +fpectl +fqdn +fractions +frame +free +free() +freeze +freeze_support() +frexp() +from +from_address() +from_buffer() +from_buffer_copy() +from_bytes() +from_callable() +from_decimal() +from_exception() +from_float() +from_iterable() +from_list() +from_param() +from_traceback() +frombuf() +frombytes() +fromfd() +fromfile() +fromhex() +fromkeys() +fromlist() +fromordinal() +fromshare() +fromstring() +fromstringlist() +fromtarfile() +fromtimestamp() +fromunicode() +fromutc() +frozenset +fsdecode() +fsencode() +fstat() +fstatvfs() +fsum() +fsync() +ftp_open() +ftplib +ftruncate() +full() +full_url +fullmatch() +func +funcattrs +function +functions +functools +funny_files +future +fwalk() +gaierror +gamma() +gammavariate() +garbage +gather() +gauss() +gc +gcd() +ge() +gen_lib_options() +gen_preprocess_options() +gen_uuid() +generate_help() +generation +generator +generic +generic_visit() +genops() +get() +getAttribute() +getAttributeNS() +getAttributeNode() +getAttributeNodeNS() +getByteStream() +getCharacterStream() +getChild() +getColumnNumber() +getContentHandler() +getDOMImplementation() +getDTDHandler() +getEffectiveLevel() +getElementsByTagName() +getElementsByTagNameNS() +getEncoding() +getEntityResolver() +getErrorHandler() +getEvent() +getEventCategory() +getEventType() +getException() +getFeature() +getLength() +getLevelName() +getLineNumber() +getLogRecordFactory() +getLogger() +getLoggerClass() +getMessage() +getMessageID() +getName() +getNameByQName() +getNames() +getProperty() +getPublicId() +getQNameByName() +getQNames() +getSubject() +getSystemId() +getTestCaseNames() +getType() +getValue() +getValueByQName() +get_all() +get_all_breaks() +get_all_start_methods() +get_app() +get_archive_formats() +get_begidx() +get_blocking() +get_body() +get_body_encoding() +get_boundary() +get_bpbynumber() +get_break() +get_breaks() +get_buffer() +get_bytes() +get_ca_certs() +get_cache_token() +get_channel_binding() +get_charset() +get_charsets() +get_children() +get_clock_info() +get_close_matches() +get_code() +get_completer() +get_completer_delims() +get_completion_type() +get_config_h_filename() +get_config_var() +get_config_vars() +get_content() +get_content_charset() +get_content_disposition() +get_content_maintype() +get_content_subtype() +get_content_type() +get_context() +get_coroutine_wrapper() +get_count() +get_current_history_length() +get_data() +get_date() +get_debug() +get_default() +get_default_compiler() +get_default_domain() +get_default_type() +get_default_verify_paths() +get_dialect() +get_docstring() +get_doctest() +get_endidx() +get_environ() +get_errno() +get_event_loop() +get_event_loop_policy() +get_examples() +get_exec_path() +get_extra_info() +get_field() +get_file() +get_file_breaks() +get_filename() +get_flags() +get_folder() +get_frees() +get_from() +get_full_url() +get_globals() +get_grouped_opcodes() +get_handle_inheritable() +get_header() +get_history_item() +get_history_length() +get_id() +get_ident() +get_identifiers() +get_importer() +get_info() +get_inheritable() +get_instructions() +get_interpreter() +get_key() +get_labels() +get_last_error() +get_line_buffer() +get_lineno() +get_loader() +get_locals() +get_logger() +get_magic() +get_makefile_filename() +get_map() +get_matching_blocks() +get_message() +get_method() +get_methods() +get_mixed_type_key() +get_name() +get_namespace() +get_namespaces() +get_nonstandard_attr() +get_nowait() +get_object_traceback() +get_objects() +get_opcodes() +get_option() +get_option_group() +get_option_order() +get_osfhandle() +get_output_charset() +get_param() +get_parameters() +get_params() +get_path() +get_path_names() +get_paths() +get_payload() +get_pid() +get_pipe_transport() +get_platform() +get_poly() +get_position() +get_python_inc() +get_python_lib() +get_python_version() +get_recsrc() +get_referents() +get_referrers() +get_request() +get_returncode() +get_scheme() +get_scheme_names() +get_sequences() +get_server() +get_server_certificate() +get_shapepoly() +get_socket() +get_source() +get_special_folder_path() +get_stack() +get_start_method() +get_starttag_text() +get_stats() +get_stderr() +get_stdin() +get_string() +get_subdir() +get_suffixes() +get_symbols() +get_tag() +get_task_factory() +get_terminal_size() +get_terminator() +get_threshold() +get_token() +get_traceback_limit() +get_traced_memory() +get_tracemalloc_memory() +get_type() +get_type_hints() +get_unixfrom() +get_unpack_formats() +get_usage() +get_value() +get_version() +get_visible() +get_wch() +get_write_buffer_limits() +get_write_buffer_size() +getacl() +getaddresses() +getaddrinfo() +getallocatedblocks() +getannotation() +getargspec() +getargvalues() +getatime() +getattr() +getattr_static() +getbegyx() +getbkgd() +getboolean() +getbuffer() +getcallargs() +getcanvas() +getcapabilities() +getcaps() +getch() +getche() +getcheckinterval() +getchildren() +getclasstree() +getclosurevars() +getcomments() +getcompname() +getcomptype() +getcontext() +getcoroutinelocals() +getcoroutinestate() +getctime() +getcwd() +getcwdb() +getcwdu +getdecoder() +getdefaultencoding() +getdefaultlocale() +getdefaulttimeout() +getdlopenflags() +getdoc() +getegid() +getencoder() +getenv() +getenvb() +geteuid() +getfile() +getfilesystemencoding() +getfirst() +getfloat() +getfmts() +getfqdn() +getframeinfo() +getframerate() +getfullargspec() +getgeneratorlocals() +getgeneratorstate() +getgid() +getgrall() +getgrgid() +getgrnam() +getgrouplist() +getgroups() +getheader() +getheaders() +gethostbyaddr() +gethostbyname() +gethostbyname_ex() +gethostname() +getincrementaldecoder() +getincrementalencoder() +getinfo() +getinnerframes() +getint() +getitem() +getiterator() +getitimer() +getkey() +getline() +getlist() +getloadavg() +getlocale() +getlogin() +getmark() +getmarkers() +getmaxyx() +getmember() +getmembers() +getmodule() +getmoduleinfo() +getmodulename() +getmouse() +getmro() +getmtime() +getname() +getnameinfo() +getnames() +getnchannels() +getnframes() +getnode +getnode() +getopt +getopt() +getouterframes() +getoutput() +getpagesize() +getparams() +getparyx() +getpass +getpass() +getpeercert() +getpeername() +getpen() +getpgid() +getpgrp() +getpid() +getpos() +getppid() +getpreferredencoding() +getpriority() +getprofile() +getprotobyname() +getproxies() +getpwall() +getpwnam() +getpwuid() +getquota() +getquotaroot() +getrandbits() +getreader() +getrecursionlimit() +getrefcount() +getresgid() +getresponse() +getresuid() +getrlimit() +getroot() +getrusage() +getsample() +getsampwidth() +getscreen() +getservbyname() +getservbyport() +getshapes() +getsid() +getsignal() +getsitepackages() +getsize() +getsizeof() +getsockname() +getsockopt() +getsource() +getsourcefile() +getsourcelines() +getspall() +getspnam() +getstate() +getstatusoutput() +getstr() +getswitchinterval() +getsyx() +gettarinfo() +gettempdir() +gettempdirb() +gettempprefix() +gettempprefixb() +gettext +gettext() +gettimeout() +gettrace() +getturtle() +getuid() +geturl() +getuser() +getuserbase() +getusersitepackages() +getvalue() +getwch() +getwche() +getweakrefcount() +getweakrefs() +getwelcome() +getwin() +getwindowsversion() +getwriter() +getxattr() +getyx() +gid +glob +glob() +global +globals() +globs +gmtime() +gname +gnu_getopt() +got +goto() +grammar +group +group() +groupby() +groupdict() +groupindex +grouping +groups +groups() +grp +gt() +guess_all_extensions() +guess_extension() +guess_scheme() +guess_type() +gzip +hStdError +hStdInput +hStdOutput +halfdelay() +handle +handle() +handleError() +handle_accept() +handle_accepted() +handle_charref() +handle_close() +handle_comment() +handle_connect() +handle_data() +handle_decl() +handle_defect() +handle_endtag() +handle_entityref() +handle_error() +handle_expect_100() +handle_expt() +handle_one_request() +handle_pi() +handle_read() +handle_request() +handle_startendtag() +handle_starttag() +handle_timeout() +handle_write() +handler +handler() +handling +hasAttribute() +hasAttributeNS() +hasAttributes() +hasChildNodes() +hasFeature() +hasHandlers() +has_children() +has_colors() +has_exec() +has_extn() +has_function() +has_header() +has_ic() +has_il() +has_ipv6 +has_key +has_key() +has_location +has_nonstandard_attr() +has_option() +has_section() +hasattr() +hascompare +hasconst +hasfree +hash +hash() +hash.block_size +hash.digest_size +hash_info +hashable +hashlib +hasjabs +hasjrel +haslocal +hasname +head() +header_encode() +header_encode_lines() +header_encoding +header_factory +header_fetch_parse() +header_items() +header_max_count() +header_offset +header_source_parse() +header_store_parse() +headers +heading() +heapify() +heapmin() +heappop() +heappush() +heappushpop() +heapq +heapreplace() +helo() +help +help() +herror +hex +hex() +hexadecimal +hexbin() +hexdigest() +hexdigits +hexlify() +hexversion +hidden() +hide() +hide_cookie2 +hideturtle() +hierarchy +hline() +hls_to_rgb() +hmac +home() +hook +hook_compressed() +hook_encoded() +hooks +host +hostmask +hosts +hosts() +hour +hsv_to_rgb() +ht() +html +html.entities +html.parser +html5 +htonl() +htons() +http +http.client +http.cookiejar +http.cookies +http.server +http_error_301() +http_error_302() +http_error_303() +http_error_307() +http_error_401() +http_error_407() +http_error_auth_reqed() +http_error_default() +http_error_nnn() +http_open() +http_proxy +http_response() +http_version +httpd +https_open() +https_response() +hypot() +iadd() +iand() +iconcat() +id +id() +idcok() +ident +identchars +identifier +identify() +identify_column() +identify_element() +identify_region() +identify_row() +identity +idioms +idlok() +if +if_indextoname() +if_nameindex() +if_nametoindex() +ifloordiv() +iglob() +ignorableWhitespace() +ignore +ignore_errors() +ignore_patterns() +ihave() +ilshift() +imag +imaginary +imap() +imap_unordered() +imaplib +imatmul() +imghdr +immedok() +immutable +imod() +imp +implementation +import +import_fresh_module() +import_module() +importer +importing +importlib +importlib.abc +importlib.abc.InspectLoader.get_source +importlib.machinery +importlib.util +imports +imports2 +imul() +in +in_dll() +in_table_a1() +in_table_b1() +in_table_c11() +in_table_c11_c12() +in_table_c12() +in_table_c21() +in_table_c21_c22() +in_table_c22() +in_table_c3() +in_table_c4() +in_table_c5() +in_table_c6() +in_table_c7() +in_table_c8() +in_table_c9() +in_table_d1() +in_table_d2() +in_transaction +inch() +inclusive +incr_item() +increment_lineno() +incrementaldecoder +incrementalencoder +indent +indent() +indentation +index +index() +indexOf() +indexmodules +indices() +inet_aton() +inet_ntoa() +inet_ntop() +inet_pton() +inf +infile +info() +infolist() +information +inheritance +ini +init() +init_color() +init_database() +init_pair() +inited +initgroups() +initial_indent +initialize_options() +initscr() +inode() +input +input() +input_charset +input_codec +inquiry +insch() +insdelln() +insert() +insertBefore() +insert_text() +insertln() +insnstr() +insort() +insort_left() +insort_right() +inspect +insstr() +install() +installHandler() +install_opener() +install_scripts() +instance +instancemethod +instate() +instr() +instream +int +int_info +integer +interact +interact() +interactive +interface +intern +intern() +internal +internalSubset +internal_attr +interpolation +interpreted +interpreter +interrupt() +interrupt_main() +intersection() +intersection_update() +intro +inv() +invalidate_caches() +inversion +invert() +invocation +io +io.IncrementalNewlineDecoder +io.StringIO +io.TextIOWrapper +ioctl() +ior() +ip +ip_address() +ip_interface() +ip_network() +ipaddress +ipow() +ipv4_mapped +irshift() +is +isDaemon() +isEnabledFor() +isReservedKey() +isSameNode() +is_() +is_absolute() +is_alive() +is_assigned() +is_attachment() +is_authenticated() +is_block_device() +is_blocked() +is_canonical() +is_char_device() +is_check_supported() +is_closed() +is_closing() +is_declared_global() +is_dir() +is_enabled() +is_expired() +is_fifo() +is_file() +is_finalizing() +is_finite() +is_free() +is_global +is_global() +is_hop_by_hop() +is_imported() +is_infinite() +is_integer() +is_jython +is_linetouched() +is_link_local +is_local() +is_loopback +is_multicast +is_multipart() +is_namespace() +is_nan() +is_nested() +is_normal() +is_not() +is_not_allowed() +is_optimized() +is_package() +is_parameter() +is_private +is_python_build() +is_qnan() +is_referenced() +is_reserved +is_reserved() +is_resource_enabled() +is_running() +is_set() +is_signed() +is_site_local +is_snan() +is_socket() +is_subnormal() +is_symlink() +is_tarfile() +is_term_resized() +is_tracing() +is_tracked() +is_unspecified +is_wintouched() +is_zero() +is_zipfile() +isabs() +isabstract() +isalnum() +isalpha() +isascii() +isatty() +isawaitable() +isblank() +isblk() +isbuiltin() +ischr() +isclass() +isclose() +iscntrl() +iscode() +iscoroutine() +iscoroutinefunction() +isctrl() +isdatadescriptor() +isdecimal() +isdev() +isdigit() +isdir() +isdisjoint() +isdown() +iselement() +isenabled() +isendwin() +isexpr() +isfifo() +isfile() +isfinite() +isfirstline() +isframe() +isfunction() +isgenerator() +isgeneratorfunction() +isgetsetdescriptor() +isgraph() +isidentifier() +isinf() +isinstance +isinstance() +iskeyword() +isleap() +islice() +islink() +islnk() +islower() +ismemberdescriptor() +ismeta() +ismethod() +ismethoddescriptor() +ismodule() +ismount() +isnan() +isnumeric() +isocalendar() +isoformat() +isolation_level +isoweekday() +isprint() +isprintable() +ispunct() +isreadable() +isrecursive() +isreg() +isroutine() +isspace() +isstdin() +issubclass() +issubset() +issuite() +issuperset() +issym() +istitle() +istraceback() +isub() +isupper() +isvisible() +isxdigit() +item +item() +itemgetter() +items() +itemsize +iter() +iter_attachments() +iter_child_nodes() +iter_fields() +iter_importers() +iter_modules() +iter_parts() +iter_unpack() +iterable +iteration +iterator +iterdecode() +iterdir() +iterdump() +iterencode() +iterfind() +iteritems() +iterkeys() +itermonthdates() +itermonthdays() +itermonthdays2() +iterparse() +itertext() +itertools +itertools_imports +itervalues() +iterweekdays() +itruediv() +ixor() +java_ver() +join() +join_thread() +joining +joinpath() +js_output() +json +json.tool +jump +kbhit() +kevent() +key +key/datum +keyname() +keypad() +keyrefs() +keys() +keyword +keywords +kill() +killchar() +killing +killpg() +kind +knownfiles +kqueue() +kwargs +kwlist +lambda +language +large +last() +lastChild +lastResort +last_accepted +last_traceback +last_type +last_value +lastcmd +lastgroup +lastindex +lastrowid +layout() +lazycache() +lchflags() +lchmod() +lchown() +ldexp() +ldgettext() +ldngettext() +le() +leading +leapdays() +leaveok() +left +left() +left_list +left_only +len +len() +length +length_hint() +lexical +lexists() +lgamma() +lgettext() +lib2to3 +libc_ver() +library +library_dir_option() +library_filename() +library_option() +license +light-weight +limit_denominator() +lin2adpcm() +lin2alaw() +lin2lin() +lin2ulaw() +line +line() +line-buffered +line_buffering +line_num +linecache +lineno +lineno() +lines +linesep +lineterminator +link() +link_executable() +link_shared_lib() +link_shared_object() +linkname +linux_distribution() +list +list() +listMethods() +list_dialects() +list_folders() +listdir() +listen() +listxattr() +literal +literal_eval() +literals +ljust() +ll +ln() +lngettext() +load() +loadTestsFromModule() +loadTestsFromName() +loadTestsFromNames() +loadTestsFromTestCase() +load_cert_chain() +load_default_certs() +load_dh_params() +load_extension() +load_module() +load_package_tests() +load_verify_locations() +loader +loader_state +loads() +local +localName +localcontext() +locale +localeconv() +locals() +localtime() +lock +lock() +lock_held() +locked() +lockf() +locking() +log() +log10() +log1p() +log2() +log_date_time_string() +log_error() +log_exception() +log_message() +log_request() +log_to_stderr() +logb() +logging +logging.config +logging.handlers +logical +logical_and() +logical_invert() +logical_or() +logical_xor() +login() +login_cram_md5() +lognormvariate() +logout() +long +longMessage +longname() +lookup() +lookup_error() +loop +loop() +lower() +lru_cache() +lseek() +lshift() +lstat() +lstrip() +lsub() +lt() +lzma +mac_ver() +machine +machine() +machinery +macpath +macros +mailbox +mailcap +mailfrom +main() +main_thread() +mainloop() +maintype +major +major() +makeLogRecord() +makePickle() +makeRecord() +makeSocket() +make_alternative() +make_archive() +make_bad_fd() +make_cookies() +make_file() +make_header() +make_mixed() +make_msgid() +make_parser() +make_related() +make_server() +make_table() +make_tarball() +make_zipfile() +makedev() +makedirs() +makeelement() +makefile() +maketrans() +malloc() +management +manager +mangle_from_ +mangling +map +map() +mapLogRecord() +mapPriority() +map_async() +map_table_b2() +map_table_b3() +map_to_type() +mapping +mapping() +maps +maps() +marshal +marshalling +masking +match() +match_hostname() +math +matmul() +matrix +max +max() +maxDiff +max_count +max_line_length +max_lines +max_mag() +max_prefixlen +maxarray +maxdeque +maxdict +maxfrozenset +maxlen +maxlevel +maxlist +maxlong +maxother +maxpp() +maxset +maxsize +maxstring +maxtuple +maxunicode +mbox +mboxMessage +mean() +median() +median_grouped() +median_high() +median_low() +membership +memmove() +memoryview +memset() +merge() +message +message_from_binary_file() +message_from_bytes() +message_from_file() +message_from_string() +messages +meta +meta() +meta_path +metaclass +metavar +method +method) +methodHelp() +methodSignature() +method_calls +methodattrs +methodcaller() +methods +microsecond +mime.types +mimetypes +min +min() +min_mag() +minmax() +minor +minor() +minus +minus() +minute +mirrored() +misc_header +mkd() +mkdir() +mkdtemp() +mkfifo() +mknod() +mkpath() +mksalt() +mkstemp() +mktemp() +mktime() +mktime_tz() +mlsd() +mmap +mock_add_spec() +mock_calls +mock_open() +mod() +mode +mode() +model +modf() +modified() +modify() +module +module_for_loader() +module_from_spec() +module_repr() +modulefinder +modules +modulo +monotonic() +month +month() +month_abbr +month_name +monthcalendar() +monthdatescalendar() +monthdays2calendar() +monthdayscalendar() +monthrange() +most_common() +mouseinterval() +mousemask() +move() +move_file() +move_to_end() +mro() +msg +msg() +msi +msilib +msvcrt +mt_interact() +mtime +mtime() +mul() +multiplication +multiply() +multiprocessing +multiprocessing.Manager() +multiprocessing.connection +multiprocessing.dummy +multiprocessing.managers +multiprocessing.pool +multiprocessing.sharedctypes +mutable +mvderwin() +mvwin() +myrights() +n_waiting +name +name() +name. +name2codepoint +named +namedtuple() +namelist() +nameprep() +namer +namereplace_errors() +names +namespace +namespace() +namespaceURI +nan +napms() +nargs +nbytes +ndiff() +ndim +ne +ne() +needs_input +neg() +negation +nested +netrc +netscape +network +network_address +new +new() +new-style +new_alignment() +new_child() +new_class() +new_compiler() +new_event_loop() +new_font() +new_margin() +new_module() +new_panel() +new_spacing() +new_styles() +newer() +newer_group() +newer_pairwise() +newgroups() +newlines +newnews() +newpad() +newwin() +next +next() +nextSibling +next_minus() +next_plus() +next_toward() +nextfile() +nextkey() +ngettext() +nice() +nis +nl() +nl_langinfo() +nlargest() +nlst() +nntp_implementation +nntp_version +nntplib +no_proxy +no_type_check() +no_type_check_decorator() +nocbreak() +node() +nodeName +nodeType +nodeValue +nodelay() +noecho() +non-profit +nonblock() +nonl() +nonlocal +nonzero +noop() +noqiflush() +noraw() +normalize() +normalvariate() +normcase() +normpath() +not +not_() +notation +notationDecl() +notations +notify() +notify_all() +notimeout() +noutrefresh() +now() +nsmallest() +ntohl() +ntohs() +ntransfercmd() +null +num_addresses +number +number_class() +numbers +numerator +numeric +numeric() +numinput() +numliterals +obj +object +object.__slots__ +object_filenames() +objects +obufcount() +obuffree() +oct() +octal +octdigits +of +offset +on +onclick() +ondrag() +one +onecmd() +onkey() +onkeypress() +onkeyrelease() +online +onrelease() +onscreenclick() +ontimer() +open +open() +open_connection() +open_new() +open_new_tab() +open_osfhandle() +open_unix_connection() +open_unknown() +openfp() +openlog() +openmixer() +openpty() +operation +operations +operator +operators +opmap +opname +optimize() +option +options +options() +optionxform() +optparse +or +or_() +ord +ord() +order +ordered_attributes +origin +origin_req_host +origin_server +os +os.makedirs() +os.path +os_environ +ossaudiodev +outfile +output +output() +output_charset +output_charset() +output_codec +output_difference() +over +over() +overlaps() +overlay() +overloading +overwrite() +owner() +pack() +pack_array() +pack_bytes() +pack_double() +pack_farray() +pack_float() +pack_fopaque() +pack_fstring() +pack_into() +pack_list() +pack_opaque() +pack_string() +package +packed +packing +page +pair +pair_content() +pair_number() +parameter +parameters +params +pardir +paren +parent +parent() +parentNode +parenthesized +parents +paretovariate() +parse() +parseString() +parse_and_bind() +parse_args() +parse_config_h() +parse_header() +parse_known_args() +parse_multipart() +parse_qs() +parse_qsl() +parseaddr() +parsebytes() +parsedate() +parsedate_to_datetime() +parsedate_tz() +parser +parsestr() +parsing +partial +partial() +partialmethod +parties +partition() +pass +pass_() +patch() +patch.dict() +patch.multiple() +patch.object() +patch.stopall() +path +path_hook() +path_hooks +path_importer_cache +path_mtime() +path_return_ok() +path_stats() +pathconf() +pathconf_names +pathlib +pathname +pathname2url() +paths +pathsep +pattern +pause() +pause_reading() +pause_writing() +pax_headers +pbkdf2_hmac() +pd() +pdb +peek() +peer +pen() +pencolor() +pending +pending() +pendown() +pensize() +penup() +perf_counter() +permutations() +persistence +persistent +persistent_id +persistent_id() +persistent_load +persistent_load() +pformat() +phase() +physical +pi +pickle +pickle() +pickletools +pickling +pid +pipe() +pipe2() +pipe_connection_lost() +pipe_data_received() +pipes +pkgutil +placeholder +platform +platform() +plist +plistlib +plock() +plus +plus() +pm() +point +pointer() +polar() +poll() +pop() +pop_alignment() +pop_all() +pop_font() +pop_margin() +pop_source() +pop_style() +popen() +popitem() +popleft() +poplib +port +port_specified +portion +pos +pos() +position +position() +positional +posix +posix_fadvise() +posix_fallocate() +post() +post_mortem() +post_setup() +postcmd() +postloop() +pow +pow() +power() +pp +pprint +pprint() +prcal() +pread() +preamble +precedence +precmd() +prefix +prefixlen +preloop() +prepare() +prepare_class() +prepare_input_source() +prepend() +preprocess() +prev() +previousSibling +primary +print +print() +print_callees() +print_callers() +print_directory() +print_environ() +print_environ_usage() +print_exc() +print_exception() +print_form() +print_help() +print_last() +print_stack() +print_stats() +print_tb() +print_usage() +print_version() +printable +printdir() +printf-style +priority +private +prlimit() +prmonth() +procedure +process +process() +process_exited() +process_message() +process_request() +process_time() +processes +processingInstruction() +processor +processor() +product() +profile +profiler +profiling +program +prompt +prompt_user_passwd() +prompts +propagate +property +property_declaration_handler +property_dom_node +property_lexical_handler +property_xml_string +prot_c() +prot_p() +proto +protocol +protocol_version +provisional +proxy() +proxyauth() +pryear() +ps1 +ps2 +pstats +pstdev() +pthread_kill() +pthread_sigmask() +pthreads +pty +pu() +publicId +punctuation +purge() +push() +push_alignment() +push_font() +push_margin() +push_source() +push_style() +push_token() +push_with_producer() +pushbutton() +put() +put_nowait() +putch() +putenv() +putheader() +putp() +putrequest() +putwch() +putwin() +pvariance() +pwd +pwd() +pwrite() +py_compile +py_object +pyclbr +pydoc +pyexpat +python_branch() +python_build() +python_compiler() +python_implementation() +python_revision() +python_version() +python_version_tuple() +qiflush() +qsize() +qualified +quantize() +queue +quick_ratio() +quit +quit() +quopri +quote() +quote_from_bytes() +quote_plus() +quoteattr() +quotechar +quoted-printable +quotes +quoting +radians() +radiogroup() +radix() +raise +raise_on_defect +raising +randint() +random +random() +randrange() +range +ratecv() +ratio() +raw +raw() +raw_data_manager +raw_decode() +raw_input +raw_input() +rcpttos +re +read() +read1() +readPlist() +readPlistFromBytes() +read_all() +read_byte() +read_bytes() +read_dict() +read_eager() +read_environ() +read_events() +read_file() +read_history_file() +read_init_file() +read_lazy() +read_mime_types() +read_sb_data() +read_some() +read_string() +read_text() +read_token() +read_until() +read_very_eager() +read_very_lazy() +read_windows_registry() +readable() +readall() +reader() +readexactly() +readfp() +readframes() +readinto() +readinto1() +readline +readline() +readlines() +readlink() +readmodule() +readmodule_ex() +readonly +readv() +ready() +real +real_quick_ratio() +realloc() +realpath() +reason +reattach() +rebinding +reccontrols() +received_data +received_lines +recent() +records +rect() +rectangle() +recursive_repr() +recv() +recv_bytes() +recv_bytes_into() +recv_into() +recvfrom() +recvfrom_into() +recvmsg() +recvmsg_into() +redirect_request() +redirect_stderr() +redirect_stdout() +redisplay() +redrawln() +redrawwin() +reduce +reduce() +ref +reference +refold_source +refresh() +register() +registerDOMImplementation() +registerResult() +register_adapter() +register_archive_format() +register_converter() +register_defect() +register_dialect() +register_error() +register_function() +register_instance() +register_introspection_functions() +register_multicall_functions() +register_namespace() +register_optionflag() +register_shape() +register_unpack_format() +regular +relative +relative_to() +release() +release_lock() +reload +reload() +relpath() +remainder() +remainder_near() +remove() +removeAttribute() +removeAttributeNS() +removeAttributeNode() +removeChild() +removeFilter() +removeHandler() +removeResult() +remove_done_callback() +remove_flag() +remove_folder() +remove_header() +remove_history_item() +remove_label() +remove_option() +remove_pyc() +remove_reader() +remove_section() +remove_sequence() +remove_signal_handler() +remove_tree() +remove_writer() +removedirs() +removexattr() +rename() +renames +renames() +reorganize() +repeat() +repetition +replace() +replaceChild() +replace_errors() +replace_header() +replace_history_item() +replace_whitespace +report() +report_failure() +report_full_closure() +report_partial_closure() +report_start() +report_success() +report_unexpected_exception() +repr +repr() +repr1() +representation +reprlib +request() +request_queue_size +request_uri() +request_version +requestline +requires() +reserved +reset() +reset_mock() +reset_prog_mode() +reset_shell_mode() +resetbuffer() +resetlocale() +resetscreen() +resetty() +resetwarnings() +resize() +resize_term() +resizemode() +resizeterm() +resolution +resolve() +resolveEntity() +resolve_name() +resource +response +response() +responses +restart +restore() +restricted +restype +result() +results() +resume_reading() +resume_writing() +retr() +retrbinary() +retrieve() +retrlines() +return +return_annotation +return_ok() +return_value +returncode +reverse() +reverse_order() +reverse_pointer +reversed() +revert() +rewind() +rfc2109 +rfc2109_as_netscape +rfc2965 +rfc822_escape() +rfile +rfind() +rgb_to_hls() +rgb_to_hsv() +rgb_to_yiq() +rglob() +right +right() +right_list +right_only +rindex() +rjust() +rlcompleter +rlecode_hqx() +rledecode_hqx() +rmd() +rmdir() +rms() +rmtree() +robots.txt +rollback() +rotate() +rotation_filename() +rotator +round +round() +row_factory +rowcount +rpartition() +rpc_paths +rpop() +rset() +rshift() +rsplit() +rstrip() +rt() +ruler +run +run() +run_coroutine_threadsafe() +run_docstring_examples() +run_doctest() +run_forever() +run_in_executor() +run_module() +run_path() +run_script() +run_setup() +run_unittest() +run_until_complete() +run_with_locale() +runcall() +runcode() +runctx() +runeval() +runfunc() +running() +runpy +runsource() +runtime_library_dir_option() +safe_substitute() +saferepr() +same_files +same_quantum() +samefile() +sameopenfile() +samestat() +sample() +save() +savetty() +scaleb() +scandir() +scanf() +sched +sched_get_priority_max() +sched_get_priority_min() +sched_getaffinity() +sched_getparam() +sched_getscheduler() +sched_param +sched_priority +sched_rr_get_interval() +sched_setaffinity() +sched_setparam() +sched_setscheduler() +sched_yield() +scheduler +scheduling +schema +scope +screensize() +script +script_from_examples() +scripts +scroll() +scrollok() +sdterr +search +search() +second +sections() +secure +security +see() +seed() +seek() +seekable() +seen_greeting +select +select() +selected_alpn_protocol() +selected_npn_protocol() +selection +selection() +selection_add() +selection_remove() +selection_set() +selection_toggle() +selector +selectors +semantics +semaphores +send() +send_bytes() +send_error() +send_flowing_data() +send_header() +send_hor_rule() +send_label_data() +send_line_break() +send_literal_data() +send_message() +send_paragraph() +send_response() +send_response_only() +send_signal() +sendall() +sendcmd() +sendfile() +sendmail() +sendmsg() +sendto() +sentinel +sep +sequence +sequence2st() +sequences +serializing +serve_forever() +server +server_activate() +server_address +server_bind() +server_close() +server_hostname +server_side +server_software +server_version +service_actions() +session_stats() +set +set() +setAttribute() +setAttributeNS() +setAttributeNode() +setAttributeNodeNS() +setByteStream() +setCharacterStream() +setContentHandler() +setDTDHandler() +setDaemon() +setDocumentLocator() +setEncoding() +setEntityResolver() +setErrorHandler() +setFeature() +setFormatter() +setLevel() +setLocale() +setLogRecordFactory() +setLoggerClass() +setMaxConns() +setName() +setProperty() +setPublicId() +setSystemId() +setTarget() +setTimeout() +setUp() +setUpClass() +set_all() +set_allowed_domains() +set_alpn_protocols() +set_app() +set_authorizer() +set_blocked_domains() +set_blocking() +set_boundary() +set_break() +set_charset() +set_children() +set_ciphers() +set_completer() +set_completer_delims() +set_completion_display_matches_hook() +set_content() +set_continue() +set_cookie() +set_cookie_if_ok() +set_coroutine_wrapper() +set_current() +set_data() +set_date() +set_debug() +set_debuglevel() +set_default_executor() +set_default_type() +set_default_verify_paths() +set_defaults() +set_ecdh_curve() +set_errno() +set_event_loop() +set_event_loop_policy() +set_exception() +set_exception_handler() +set_executable() +set_executables() +set_flags() +set_from() +set_handle_inheritable() +set_history_length() +set_include_dirs() +set_info() +set_inheritable() +set_labels() +set_last_error() +set_libraries() +set_library_dirs() +set_link_objects() +set_literal +set_loader() +set_next() +set_nonstandard_attr() +set_npn_protocols() +set_ok() +set_option_negotiation_callback() +set_output_charset() +set_package() +set_param() +set_pasv() +set_payload() +set_policy() +set_position() +set_pre_input_hook() +set_progress_handler() +set_proxy() +set_python_build() +set_quit() +set_recsrc() +set_result() +set_return() +set_running_or_notify_cancel() +set_runtime_library_dirs() +set_seq1() +set_seq2() +set_seqs() +set_sequences() +set_server_documentation() +set_server_name() +set_server_title() +set_servername_callback() +set_spacing() +set_start_method() +set_startup_hook() +set_step() +set_subdir() +set_task_factory() +set_terminator() +set_threshold() +set_trace() +set_trace_callback() +set_transport() +set_tunnel() +set_type() +set_unittest_reportflags() +set_unixfrom() +set_until() +set_url() +set_usage() +set_userptr() +set_visible() +set_wakeup_fd() +set_write_buffer_limits() +setacl() +setannotation() +setattr() +setblocking() +setcbreak() +setcheckinterval() +setcomptype() +setcontext() +setdefault() +setdefaulttimeout() +setdlopenflags() +setegid() +seteuid() +setfirstweekday() +setfmt() +setframerate() +setgid() +setgroups() +seth() +setheading() +sethostname() +setitem() +setitimer() +setlocale() +setlogmask() +setmark() +setmode() +setnchannels() +setnframes() +setparameters() +setparams() +setpassword() +setpgid() +setpgrp() +setpos() +setposition() +setpriority() +setprofile() +setquota() +setraw() +setrecursionlimit() +setregid() +setresgid() +setresuid() +setreuid() +setrlimit() +setsampwidth() +setscrreg() +setsid() +setsockopt() +setstate() +setswitchinterval() +setsyx() +settiltangle() +settimeout() +setting +settrace() +settscdump() +setuid() +setundobuffer() +setup() +setup_environ() +setup_python() +setup_scripts() +setup_testing_defaults() +setupterm() +setworldcoordinates() +setx() +setxattr() +sety() +shape +shape() +shapesize() +shapetransform() +share() +shared_ciphers() +shared_object_filename() +shearfactor() +shelve +shield() +shift() +shift_path_info() +shifting +shlex +shortDescription() +shorten() +shouldFlush() +shouldStop +show() +show_code() +show_compilers() +showsyntaxerror() +showtraceback() +showturtle() +showwarning() +shuffle() +shutdown +shutdown() +shutil +side_effect +siginterrupt() +signal +signal() +signalling +signature +signature() +sigpending() +sigtimedwait() +sigwait() +sigwaitinfo() +simple +simplefilter() +sin() +single +singledispatch() +singleton +sinh() +site +site-packages +sitecustomize +sixtofour +size +size() +size_diff +sizeof() +skip() +skipIf() +skipTest() +skipUnless() +skip_unless_symlink() +skipinitialspace +skipped +skippedEntity() +slave() +sleep() +slice +slicing +smtp_server +smtp_state +smtpd +smtplib +sndhdr +sniff() +sock_accept() +sock_connect() +sock_recv() +sock_sendall() +socket +socket() +socket_type +socketpair() +sockets +socketserver +sort() +sortTestMethodsUsing +sort_stats() +sorted() +source +source_from_cache() +source_to_code() +sourcehook() +space +span() +spawn() +spawnl() +spawnle() +spawnlp() +spawnlpe() +spawnv() +spawnve() +spawnvp() +spawnvpe() +spec +spec_from_file_location() +spec_from_loader() +special +specified_attributes +speed() +split() +split_quoted() +splitdrive() +splitext() +splitlines() +splitunc() +sprintf-style +spwd +sqlite3 +sqlite_version +sqlite_version_info +sqrt() +ssl +ssl_version +st() +st2list() +st2tuple() +st_atime +st_atime_ns +st_birthtime +st_blksize +st_blocks +st_creator +st_ctime +st_ctime_ns +st_dev +st_file_attributes +st_flags +st_gen +st_gid +st_ino +st_mode +st_mtime +st_mtime_ns +st_nlink +st_rdev +st_rsize +st_size +st_type +st_uid +stack +stack() +stack_effect() +stack_size() +stackable +stamp() +standard +standard_b64decode() +standard_b64encode() +standarderror +standend() +standout() +starmap() +starmap_async() +start +start() +startDocument() +startElement() +startElementNS() +startPrefixMapping() +startTest() +startTestRun() +start_color() +start_component() +start_new_thread() +start_server() +start_unix_server() +startfile() +startswith() +starttls() +stat +stat() +stat_float_times() +stat_result +state() +statement +staticmethod +staticmethod() +statistics +statistics() +status +status() +statvfs() +stderr +stdev() +stdin +stdio +stdout +step +step() +stereocontrols() +stls() +stop +stop() +stopListening() +stopTest() +stopTestRun() +stop_here() +storbinary() +store() +storlines() +str +str() +str.splitlines +strcoll() +streamreader +streams +streamwriter +strerror +strerror() +strftime() +strict +strict_domain +strict_errors() +strict_ns_domain +strict_ns_set_initial_dollar +strict_ns_set_path +strict_ns_unverifiable +strict_rfc2965_unverifiable +strides +string +string_at() +stringprep +strings +strip() +strip_dirs() +stripspaces +strptime() +strtobool() +struct +struct_time +structure +structures +strxfrm() +style +sub() +subTest() +sub_commands +subclassing +subdirs +submit() +submodule_search_locations +subn() +subnets() +suboffsets +subpad() +subprocess +subprocess_exec() +subprocess_shell() +subscribe() +subscript +subscription +subsequent_indent +subst_vars() +substitute() +subtract() +subtraction +subtype +subwin() +successful() +suffix_map +suite +suite() +suiteClass +sum() +sum_list() +sum_sequence() +summarize() +summarize_address_range() +sunau +super +super() +supernet() +supports_bytes_environ +supports_dir_fd +supports_effective_ids +supports_fd +supports_follow_symlinks +supports_unicode_filenames +suppress() +swapcase() +sym_name +symbol +symlink() +symlink_to() +symmetric_difference() +symmetric_difference_update() +symtable +symtable() +sync() +syncdown() +synchronized() +syncok() +syncup() +syntax +sys +sys.exc_info +sys.last_traceback +sys.meta_path +sys.modules +sys.path +sys.path_hooks +sys.path_importer_cache +sys.stderr +sys.stdin +sys.stdout +sys_exc +sys_version +sysconf() +sysconf_names +sysconfig +syslog +syslog() +system() +systemId +system_alias() +tab +tab() +tabnanny +tabs() +tabsize +tabular +tag +tagName +tag_bind() +tag_configure() +tag_has() +tail +take_snapshot() +takewhile() +tan() +tanh() +tarfile +target +task_done() +tb_frame +tb_lasti +tb_lineno +tb_locals +tb_next +tbreak +tcdrain() +tcflow() +tcflush() +tcgetattr() +tcgetpgrp() +tcsendbreak() +tcsetattr() +tcsetpgrp() +tearDown() +tearDownClass() +tee() +tell() +telnetlib +temp_cwd() +temp_dir() +temp_umask() +tempdir +tempfile +template +temporary +teredo +termattrs() +terminal_size +terminate() +termination +termios +termname() +terms +ternary +test +test() +test.support +testMethodPrefix +testfile() +testmod() +tests +testsRun +testsource() +testzip() +text +text() +text_factory +textdomain() +textinput() +textwrap +theme_create() +theme_names() +theme_settings() +theme_use() +thread() +thread_info +threading +threads +throw +throw() +tigetflag() +tigetnum() +tigetstr() +tilt() +tiltangle() +time +time() +timedelta +timegm() +timeit +timeit() +timeout +timeout() +times() +timestamp() +timetuple() +timetz() +timezone +title() +tixCommand +tix_addbitmapdir() +tix_cget() +tix_configure() +tix_filedialog() +tix_getbitmap() +tix_getimage() +tix_option_get() +tix_resetoptions() +tkinter +tkinter.scrolledtext +tkinter.tix +tkinter.ttk +to_bytes() +to_eng_string() +to_integral() +to_integral_exact() +to_integral_value() +to_sci_string() +tobuf() +tobytes() +today() +tofile() +tok_name +token +tokeneater() +tokenize +tokenize() +tolist() +tomono() +toordinal() +top() +top_panel() +toprettyxml() +tostereo() +tostring() +tostringlist() +total_changes +total_ordering() +total_seconds() +totuple() +touch() +touchline() +touchwin() +tounicode() +towards() +toxml() +tp_as_async +tp_as_mapping +tp_as_number +tp_as_sequence +tparm() +trace +trace() +trace_dispatch() +traceback +traceback_limit +tracebacklimit +tracebacks +tracemalloc +tracer() +traces +trailing +transfercmd() +translate() +translation() +transport +traversal +traverseproc +triangular() +triple-quoted +true +truediv() +trunc() +truncate() +truth +truth() +try +ttk +tty +ttyname() +tuple +tuple2st() +tuple_params +turnoff_sigfpe() +turnon_sigfpe() +turtle +turtledemo +turtles() +turtlesize() +type +typeahead() +typecode +typecodes +typed_subpart_iterator() +types +types_map +types_map_inv +typing +tzinfo +tzname +tzname() +tzset() +u-LAW +ucd_3_2_0 +udata +uid +uid() +uidl() +ulaw2lin() +umask() +unalias +uname +uname() +unary +unbinding +unbuffered +unconsumed_tail +unctrl() +undefine_macro() +undisplay +undo() +undobufferentries() +undoc_header +unescape() +unexpectedSuccesses +unget_wch() +ungetch() +ungetmouse() +ungetwch() +unhexlify() +unicode +unicodedata +unidata_version +unified_diff() +uniform() +union() +unique() +unittest +unittest-discover +unittest.mock +universal +unix_dialect +unknown_decl() +unknown_open() +unlink() +unlock() +unpack() +unpack_archive() +unpack_array() +unpack_bytes() +unpack_double() +unpack_farray() +unpack_float() +unpack_fopaque() +unpack_from() +unpack_fstring() +unpack_list() +unpack_opaque() +unpack_string() +unparsedEntityDecl() +unquote() +unquote_plus() +unquote_to_bytes() +unreachable +unreadline() +unrecognized +unregister() +unregister_archive_format() +unregister_dialect() +unregister_unpack_format() +unset() +unsetenv() +unsubscribe() +until +untokenize() +untouchwin() +unused_data +unverifiable +unwrap() +up +up() +update() +update_authenticated() +update_lines_cols() +update_panels() +update_visible() +update_wrapper() +updated +upper() +urandom() +url +url2pathname() +urlcleanup() +urldefrag() +urlencode() +urljoin() +urllib +urllib.error +urllib.parse +urllib.request +urllib.response +urllib.robotparser +urlopen() +urlparse() +urlretrieve() +urlsafe_b64decode() +urlsafe_b64encode() +urlsplit() +urlunparse() +urlunsplit() +urn +use_default_colors() +use_env() +use_rawinput +user +user() +user-defined +user_call() +user_exception() +user_line() +user_return() +usercustomize +username +userptr() +using +utc +utcfromtimestamp() +utcnow() +utcoffset() +utctimetuple() +utf8 +utf8() +utf8_enabled +utility +utime() +uu +uuid +uuid1 +uuid1() +uuid3 +uuid3() +uuid4 +uuid4() +uuid5 +uuid5() +v4_int_to_packed() +v6_int_to_packed() +validator() +value +value_decode() +value_encode() +valuerefs() +values +values() +variable +variables +variance() +variant +vars() +vbar +venv +verbose +verify() +verify_flags +verify_mode +verify_request() +version +version() +version_info +version_string() +vformat() +view +viewer +virtual +visit() +visitproc +vline() +voidcmd() +volume +vonmisesvariate() +wShowWindow +wait() +wait3() +wait4() +wait_closed() +wait_for() +waitid() +waitpid() +walk() +walk_packages() +walk_stack() +walk_tb() +walking +want +warn() +warn_explicit() +warning() +warnings +warnoptions +wasSuccessful() +wave +weakref +webbrowser +weekday() +weekheader() +weibullvariate() +wfile +what() +whathdr() +whatis +where +which() +whichdb() +while +whitespace +whitespace_split +width +width() +wildcard +win32_ver() +window +window() +window_height() +window_width() +winerror +winreg +winsound +winver +with +with_hostmask +with_name() +with_netmask +with_prefixlen +with_suffix() +with_traceback() +word +wordchars +wrap() +wrap_bio() +wrap_socket() +wrap_text() +wrapper() +wraps() +writable() +write() +writePlist() +writePlistToBytes() +write_byte() +write_bytes() +write_docstringdict() +write_eof() +write_file() +write_history_file() +write_results() +write_text() +writeall() +writeframes() +writeframesraw() +writeheader() +writelines() +writepy() +writer +writer() +writerow() +writerows() +writestr() +writev() +writexml() +writing +ws_comma +wsgi_file_wrapper +wsgi_multiprocess +wsgi_multithread +wsgi_run_once +wsgiref +wsgiref.handlers +wsgiref.headers +wsgiref.simple_server +wsgiref.util +wsgiref.validate +wstring_at() +xatom() +xcor() +xdrlib +xhdr() +xml +xml.dom +xml.dom.minidom +xml.dom.pulldom +xml.etree.ElementTree +xml.parsers.expat +xml.parsers.expat.errors +xml.parsers.expat.model +xml.sax +xml.sax.handler +xml.sax.saxutils +xml.sax.xmlreader +xmlcharrefreplace_errors() +xmlrpc.client +xmlrpc.server +xor +xor() +xover() +xpath() +xrange +xreadlines +xview() +ycor() +year +yeardatescalendar() +yeardays2calendar() +yeardayscalendar() +yield +yiq_to_rgb() +yview() +zfill() +zip +zip() +zip_longest() +zipapp +zipfile +zipfile.ZipFile.open +zipimport +zipimporter +zlib diff --git a/ICS4U-PCP_GIT/words.dat b/ICS4U-PCP_GIT/words.dat new file mode 100755 index 0000000..b3872d7 --- /dev/null +++ b/ICS4U-PCP_GIT/words.dat @@ -0,0 +1,1000 @@ +the +of +to +and +a +in +is +it +you +that +he +was +for +on +are +with +as +I +his +they +be +at +one +have +this +from +or +had +by +hot +word +but +what +some +we +can +out +other +were +all +there +when +up +use +your +how +said +an +each +she +which +do +their +time +if +will +way +about +many +then +them +write +would +like +so +these +her +long +make +thing +see +him +two +has +look +more +day +could +go +come +did +number +sound +no +most +people +my +over +know +water +than +call +first +who +may +down +side +been +now +find +any +new +work +part +take +get +place +made +live +where +after +back +little +only +round +man +year +came +show +every +good +me +give +our +under +name +very +through +just +form +sentence +great +think +say +help +low +line +differ +turn +cause +much +mean +before +move +right +boy +old +too +same +tell +does +set +three +want +air +well +also +play +small +end +put +home +read +hand +port +large +spell +add +even +land +here +must +big +high +such +follow +act +why +ask +men +change +went +light +kind +off +need +house +picture +try +us +again +animal +point +mother +world +near +build +self +earth +father +head +stand +own +page +should +country +found +answer +school +grow +study +still +learn +plant +cover +food +sun +four +between +state +keep +eye +never +last +let +thought +city +tree +cross +farm +hard +start +might +story +saw +far +sea +draw +left +late +run +don't +while +press +close +night +real +life +few +north +open +seem +together +next +white +children +begin +got +walk +example +ease +paper +group +always +music +those +both +mark +often +letter +until +mile +river +car +feet +care +second +book +carry +took +science +eat +room +friend +began +idea +fish +mountain +stop +once +base +hear +horse +cut +sure +watch +color +face +wood +main +enough +plain +girl +usual +young +ready +above +ever +red +list +though +feel +talk +bird +soon +body +dog +family +direct +pose +leave +song +measure +door +product +black +short +numeral +class +wind +question +happen +complete +ship +area +half +rock +order +fire +south +problem +piece +told +knew +pass +since +top +whole +king +space +heard +best +hour +better +true +during +hundred +five +remember +step +early +hold +west +ground +interest +reach +fast +verb +sing +listen +six +table +travel +less +morning +ten +simple +several +vowel +toward +war +lay +against +pattern +slow +center +love +person +money +serve +appear +road +map +rain +rule +govern +pull +cold +notice +voice +unit +power +town +fine +certain +fly +fall +lead +cry +dark +machine +note +wait +plan +figure +star +box +noun +field +rest +correct +able +pound +done +beauty +drive +stood +contain +front +teach +week +final +gave +green +oh +quick +develop +ocean +warm +free +minute +strong +special +mind +behind +clear +tail +produce +fact +street +inch +multiply +nothing +course +stay +wheel +full +force +blue +object +decide +surface +deep +moon +island +foot +system +busy +test +record +boat +common +gold +possible +plane +stead +dry +wonder +laugh +thousand +ago +ran +check +game +shape +equate +hot +miss +brought +heat +snow +tire +bring +yes +distant +fill +east +paint +language +among +grand +ball +yet +wave +drop +heart +am +present +heavy +dance +engine +position +arm +wide +sail +material +size +vary +settle +speak +weight +general +ice +matter +circle +pair +include +divide +syllable +felt +perhaps +pick +sudden +count +square +reason +length +represent +art +subject +region +energy +hunt +probable +bed +brother +egg +ride +cell +believe +fraction +forest +sit +race +window +store +summer +train +sleep +prove +lone +leg +exercise +wall +catch +mount +wish +sky +board +joy +winter +sat +written +wild +instrument +kept +glass +grass +cow +job +edge +sign +visit +past +soft +fun +bright +gas +weather +month +million +bear +finish +happy +hope +flower +clothe +strange +gone +jump +baby +eight +village +meet +root +buy +raise +solve +metal +whether +push +seven +paragraph +third +shall +held +hair +describe +cook +floor +either +result +burn +hill +safe +cat +century +consider +type +law +bit +coast +copy +phrase +silent +tall +sand +soil +roll +temperature +finger +industry +value +fight +lie +beat +excite +natural +view +sense +ear +else +quite +broke +case +middle +kill +son +lake +moment +scale +loud +spring +observe +child +straight +consonant +nation +dictionary +milk +speed +method +organ +pay +age +section +dress +cloud +surprise +quiet +stone +tiny +climb +cool +design +poor +lot +experiment +bottom +key +iron +single +stick +flat +twenty +skin +smile +crease +hole +trade +melody +trip +office +receive +row +mouth +exact +symbol +die +least +trouble +shout +except +wrote +seed +tone +join +suggest +clean +break +lady +yard +rise +bad +blow +oil +blood +touch +grew +cent +mix +team +wire +cost +lost +brown +wear +garden +equal +sent +choose +fell +fit +flow +fair +bank +collect +save +control +decimal +gentle +woman +captain +practice +separate +difficult +doctor +please +protect +noon +whose +locate +ring +character +insect +caught +period +indicate +radio +spoke +atom +human +history +effect +electric +expect +crop +modern +element +hit +student +corner +party +supply +bone +rail +imagine +provide +agree +thus +capital +won't +chair +danger +fruit +rich +thick +soldier +process +operate +guess +necessary +sharp +wing +create +neighbor +wash +bat +rather +crowd +corn +compare +poem +string +bell +depend +meat +rub +tube +famous +dollar +stream +fear +sight +thin +triangle +planet +hurry +chief +colony +clock +mine +tie +enter +major +fresh +search +send +yellow +gun +allow +print +dead +spot +desert +suit +current +lift +rose +continue +block +chart +hat +sell +success +company +subtract +event +particular +deal +swim +term +opposite +wife +shoe +shoulder +spread +arrange +camp +invent +cotton +born +determine +quart +nine +truck +noise +level +chance +gather +shop +stretch +throw +shine +property +column +molecule +select +wrong +gray +repeat +require +broad +prepare +salt +nose +plural +anger +claim +continent +oxygen +sugar +death +pretty +skill +women +season +solution +magnet +silver +thank +branch +match +suffix +especially +fig +afraid +huge +sister +steel +discuss +forward +similar +guide +experience +score +apple +bought +led +pitch +coat +mass +card +band +rope +slip +win +dream +evening +condition +feed +tool +total +basic +smell +valley +nor +double +seat +arrive +master +track +parent +shore +division +sheet +substance +favor +connect +post +spend +chord +fat +glad +original +share +station +dad +bread +charge +proper +bar +offer +segment +slave +duck +instant +market +degree +populate +chick +dear +enemy +reply +drink +occur +support +speech +nature +range +steam +motion +path +liquid +log +meant +quotient +teeth +shell +neck From 86850e35aa3ad610a442e56ed96810ad2a77f3d3 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Tue, 14 Jun 2016 13:45:33 -0400 Subject: [PATCH 28/39] able to open python, and words files --- ICS4U-PCP_GIT/ICS4U-PCP.py | 45 +++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 0604943..4a67d4e 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -1,13 +1,14 @@ from random import randint import curses.panel import time - +from time import sleep import sys -import threading +#import threading # ------------------------------------------------------- # Global Varibles # ------------------------------------------------------- + IS_DEBUG = True WORD_START_PAUSE = 0.2 # Initial word speed. Lower is Faster ENTER_Y_OFFSET = 5 @@ -18,10 +19,9 @@ MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X -REQ_Y = 55/2 # required screen size Y -REQ_X = 200/2 # required screen size X -DEBUG_CURR_Y = 50 -DEBUG_CURR_X = 3 +REQ_Y = 55/2 # required screen size Y +REQ_X = 200/2 # required screen size X + ENG_WORDS = ["apple","hi","hello","aaron",""] ENG_WORDS_LEN = 0 PY_WORDS = [] @@ -150,13 +150,6 @@ def debug(msg, level): # Initializing value saved ="" -def my_raw_input(r, c, prompt_string): - curses.echo() - STDSCR.addstr(r, c, prompt_string) - STDSCR.refresh() - input = STDSCR.getstr(r + 1, c, 20) - return input # - def GamePlay(): while True: @@ -219,15 +212,18 @@ def GamePlay(): if EXIT_GAME: break + #------------------------------------------------------------------------------ # main #------------------------------------------------------------------------------ + def main(stdscr): """ set up for the game to start and runs by calling the main page :param stdscr: window - standard window screen :return: None """ + # make colors curses.init_pair(1,curses.COLOR_RED,curses.COLOR_BLACK) curses.init_pair(2,curses.COLOR_GREEN,curses.COLOR_BLACK) curses.init_pair(3,curses.COLOR_YELLOW,curses.COLOR_BLACK) @@ -237,8 +233,9 @@ def main(stdscr): curses.init_pair(7,curses.COLOR_BLUE,curses.COLOR_BLACK) global EXIT_GAME + global is_word_down_thread_stop - #mouse cursor + # mouse cursor set - none curses.curs_set(0) # Set up for debug @@ -260,10 +257,9 @@ def main(stdscr): while 1: # re-initialize EXIT_GAME = False - # main game screen - rc = mainGameScreen() + rc = mainGameScreen() # reset if rc == 4: STDSCR.clear(); STDSCR.refresh() @@ -293,7 +289,6 @@ def mainGameScreen(): global word_down_thread, is_word_down_thread_stop global EXIT_NOW is_word_down_thread_stop = False - word_down_thread = threading.Thread(target=start_fall_word, args=[False]) # debug if IS_DEBUG: drawCoor() @@ -322,6 +317,7 @@ def mainGameScreen(): menu1 = "[P] PLAY" menu2 = "[S] Statistics" menu3 = "[X] EXIT" + menu_win = curses.newwin(11, len(menu2) + 4 , 30, 78) # h, l, y, x menu_win.addstr(1, 1, menu1,curses.A_BOLD) menu_win.addstr(2+3, 1, menu2,curses.A_BOLD) @@ -458,7 +454,6 @@ def gameScreen(pauseSec, diffc, ptype): drawCoor() global EXIT_GAME - #exit whenever i want saved = "" y_entered = MAX_Y - ENTER_Y_OFFSET @@ -469,6 +464,7 @@ def gameScreen(pauseSec, diffc, ptype): # Take an input from a user msg = "" while 1: + STDSCR.timeout(100) event = STDSCR.getch() if event == -1: # EXIT_GAME is True when the life comes 0 @@ -607,6 +603,19 @@ def start_fall_word(is_demo): lastSaved = ent + +def eng_word(): + global ENG_WORDS + # OPEN FILE + eng_file = open(ENG_FILE,"r") + ENG_WORDS = eng_file.readlines() + + +def py_word(): + global PY_WORDS + py_file = open(PY_FILE,"r") + PY_WORDS = py_file.readlines() + # ------------------------------------------------------------------------------ # Check requirements # ------------------------------------------------------------------------------ From 975dd3549213015de5bfe2172072174a5535418d Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Tue, 14 Jun 2016 23:20:13 -0400 Subject: [PATCH 29/39] Added comments and deleted unused functions --- ICS4U-PCP_GIT/ICS4U-PCP.py | 80 ++++++++------------------------------ 1 file changed, 17 insertions(+), 63 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 4a67d4e..a1f283d 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -33,6 +33,12 @@ word_down_thread = "" is_demo = False +# ------------------------------------------------------------------------------ +# class Word +# ------------------------------------------------------------------------------ +# Create a word object placed in a panel + + class Word(object): """ Representation of words @@ -74,7 +80,7 @@ def create_word(screen, word): #debug("new word: "+str(y_x_word), 2) return y_x_word #screen.border(0) - global test_val + #global test_val global ent if word: @@ -150,68 +156,6 @@ def debug(msg, level): # Initializing value saved ="" -def GamePlay(): - - while True: - my_raw_input(3,10,"test") - stdscr = STDSCR - STDSCR.clear() - STDSCR.refresh() - - saved ="" - y_entered = MAX_Y - x_entered = 10 - - enter_win = curses.newwin(1, 70, y_entered, x_entered) # l, w, y, x - enter_panel = curses.panel.new_panel(enter_win) - enter_panel.top() - while True: - - event = STDSCR.getch() - - global test_val - test_val += 1 - event = stdscr.getch() - if event != 10: - saved += chr(event) - if event == 8: - stdscr.addstr(15,10, 'backspace') - saved = saved[:-2] - stdscr.addstr(10,10, ' ') - stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) - if event == 10: - global ent - ent = saved - saved = "" - stdscr.addstr(10,10, 'saved:['+str(saved) + '] event: ' +str(event)) - - if event == 27: - break - - #stats screen - if chr(event) == 's' or 'S': - enter_panel.hide() - userstats() - - if event != 10 and event !=263: # enter and backspace - # saved += chr(event) - if event == 263: # backspace - saved = saved[:-1] - enter_win.noutrefresh() - curses.doupdate() - - # enter - if event == 10: - global USER_ENT - USER_ENT = saved - saved = "" - - enter_win.addstr(0,0,saved) - enter_win.noutrefresh() - curses.doupdate() - - if EXIT_GAME: - break #------------------------------------------------------------------------------ # main @@ -520,6 +464,9 @@ def gameScreen(pauseSec, diffc, ptype): if EXIT_GAME: break +# ------------------------------------------------------------------------------ +# Stat Screen +# ------------------------------------------------------------------------------ def userstats(): stat_win = curses.newwin(30, 10, 10, 15) stat_win.addstr(5,6,"This is userstats window") @@ -658,6 +605,10 @@ def printError(msg): # Draws # ############################################################################### + +# ------------------------------------------------------------------------------ +# Draw life bar +# ------------------------------------------------------------------------------ def drawLife(lose): global EXIT_NOW @@ -675,6 +626,9 @@ def drawLife(lose): life_win.noutrefresh();curses.doupdate() return life_pan +#------------------------------------------------------------------------------ +# Draw combos +#------------------------------------------------------------------------------ def drawCombo(combo = 0, score = 0): # Create a combo window/panel l = 3 From 702087c19819c7dc732ba551e612d3d49ad73084 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Wed, 15 Jun 2016 00:02:18 -0400 Subject: [PATCH 30/39] changed few things --- ICS4U-PCP_GIT/ICS4U-PCP.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index a1f283d..a3601d6 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -24,6 +24,7 @@ ENG_WORDS = ["apple","hi","hello","aaron",""] ENG_WORDS_LEN = 0 +NEW_WORD_FREQ = 10 # lower, sooner PY_WORDS = [] PY_WORDS_LEN = 0 STDSCR = "" @@ -62,6 +63,13 @@ def __init__(self, diff, ptype): if len(ENG_WORDS[idx]) > MIN_WORD_LEN and len(ENG_WORDS[idx]) <= MAX_WORD_LEN: Word = ENG_WORDS[idx] + y = 6 + x_offset_left = 10 + x = randint(x_offset_left, MAX_X - len(word)- 5) + self.word = word + self.x = x + self.y = y + def move_down(self,screen, word): self.panel.move(self.y, self.x) curses.panel.update_panels(); @@ -359,6 +367,7 @@ def mainGameScreen(): # Start the game if event_lower == 'e': diffc = "easy" + start_fall_word(False) elif event_lower == 'm': diffc = "medium" elif event_lower == 'h': @@ -507,7 +516,7 @@ def start_fall_word(is_demo): # # Words falling down if new_word_interval % NEW_WORD_FREQ == 0: - wordObj = Word() + wordObj = Word("easy", "prac") word_wordObj[wordObj.word] = wordObj new_word_interval = 0 @@ -519,7 +528,7 @@ def start_fall_word(is_demo): # Y boundary if wordObj.getY() >= MAX_Y-3: del word_wordObj[word] - wordObj.delWord() + wordObj.delWord("easy","prac") lose_count += 1 if not is_demo: dummy = drawLife(lose_count) From b4ced8898947ba9b011e609df5a8bcd9c542428a Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Wed, 15 Jun 2016 10:12:39 -0400 Subject: [PATCH 31/39] Words are moving down --- ICS4U-PCP_GIT/ICS4U-PCP.py | 194 ++++++++++++++++++++++++------------- 1 file changed, 126 insertions(+), 68 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index a3601d6..d03499e 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -29,7 +29,7 @@ PY_WORDS_LEN = 0 STDSCR = "" MIN_WORD_LEN = 0 -MAX_WORD_LEN = 0 +MAX_WORD_LEN = 5 WORD = "" word_down_thread = "" is_demo = False @@ -44,7 +44,7 @@ class Word(object): """ Representation of words """ - def __init__(self, diff, ptype): + def __init__(self, diffc, ptype): """ selects a word according to user difficulty :param diffc: str - difficulty selected by user @@ -55,22 +55,42 @@ def __init__(self, diff, ptype): #add more difficulties if ptype == "prac": - if diff == "easy" or diff == "medium": - global MIN_WORD_LEN,MAX_WORD_LEN,WORD - MIN_WORD_LEN = 0 - MAX_WORD_LEN = 3 - for idx in range(len(ENG_WORDS)): - if len(ENG_WORDS[idx]) > MIN_WORD_LEN and len(ENG_WORDS[idx]) <= MAX_WORD_LEN: - Word = ENG_WORDS[idx] - - y = 6 + # Easy or medium + if diffc == "easy" or diffc == "medium": + max_word_len = 0 + if diffc == "easy": + min_word_len = 3 + max_word_len = 4 + elif diffc == "medium": + min_word_len = 5 + max_word_len = 20 + + # Create a word + word = ENG_WORDS[randint(0, ENG_WORDS_LEN - 1)].strip() + while len(word) > max_word_len or len(word) < min_word_len : + word = ENG_WORDS[randint(0, ENG_WORDS_LEN-1)].strip() + # Hard + else: + max_word_len = 7 + for dummy in range(max_word_len): + ch = chr(randint(ord('!'), ord('~'))) + word += ch + + y = 4 x_offset_left = 10 x = randint(x_offset_left, MAX_X - len(word)- 5) + + win = curses.newwin(2, len(word), y, x) + win.addstr(0, 0, word, curses.color_pair(randint(1, 6))) + self.word = word self.x = x self.y = y + self.win = win + self.panel = curses.panel.new_panel(win) + self.panel.bottom() - def move_down(self,screen, word): + def moveDown(self): self.panel.move(self.y, self.x) curses.panel.update_panels(); self.win.noutrefresh(); curses.doupdate() @@ -201,6 +221,9 @@ def main(stdscr): if IS_DEBUG: drawCoor() + # read word files + readEngWord() + #define this after the window's created. #horizontal line decides whether user missed or not. global MISS_Y @@ -491,80 +514,96 @@ def start_fall_word(is_demo): count_worddown = 0 word_wordObj = {} - comboTimerCount = 1 - showCombo = False + #comboTimerCount = 1 + #showCombo = False - # Create a combo window/panel - combo_win = curses.newwin(10,10,5,5) - combo_pan = curses.panel.new_panel(combo_win) - combo_pan.hide() + ## Create a combo window/panel + #combo_win = curses.newwin(10,10,5,5) + #combo_pan = curses.panel.new_panel(combo_win) + #combo_pan.hide() - # + ## new_word_interval = 0 - combo_count = 0 - lastSaved = "" + #combo_count = 0 + #lastSaved = "" lose_count = 0 - score_count = 0 + #score_count = 0 - dummyCombo = "" + #dummyCombo = "" + #dummy = drawLife(lose_count) # Score - if not is_demo: - dummyScore = 0 - dummy = drawLife(lose_count) + #wordObj = Word("easy", "prac") + #curses.panel.update_panels() + #STDSCR.noutrefresh() + #curses.doupdate() + #if not is_demo: + # dummyScore = 0 + # dummy = drawLife(lose_count) + #curses.doupdate() + #curses.panel.update_panels() + #STDSCR.refresh() + #print("word.x" + str(wordObj.x),"word.y"+str(wordObj.y)) + #print("HELLO" + str(is_word_down_thread_stop)) + #print("is_demo:" + str(is_demo)) + #STDSCR.getch() while not is_word_down_thread_stop: # # Words falling down - if new_word_interval % NEW_WORD_FREQ == 0: - wordObj = Word("easy", "prac") - word_wordObj[wordObj.word] = wordObj - new_word_interval = 0 - - # move down each words - words = word_wordObj.copy() - for word in words: - wordObj = word_wordObj[word] - - # Y boundary - if wordObj.getY() >= MAX_Y-3: - del word_wordObj[word] - wordObj.delWord("easy","prac") - lose_count += 1 - if not is_demo: - dummy = drawLife(lose_count) - - else: - wordObj.moveDown() - new_word_interval += 1 - count_worddown = 0 - - if not is_demo: - # Check what a user types - if lastSaved != ent: - if word_wordObj.get(ent): - combo_count += 1 - score_count += 10 - word_wordObj[ent].remove_same(ent) - del word_wordObj[ent] - - # show combo and score - each_score = 300 - bonus = 13 * (combo_count) - cu_score = 300 * score_count + bonus - - showCombo = True - # Miss! + if getPauseSec(count_worddown, 0.1): + if new_word_interval % NEW_WORD_FREQ == 0: + wordObj = Word("easy", "prac") + word_wordObj[wordObj.word] = wordObj + new_word_interval = 0 + + # move down each words + words = word_wordObj.copy() + for word in words: + wordObj = word_wordObj[word] + + # Y boundary + if wordObj.getY() >= MAX_Y-3: + del word_wordObj[word] + wordObj.delWord() + lose_count += 1 + + if not is_demo: + dummy = drawLife(lose_count) + else: - combo_count = 0 + wordObj.moveDown() + new_word_interval += 1 + count_worddown += 1 + + #if not is_demo: + # # Check what a user types + # if lastSaved != ent: + # if word_wordObj.get(ent): + # combo_count += 1 + # score_count += 10 + # word_wordObj[ent].remove_same(ent) + # del word_wordObj[ent] - lastSaved = ent + # # show combo and score + # each_score = 300 + # bonus = 13 * (combo_count) + # cu_score = 300 * score_count + bonus + # showCombo = True + # # Miss! + # else: + # combo_count = 0 -def eng_word(): + # lastSaved = ent + + +def readEngWord(): global ENG_WORDS + global ENG_WORDS_LEN # OPEN FILE eng_file = open(ENG_FILE,"r") ENG_WORDS = eng_file.readlines() + ENG_WORDS_LEN = len(ENG_WORDS) def py_word(): @@ -614,6 +653,24 @@ def printError(msg): # Draws # ############################################################################### +#------------------------------------------------------------------------------ +# get pause sec +#------------------------------------------------------------------------------ +def getPauseSec(count, sec): + """ + divide count by sec and check if the remainder is 0 + :param count: int - count + :param sec: int - sec + :return: boolean - remainder is 0 + """ + + if count < 1: + count = 1 + + weight = 5000000 + msum = count % (weight * sec) + return msum == 0 + # ------------------------------------------------------------------------------ # Draw life bar @@ -626,6 +683,7 @@ def drawLife(lose): if 1 * lose > MAX_Y-3: EXIT_NOW =True for y in range(1 * lose, MAX_Y-3): + #print("drawLife") life_win.addch(y, 1, ord('=')) life_win.box() From 7acdcdeb4ac51883de81bc0987da0d540b1c26c8 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Wed, 15 Jun 2016 10:17:10 -0400 Subject: [PATCH 32/39] data files --- ICS4U-PCP_GIT/data.dat | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 ICS4U-PCP_GIT/data.dat diff --git a/ICS4U-PCP_GIT/data.dat b/ICS4U-PCP_GIT/data.dat new file mode 100755 index 0000000..0f26599 --- /dev/null +++ b/ICS4U-PCP_GIT/data.dat @@ -0,0 +1,11 @@ +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] +['hello there', 4, 3130, 7, 5, '58.33'] From c16d0fab7942f7a89bdf703f308173d18161a7df Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Wed, 15 Jun 2016 11:21:17 -0400 Subject: [PATCH 33/39] read and falls words from eng and python data words --- ICS4U-PCP_GIT/ICS4U-PCP.py | 98 +++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index d03499e..1c2efc0 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -16,13 +16,19 @@ is_word_down_thread_stop = False ENG_FILE = "words.dat" PY_FILE = "python.dat" +ent = "" +test_val = 1 +SCR_Y_MAX = 40 +SCR_X_MAX = 60 + + MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X REQ_Y = 55/2 # required screen size Y REQ_X = 200/2 # required screen size X -ENG_WORDS = ["apple","hi","hello","aaron",""] +ENG_WORDS = [] ENG_WORDS_LEN = 0 NEW_WORD_FREQ = 10 # lower, sooner PY_WORDS = [] @@ -49,11 +55,11 @@ def __init__(self, diffc, ptype): selects a word according to user difficulty :param diffc: str - difficulty selected by user :param ptype: str - game type selected by user - :return: str - + :return: None """ word = "" - #add more difficulties + # Practice if ptype == "prac": # Easy or medium if diffc == "easy" or diffc == "medium": @@ -75,11 +81,30 @@ def __init__(self, diffc, ptype): for dummy in range(max_word_len): ch = chr(randint(ord('!'), ord('~'))) word += ch + # Coding + else: + max_word_len = 0 + # Easy or medium + if diffc == "easy": + min_word_len = 3 + max_word_len = 5 + elif diffc == "medium": + min_word_len = 5 + max_word_len = 10 + # Hard + else: + min_word_len = 5 + max_word_len = 30 + + # Create a word + word = PY_WORDS[randint(0, PY_WORDS_LEN-1)].strip() + while len(word) > max_word_len or len(word) < min_word_len : + word = PY_WORDS[randint(0, PY_WORDS_LEN-1)].strip() - y = 4 x_offset_left = 10 x = randint(x_offset_left, MAX_X - len(word)- 5) - + y = 6 + # H L Y, X win = curses.newwin(2, len(word), y, x) win.addstr(0, 0, word, curses.color_pair(randint(1, 6))) @@ -90,37 +115,6 @@ def __init__(self, diffc, ptype): self.panel = curses.panel.new_panel(win) self.panel.bottom() - def moveDown(self): - self.panel.move(self.y, self.x) - curses.panel.update_panels(); - self.win.noutrefresh(); curses.doupdate() - self.y += 1 - - def create_word(screen, word): - while 1: - word_len = 4 - word = "" - for ch_num in range(word_len): - ch = chr(randint(ord('a'), ord('z'))) - word += ch - x = randint(0, SCR_X_MAX) - y_x_word = [ 0, x, word ] - #debug("new word: "+str(y_x_word), 2) - return y_x_word - #screen.border(0) - #global test_val - global ent - - if word: - screen.addstr(12, 12, 'testval:'+str(test_val)) - screen.refresh() - - if ent == word[2]: - global curses - curses.beep() - word = None - - time.sleep(0.5) def getX(self): return self.x @@ -128,6 +122,12 @@ def getX(self): def getY(self): return self.y + def moveDown(self): + self.panel.move(self.y, self.x) + curses.panel.update_panels() + self.win.noutrefresh(); curses.doupdate() + self.y += 1 + def getPanel(self): return self.panel @@ -146,11 +146,6 @@ def display(self): # y, x curses.panel.update_panels(); STDSCR.refresh() -ent = "" -test_val = 1 -SCR_Y_MAX = 40 -SCR_X_MAX = 60 - def drawCoor(): STDSCR.clear() STDSCR.border(0) @@ -188,14 +183,14 @@ def debug(msg, level): #------------------------------------------------------------------------------ # main #------------------------------------------------------------------------------ - def main(stdscr): """ set up for the game to start and runs by calling the main page :param stdscr: window - standard window screen :return: None """ - # make colors + + # make colours curses.init_pair(1,curses.COLOR_RED,curses.COLOR_BLACK) curses.init_pair(2,curses.COLOR_GREEN,curses.COLOR_BLACK) curses.init_pair(3,curses.COLOR_YELLOW,curses.COLOR_BLACK) @@ -222,6 +217,7 @@ def main(stdscr): drawCoor() # read word files + readPhyWord() readEngWord() #define this after the window's created. @@ -232,9 +228,10 @@ def main(stdscr): while 1: # re-initialize EXIT_GAME = False - # main game screen + # main game screen rc = mainGameScreen() + # reset if rc == 4: STDSCR.clear(); STDSCR.refresh() @@ -292,7 +289,6 @@ def mainGameScreen(): menu1 = "[P] PLAY" menu2 = "[S] Statistics" menu3 = "[X] EXIT" - menu_win = curses.newwin(11, len(menu2) + 4 , 30, 78) # h, l, y, x menu_win.addstr(1, 1, menu1,curses.A_BOLD) menu_win.addstr(2+3, 1, menu2,curses.A_BOLD) @@ -357,7 +353,6 @@ def mainGameScreen(): play2 = "[M] Medium - words length of 5 and more" play3 = "[H] Hard - random char and symbols" play4 = "[R] reset" - else: play1 = "[E] Easy - words length of 3 - 5" play2 = "[M] Medium - words lenght of 5 - 10" @@ -390,11 +385,11 @@ def mainGameScreen(): # Start the game if event_lower == 'e': diffc = "easy" - start_fall_word(False) elif event_lower == 'm': diffc = "medium" elif event_lower == 'h': diffc = "hard" + start_fall_word(0.5, False, diffc, ptype) main_rc = 1 gameScreen(WORD_START_PAUSE, diffc, ptype) @@ -510,7 +505,7 @@ def userstats(): stat_win.addstr(8,6,"score#: ") -def start_fall_word(is_demo): +def start_fall_word(pauseSec, is_demo, diffc, ptype): count_worddown = 0 word_wordObj = {} @@ -552,7 +547,7 @@ def start_fall_word(is_demo): # Words falling down if getPauseSec(count_worddown, 0.1): if new_word_interval % NEW_WORD_FREQ == 0: - wordObj = Word("easy", "prac") + wordObj = Word(diffc, ptype) word_wordObj[wordObj.word] = wordObj new_word_interval = 0 @@ -606,10 +601,13 @@ def readEngWord(): ENG_WORDS_LEN = len(ENG_WORDS) -def py_word(): +def readPhyWord(): global PY_WORDS + global PY_WORDS_LEN + #read files py_file = open(PY_FILE,"r") PY_WORDS = py_file.readlines() + PY_WORDS_LEN = len(PY_WORDS) # ------------------------------------------------------------------------------ # Check requirements From 0cae39ea2841ffe711de58123b2b78c401bb7e54 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Wed, 15 Jun 2016 13:27:11 -0400 Subject: [PATCH 34/39] words fall on the main screen (graphical decoration) --- ICS4U-PCP_GIT/ICS4U-PCP.py | 111 ++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 1c2efc0..937d3bd 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -3,7 +3,7 @@ import time from time import sleep import sys -#import threading +import threading # ------------------------------------------------------- # Global Varibles @@ -20,8 +20,7 @@ test_val = 1 SCR_Y_MAX = 40 SCR_X_MAX = 60 - - +EXIT_GAME = False MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X @@ -37,7 +36,9 @@ MIN_WORD_LEN = 0 MAX_WORD_LEN = 5 WORD = "" -word_down_thread = "" +THREAD_OBJ = "" +is_word_down_thread_stop = False # True: Stop falling words. + # False: Start falling words is_demo = False # ------------------------------------------------------------------------------ @@ -45,7 +46,6 @@ # ------------------------------------------------------------------------------ # Create a word object placed in a panel - class Word(object): """ Representation of words @@ -178,8 +178,6 @@ def debug(msg, level): clear_line(y) # Initializing value saved ="" - - #------------------------------------------------------------------------------ # main #------------------------------------------------------------------------------ @@ -199,11 +197,8 @@ def main(stdscr): curses.init_pair(6,curses.COLOR_CYAN,curses.COLOR_BLACK) curses.init_pair(7,curses.COLOR_BLUE,curses.COLOR_BLACK) - global EXIT_GAME - global is_word_down_thread_stop - # mouse cursor set - none - curses.curs_set(0) + curses.curs_set(1) # Set up for debug global STDSCR @@ -258,9 +253,6 @@ def mainGameScreen(): STDSCR.clear() STDSCR.refresh() - global word_down_thread, is_word_down_thread_stop - global EXIT_NOW - is_word_down_thread_stop = False # debug if IS_DEBUG: drawCoor() @@ -297,6 +289,15 @@ def mainGameScreen(): menu_panel.top();curses.panel.update_panels() menu_win.noutrefresh(); curses.doupdate() + # word falling down in the background + global THREAD_OBJ + global is_word_down_thread_stop + + is_word_down_thread_stop = False + THREAD_OBJ = threading.Thread(target=start_fall_word, args=[0.06, True, "hard", "coding"]) + THREAD_OBJ.daemon = True + THREAD_OBJ.start() + #initialize main_rc = 0 @@ -377,6 +378,7 @@ def mainGameScreen(): if event_lower == 'e' or event_lower == 'm' or event_lower == 'h': + stop_thread() title_panel.hide() menu_panel.hide() play1_panel.hide() @@ -389,7 +391,6 @@ def mainGameScreen(): diffc = "medium" elif event_lower == 'h': diffc = "hard" - start_fall_word(0.5, False, diffc, ptype) main_rc = 1 gameScreen(WORD_START_PAUSE, diffc, ptype) @@ -397,6 +398,7 @@ def mainGameScreen(): # reset elif event_lower.lower() == 'r': + stop_thread() main_rc = 4 break @@ -424,7 +426,15 @@ def gameScreen(pauseSec, diffc, ptype): if IS_DEBUG: drawCoor() + global THREAD_OBJ, is_word_down_thread_stop global EXIT_GAME + is_word_down_thread_stop = False + #make another thread + THREAD_OBJ = threading.Thread(target=start_fall_word, args=[pauseSec, False, diffc, ptype]) + #exit whenever i want + THREAD_OBJ.daemon = True + THREAD_OBJ.start() + saved = "" y_entered = MAX_Y - ENTER_Y_OFFSET @@ -441,6 +451,7 @@ def gameScreen(pauseSec, diffc, ptype): # EXIT_GAME is True when the life comes 0 if EXIT_GAME or GO_NEXT: STDSCR.timeout(-1) + stop_thread() # Go back to main screen break @@ -471,11 +482,13 @@ def gameScreen(pauseSec, diffc, ptype): if event == 9: #tab to exit STDSCR.timeout(-1) + stop_thread() EXIT_GAME = True if event == 27: #esc #wait for input STDSCR.timeout(-1) + stop_thread() break if GO_NEXT: @@ -500,6 +513,7 @@ def userstats(): stat_win.box() score_formatline = [] + stop_thread() stat_win.addstr(6,6,"user name: ") stat_win.addstr(7,6,"level#: ") stat_win.addstr(8,6,"score#: ") @@ -513,10 +527,13 @@ def start_fall_word(pauseSec, is_demo, diffc, ptype): #showCombo = False ## Create a combo window/panel - #combo_win = curses.newwin(10,10,5,5) - #combo_pan = curses.panel.new_panel(combo_win) - #combo_pan.hide() + combo_win = curses.newwin(10,10,5,5) + combo_pan = curses.panel.new_panel(combo_win) + combo_pan.hide() + # init + global EXIT_GAME + global GO_NEXT ## new_word_interval = 0 #combo_count = 0 @@ -528,20 +545,10 @@ def start_fall_word(pauseSec, is_demo, diffc, ptype): #dummy = drawLife(lose_count) # Score - #wordObj = Word("easy", "prac") - #curses.panel.update_panels() - #STDSCR.noutrefresh() - #curses.doupdate() - #if not is_demo: - # dummyScore = 0 - # dummy = drawLife(lose_count) - #curses.doupdate() - #curses.panel.update_panels() - #STDSCR.refresh() - #print("word.x" + str(wordObj.x),"word.y"+str(wordObj.y)) - #print("HELLO" + str(is_word_down_thread_stop)) - #print("is_demo:" + str(is_demo)) - #STDSCR.getch() + if not is_demo: + dummyScore = 0 + dummy = drawLife(lose_count) + while not is_word_down_thread_stop: # # Words falling down @@ -651,24 +658,6 @@ def printError(msg): # Draws # ############################################################################### -#------------------------------------------------------------------------------ -# get pause sec -#------------------------------------------------------------------------------ -def getPauseSec(count, sec): - """ - divide count by sec and check if the remainder is 0 - :param count: int - count - :param sec: int - sec - :return: boolean - remainder is 0 - """ - - if count < 1: - count = 1 - - weight = 5000000 - msum = count % (weight * sec) - return msum == 0 - # ------------------------------------------------------------------------------ # Draw life bar @@ -709,6 +698,28 @@ def drawCombo(combo = 0, score = 0): combo_win.noutrefresh();curses.doupdate() return combo_pan +#------------------------------------------------------------------------------ +# stop thread +#------------------------------------------------------------------------------ +def stop_thread(): + global is_word_down_thread_stop + is_word_down_thread_stop = True + # wait untill THREAD_OBJ stops + while THREAD_OBJ.isAlive(): + pass + is_word_down_thread_stop = False + +#------------------------------------------------------------------------------ +# get pause sec +#------------------------------------------------------------------------------ +def getPauseSec(count, sec): + if count < 1: + count = 1 + + weight = 5000000 + msum = count % (weight * sec) + return msum == 0 + ############################################################################### # START ############################################################################### From d387ea5f1d0d9f19658e4f79cb207382bb9bd41b Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Wed, 15 Jun 2016 23:38:58 -0400 Subject: [PATCH 35/39] game play done --- ICS4U-PCP_GIT/ICS4U-PCP.py | 443 +++++++++++++++++++++++++------------ 1 file changed, 296 insertions(+), 147 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 937d3bd..e03a8eb 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -5,47 +5,69 @@ import sys import threading -# ------------------------------------------------------- +# ------------------------------------------------------------------------------ # Global Varibles -# ------------------------------------------------------- - +# ------------------------------------------------------------------------------ IS_DEBUG = True WORD_START_PAUSE = 0.2 # Initial word speed. Lower is Faster -ENTER_Y_OFFSET = 5 -GO_NEXT = False -is_word_down_thread_stop = False + ENG_FILE = "words.dat" PY_FILE = "python.dat" -ent = "" -test_val = 1 -SCR_Y_MAX = 40 -SCR_X_MAX = 60 +GO_NEXT = False +LEVEL = 1 +USER_ENT = "" +ENTER_Y_OFFSET = 5 EXIT_GAME = False +WORDS_GOALS = 1 + +EXC_Y = 20 +GOOD_Y = 30 +AVG_Y = 40 +MISS_Y = 0 + +EXC_COUNT = 0 +GOOD_COUNT = 0 +AVG_COUNT = 0 +MISS_COUNT = 0 + +ACCU_SCORE = 0 # overall score +BEST_SCORE_PER_ROUND = 0 +BEST_COMBO_PER_ROUND = 0 +HIT_PER_ROUND = 0 +MISS_PER_ROUND = 0 +ACCU_HIT_PER_ROUND = 0 +ACCU_MISS_PER_ROUND = 0 MAX_Y = 0 # current screen Y MAX_X = 0 # current screen X -REQ_Y = 55/2 # required screen size Y -REQ_X = 200/2 # required screen size X +REQ_Y = 40 # required screen size Y +REQ_X = 40 # required screen size X -ENG_WORDS = [] -ENG_WORDS_LEN = 0 -NEW_WORD_FREQ = 10 # lower, sooner -PY_WORDS = [] -PY_WORDS_LEN = 0 STDSCR = "" -MIN_WORD_LEN = 0 -MAX_WORD_LEN = 5 -WORD = "" + THREAD_OBJ = "" is_word_down_thread_stop = False # True: Stop falling words. # False: Start falling words -is_demo = False + +NEW_WORD_FREQ = 10 # lower, sooner +ENG_WORDS = [] +ENG_WORDS_LEN = 0 +PY_WORDS = [] +PY_WORDS_LEN = 0 + +ent = "" +test_val = 1 +SCR_Y_MAX = 40 +SCR_X_MAX = 60 + + # ------------------------------------------------------------------------------ # class Word # ------------------------------------------------------------------------------ # Create a word object placed in a panel + class Word(object): """ Representation of words @@ -146,38 +168,6 @@ def display(self): # y, x curses.panel.update_panels(); STDSCR.refresh() -def drawCoor(): - STDSCR.clear() - STDSCR.border(0) - STDSCR.refresh() - for x in range(MAX_X): - STDSCR.addstr(2,x, str(x%10)) - if (x % 10 == 0): - STDSCR.addstr(1,x, str(x//10)) - - for y in range(MAX_Y): - STDSCR.addstr(y,2, str(y%10)) - if (y % 10 == 0): - STDSCR.addstr(y,1, str(y//10)) - - STDSCR.refresh() - -def my_raw_input(stdscr, r, c, prompt_string): - curses.echo() - stdscr.addstr(r, c, prompt_string) - stdscr.refresh() - input = stdscr.getstr(r + 1, c, 20) - return input # ^^^^ reading input at next line - -def clear_line(y): - empty = " " * SCR_X_MAX - STDSCR.addstr(y, 1, empty) - -def debug(msg, level): - y = SCR_Y_MAX - 10 + level - clear_line(y) - # Initializing value -saved ="" #------------------------------------------------------------------------------ # main #------------------------------------------------------------------------------ @@ -198,7 +188,7 @@ def main(stdscr): curses.init_pair(7,curses.COLOR_BLUE,curses.COLOR_BLACK) # mouse cursor set - none - curses.curs_set(1) + curses.curs_set(0) # Set up for debug global STDSCR @@ -434,7 +424,6 @@ def gameScreen(pauseSec, diffc, ptype): #exit whenever i want THREAD_OBJ.daemon = True THREAD_OBJ.start() - saved = "" y_entered = MAX_Y - ENTER_Y_OFFSET @@ -517,8 +506,93 @@ def userstats(): stat_win.addstr(6,6,"user name: ") stat_win.addstr(7,6,"level#: ") stat_win.addstr(8,6,"score#: ") +############################################################################### +# +# Draws +# +############################################################################### +# ------------------------------------------------------------------------------ +# Draw goal +# ------------------------------------------------------------------------------ +def drawGoal(current, goal): + goal_win = curses.newwin(3,18, 3, 90) + goal_win.addstr(1,2,"CURRENT: " + str(current) + "/" +str(goal)) + goal_win.box() + + goal_pan = curses.panel.new_panel(goal_win) + curses.panel.update_panels() + goal_win.noutrefresh();curses.doupdate() + return goal_pan + +# ------------------------------------------------------------------------------ +# Draw life bar +# ------------------------------------------------------------------------------ +def drawLife(lose): + left = True + + life_win = curses.newwin(MAX_Y-3 ,3, 3, 3) + + lose_weight = 1 + if lose_weight * lose > MAX_Y-3: + left = False + for y in range(lose_weight * lose, MAX_Y-3): + life_win.addch(y, 1, ord('=')) + life_win.box() + + life_pan = curses.panel.new_panel(life_win) + life_pan.top() + curses.panel.update_panels() + life_win.noutrefresh();curses.doupdate() + return life_pan, left +#------------------------------------------------------------------------------ +# Draw score +#------------------------------------------------------------------------------ +def drawScore(score = 0): + # Create a score window/panel + l = 3 + w = 50 + score_win = curses.newwin(l,w,3,10) + score_win.addstr(1,2,"SCORE: " + str(score) + " TOTAL: " +str(ACCU_SCORE)) + score_win.box() + score_pan = curses.panel.new_panel(score_win) + curses.panel.update_panels() + score_win.noutrefresh();curses.doupdate() + return score_pan + +#------------------------------------------------------------------------------ +# Draw combos +#------------------------------------------------------------------------------ +def drawCombo(combo = 0, score = 0): + """ + draws combo panel on the screen + to show combo score of the user + :param combo: int - amount of combos + :param score: int - score of the user + :return: panel - the panel that contains the combo scores + """ + # Create a combo window/panel + l = 3 + w = 22 + combo_win = curses.newwin(l, w,3,61) + combo_win.addstr(1,2, "COMBO: " + str(combo) + " ( +"+ str(score) + ")") + combo_win.box() + combo_pan = curses.panel.new_panel(combo_win) + combo_pan.top() + curses.panel.update_panels() + combo_win.noutrefresh();curses.doupdate() + return combo_pan + + +############################################################################### +# +# MISC. +# +############################################################################### +# ------------------------------------------------------------------- +# start fall word +# ------------------------------------------------------------------- def start_fall_word(pauseSec, is_demo, diffc, ptype): count_worddown = 0 word_wordObj = {} @@ -526,33 +600,58 @@ def start_fall_word(pauseSec, is_demo, diffc, ptype): #comboTimerCount = 1 #showCombo = False - ## Create a combo window/panel + # Create a combo window/panel combo_win = curses.newwin(10,10,5,5) combo_pan = curses.panel.new_panel(combo_win) combo_pan.hide() # init + global ACCU_SCORE global EXIT_GAME global GO_NEXT - ## + global HIT_PER_ROUND, MISS_PER_ROUND, LEVEL, ACCU_HIT_PER_ROUND, ACCU_MISS_PER_ROUND + global EXC_COUNT, GOOD_COUNT, AVG_COUNT, MISS_COUNT + EXC_COUNT = 0 + GOOD_COUNT = 0 + AVG_COUNT = 0 + MISS_COUNT = 0 + MISS_PER_ROUND = 0 + HIT_PER_ROUND = 0 + GO_NEXT = False + comboTimerCount = 1 + showCombo = False new_word_interval = 0 - #combo_count = 0 - #lastSaved = "" + combo_count = 0 + lastSaved = "" lose_count = 0 - #score_count = 0 - - #dummyCombo = "" - #dummy = drawLife(lose_count) - # Score + score_count = 0 + dummyCombo = "" + word_wordObj = {} + count_worddown = 0 + words_current = 0 + # Score and line if not is_demo: - dummyScore = 0 - dummy = drawLife(lose_count) + STDSCR.hline(EXC_Y, 0,'-',MAX_X) + STDSCR.hline(GOOD_Y,0,'-',MAX_X) + STDSCR.hline(AVG_Y, 0,'-',MAX_X) + STDSCR.hline(MISS_Y,0,'-',MAX_X) + + STDSCR.addstr(EXC_Y, 6, " Excellent ") + STDSCR.addstr(GOOD_Y,6, " Good ") + STDSCR.addstr(AVG_Y, 6, " Average ") + STDSCR.addstr(MISS_Y,6, " Miss ") + + dummyScore = drawScore(0) + dummy,is_life_left = drawLife(lose_count) + dummyGoal = drawGoal(words_current, WORDS_GOALS) while not is_word_down_thread_stop: # # Words falling down - if getPauseSec(count_worddown, 0.1): + # + if getPauseSec(count_worddown, pauseSec): + # how often create a new word? if new_word_interval % NEW_WORD_FREQ == 0: wordObj = Word(diffc, ptype) word_wordObj[wordObj.word] = wordObj @@ -564,39 +663,122 @@ def start_fall_word(pauseSec, is_demo, diffc, ptype): wordObj = word_wordObj[word] # Y boundary - if wordObj.getY() >= MAX_Y-3: + if wordObj.getY() >= MISS_Y: + MISS_COUNT += 1 del word_wordObj[word] wordObj.delWord() lose_count += 1 - + #draw life bar if not is_demo: - dummy = drawLife(lose_count) - + dummy,is_life_left = drawLife(lose_count) + #exit if there's no life + if not is_life_left: + EXIT_GAME = True else: wordObj.moveDown() - new_word_interval += 1 + new_word_interval += 1 + count_worddown = 0 + + if not is_demo: + # + # Check what a user types + # + if lastSaved != USER_ENT: + # Score! + if word_wordObj.get(USER_ENT): + #word_wordObj - dictionary type + # value - object made through Word class + # key - word str + wordObj = word_wordObj[USER_ENT] + if wordObj.getY() < EXC_Y: + EXC_COUNT += 1 + elif wordObj.getY() < GOOD_Y: + GOOD_COUNT += 1 + else: + AVG_COUNT += 1 + + combo_count += 1 + score_count += 1 + wordObj.delWord() + words_current += 1 + HIT_PER_ROUND += 1 + ACCU_HIT_PER_ROUND += 1 + + dummyGoal = drawGoal(words_current, WORDS_GOALS) + # completed the goal. Go to the next level + if words_current >= WORDS_GOALS: + GO_NEXT = True + + del word_wordObj[USER_ENT] + + # show combo and score + bonus = 13 * combo_count + cu_score = 300 * score_count + bonus + + ACCU_SCORE += cu_score + + if showCombo: + dummyCombo.hide() + dummyScore = drawScore(cu_score) + dummyCombo = drawCombo(combo_count, bonus) + comboTimerCount = 0 + showCombo = True + + # Incorrect! + else: + MISS_PER_ROUND += 1 + ACCU_MISS_PER_ROUND += 1 + combo_count = 0 + + lastSaved = USER_ENT + + # + # Duration of combo box + # + if showCombo: + comboTimerCount += 1 + STDSCR.addstr(40,5,str(comboTimerCount)) + if getPauseSec(comboTimerCount, 0.3): + STDSCR.refresh() + dummyCombo.hide() + comboTimerCount = 0 + showCombo = False + count_worddown += 1 - #if not is_demo: - # # Check what a user types - # if lastSaved != ent: - # if word_wordObj.get(ent): - # combo_count += 1 - # score_count += 10 - # word_wordObj[ent].remove_same(ent) - # del word_wordObj[ent] +#------------------------------------------------------------------------------ +# stop thread +#------------------------------------------------------------------------------ +def stop_thread(): + """ + stops thread on the screen + :return: None + """ + global is_word_down_thread_stop + is_word_down_thread_stop = True + # wait untill THREAD_OBJ stops + while THREAD_OBJ.isAlive(): + pass + is_word_down_thread_stop = False - # # show combo and score - # each_score = 300 - # bonus = 13 * (combo_count) - # cu_score = 300 * score_count + bonus - # showCombo = True - # # Miss! - # else: - # combo_count = 0 +#------------------------------------------------------------------------------ +# get pause sec +#------------------------------------------------------------------------------ +def getPauseSec(count, sec): + """ + divide count by sec and check if the remainder is 0 + :param count: int - count + :param sec: int - sec + :return: boolean - remainder is 0 + """ + + if count < 1: + count = 1 - # lastSaved = ent + weight = 5000000 + msum = count % (weight * sec) + return msum == 0 def readEngWord(): @@ -653,72 +835,39 @@ def printError(msg): #exit program sys.exit() -############################################################################### -# -# Draws -# -############################################################################### -# ------------------------------------------------------------------------------ -# Draw life bar -# ------------------------------------------------------------------------------ -def drawLife(lose): - global EXIT_NOW +def drawCoor(): + STDSCR.clear() + STDSCR.border(0) + STDSCR.refresh() + for x in range(MAX_X): + STDSCR.addstr(2,x, str(x%10)) + if (x % 10 == 0): + STDSCR.addstr(1,x, str(x//10)) - life_win = curses.newwin(MAX_Y-3 ,3, 3, 3) + for y in range(MAX_Y): + STDSCR.addstr(y,2, str(y%10)) + if (y % 10 == 0): + STDSCR.addstr(y,1, str(y//10)) - if 1 * lose > MAX_Y-3: - EXIT_NOW =True - for y in range(1 * lose, MAX_Y-3): - #print("drawLife") - life_win.addch(y, 1, ord('=')) - life_win.box() + STDSCR.refresh() - life_pan = curses.panel.new_panel(life_win) - life_pan.top(); - curses.panel.update_panels(); - life_win.noutrefresh();curses.doupdate() - return life_pan +def my_raw_input(stdscr, r, c, prompt_string): + curses.echo() + stdscr.addstr(r, c, prompt_string) + stdscr.refresh() + input = stdscr.getstr(r + 1, c, 20) + return input # ^^^^ reading input at next line -#------------------------------------------------------------------------------ -# Draw combos -#------------------------------------------------------------------------------ -def drawCombo(combo = 0, score = 0): - # Create a combo window/panel - l = 3 - w = 40 - #if LAST_COMBO != "": - # LAST_COMBO.hide() - combo_win = curses.newwin(l, w,3,60) - combo_win.addstr(1,2, "COMBO: " + str(combo) + " ( +"+ str(score) + ")") - combo_win.box() - combo_pan = curses.panel.new_panel(combo_win) - combo_pan.top() - curses.panel.update_panels(); - combo_win.noutrefresh();curses.doupdate() - return combo_pan +def clear_line(y): + empty = " " * SCR_X_MAX + STDSCR.addstr(y, 1, empty) -#------------------------------------------------------------------------------ -# stop thread -#------------------------------------------------------------------------------ -def stop_thread(): - global is_word_down_thread_stop - is_word_down_thread_stop = True - # wait untill THREAD_OBJ stops - while THREAD_OBJ.isAlive(): - pass - is_word_down_thread_stop = False +def debug(msg, level): + y = SCR_Y_MAX - 10 + level + clear_line(y) -#------------------------------------------------------------------------------ -# get pause sec -#------------------------------------------------------------------------------ -def getPauseSec(count, sec): - if count < 1: - count = 1 - weight = 5000000 - msum = count % (weight * sec) - return msum == 0 ############################################################################### # START From 066f0af42f858e347381107b291085bd98af8420 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Thu, 16 Jun 2016 11:43:57 -0400 Subject: [PATCH 36/39] stat screen does not work --- ICS4U-PCP_GIT/ICS4U-PCP.py | 267 ++++++++++++++++++++++--------------- 1 file changed, 163 insertions(+), 104 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index e03a8eb..b8ca372 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -1,16 +1,16 @@ -from random import randint -import curses.panel -import time -from time import sleep + import sys +import curses +import curses.panel import threading +from random import randint # ------------------------------------------------------------------------------ -# Global Varibles +# Global variables # ------------------------------------------------------------------------------ -IS_DEBUG = True +IS_DEBUG = False WORD_START_PAUSE = 0.2 # Initial word speed. Lower is Faster - +DATA_FILE = "data.dat" ENG_FILE = "words.dat" PY_FILE = "python.dat" GO_NEXT = False @@ -55,24 +55,16 @@ PY_WORDS = [] PY_WORDS_LEN = 0 -ent = "" -test_val = 1 -SCR_Y_MAX = 40 -SCR_X_MAX = 60 - - - # ------------------------------------------------------------------------------ # class Word # ------------------------------------------------------------------------------ # Create a word object placed in a panel - class Word(object): """ Representation of words """ - def __init__(self, diffc, ptype): + def __init__(self, diffc="hard", ptype="coding"): """ selects a word according to user difficulty :param diffc: str - difficulty selected by user @@ -137,7 +129,6 @@ def __init__(self, diffc, ptype): self.panel = curses.panel.new_panel(win) self.panel.bottom() - def getX(self): return self.x @@ -145,29 +136,16 @@ def getY(self): return self.y def moveDown(self): + # y, x self.panel.move(self.y, self.x) curses.panel.update_panels() self.win.noutrefresh(); curses.doupdate() self.y += 1 - def getPanel(self): - return self.panel - - def _eq__(self,other): - return self.word == other.word - - def __str__(self): - return self.word - def delWord(self): self.panel.hide() curses.panel.update_panels(); STDSCR.refresh() - # Debug - def display(self): - # y, x - curses.panel.update_panels(); STDSCR.refresh() - #------------------------------------------------------------------------------ # main #------------------------------------------------------------------------------ @@ -178,7 +156,7 @@ def main(stdscr): :return: None """ - # make colours + #make colours curses.init_pair(1,curses.COLOR_RED,curses.COLOR_BLACK) curses.init_pair(2,curses.COLOR_GREEN,curses.COLOR_BLACK) curses.init_pair(3,curses.COLOR_YELLOW,curses.COLOR_BLACK) @@ -187,7 +165,9 @@ def main(stdscr): curses.init_pair(6,curses.COLOR_CYAN,curses.COLOR_BLACK) curses.init_pair(7,curses.COLOR_BLUE,curses.COLOR_BLACK) - # mouse cursor set - none + global EXIT_GAME + + #mouse cursor curses.curs_set(0) # Set up for debug @@ -242,18 +222,17 @@ def mainGameScreen(): """ STDSCR.clear() STDSCR.refresh() - # debug if IS_DEBUG: drawCoor() # Draw Title - title1 = r'TTTTTT\ EEEEE\ X X\ TTTTT\ BBBB\ L\ A SSSSS\ TTTTT\ EEEEE\ RRRR ' - title2 = r'\\T\\\ E\\\\\ X X\ \\T\\\ B\\\B\ L\ A\A S\\\\\ \\T\\\ E\\\\\ R\\\R\ ' - title3 = r' T\ EEEEE\ X\ T\ BBBB\\ L\ AAAAA SSSSS\ T\ EEEEE\ RRRR\\ ' - title4 = r' T\ E\\\\\ X\X T\ B\\\B\ L\ A\ A\ \\\\S\ T\ E\\\\\ R\ R\ ' - title5 = r' T\ EEEEE\ X\ X\ T\ BBBB\\ LLLLL\ A\ A\ SSSSS\ T\ EEEEE\ R\ R\ ' - title6 = r' \\ \\\\\\ \\ \\ \\ \\\\\ \\\\\\ \\ \\ \\\\\\ \\ \\\\\\ \\ \\ ' + title1 = r'TTTTT\ EEEEE\ X X\ TTTTT\ BBBB\ L\ A SSSSS\ TTTTT\ EEEEE\ RRRR ' + title2 = r'\\T\\\ E\\\\\ X X\ \\T\\\ B\\\B\ L\ A\A S\\\\\ \\T\\\ E\\\\\ R\\\R\ ' + title3 = r' T\ EEEEE\ X\ T\ BBBB\\ L\ AAAAA SSSSS\ T\ EEEEE\ RRRR\\ ' + title4 = r' T\ E\\\\\ X\X T\ B\\\B\ L\ A\ A\ \\\\S\ T\ E\\\\\ R\ R\ ' + title5 = r' T\ EEEEE\ X\ X\ T\ BBBB\\ LLLLL\ A\ A\ SSSSS\ T\ EEEEE\ R\ R\ ' + title6 = r' \\ \\\\\\ \\ \\ \\ \\\\\ \\\\\\ \\ \\ \\\\\\ \\ \\\\\\ \\ \\ ' # h l y x title_win = curses.newwin(9, len(title1)+4, 5, int(MAX_X/2 - len(title1)/2)) @@ -305,7 +284,9 @@ def mainGameScreen(): elif chr(event) == 's': title_panel.hide() menu_panel.hide() + #statsScreen main_rc = 1 + statScreen() #Play elif chr(event) == 'p': @@ -384,6 +365,7 @@ def mainGameScreen(): main_rc = 1 gameScreen(WORD_START_PAUSE, diffc, ptype) + gameOverScreen() break # reset @@ -453,6 +435,7 @@ def gameScreen(pauseSec, diffc, ptype): msg = " " * len(msg) enter_win.addstr(0,0,msg) + STDSCR.addstr(4,135,"Press tab to exit and ESC to reset") msg = "> " + str(saved) enter_win.addstr(0,0,msg) @@ -492,29 +475,118 @@ def gameScreen(pauseSec, diffc, ptype): if EXIT_GAME: break - # ------------------------------------------------------------------------------ # Stat Screen # ------------------------------------------------------------------------------ -def userstats(): - stat_win = curses.newwin(30, 10, 10, 15) - stat_win.addstr(5,6,"This is userstats window") - stat_win.box() - score_formatline = [] +def statScreen(): stop_thread() - stat_win.addstr(6,6,"user name: ") - stat_win.addstr(7,6,"level#: ") - stat_win.addstr(8,6,"score#: ") -############################################################################### -# -# Draws -# -############################################################################### + ofile = open(DATA_FILE, "r") + + length = 75 + stat_win = curses.newwin(30, length, 10, MAX_X/2 - length/2) + score_formatline = {} + for line in ofile: + + # remove white spaces + line = line.strip() + # remove [ ] + line = line.lstrip('[') + line = line.rstrip(']') + + user = "" + level = "" + score = "" + hit = "" + miss = "" + acc = "" + + user, level, score, hit, miss, acc = line.split(',') + user = user.strip("'") + level = level.strip() + score = score.strip() + hit = hit.strip() + miss = miss.strip() + acc = acc.strip() + + rank = 1 + + scores = list(score_formatline.keys()) + scores.sort() + scores.reverse() + + formatline = 'Best Top 10 users' + stat_win.addstr(rank -1-1-1-1 + 10 ,5,formatline,curses.A_BOLD) + + formatline = '{0:20} {1:5} {2:8} {3:8} {4:8} {5:8}'.format( + "Name","Level","Score","Hit","Miss","Accuracy") + stat_win.addstr(rank -1-1 + 10 ,5,formatline) + formatline = '{0:20} {1:5} {2:8} {3:8} {4:8} {5:8}'.format( + "-"*20,"-"*5,"-"*8,"-"*8,"-"*8,"-"*8) + stat_win.addstr(rank -1 + 10 ,5,formatline,curses.A_BOLD) + + for score in scores: + # top comes first + for line in score_formatline[score]: + if rank >= 11: + break + stat_win.addstr(rank + 10 ,5,line,curses.A_BOLD) + rank += 1 + + if rank >= 11: + break + + test_pan = curses.panel.new_panel(stat_win) + test_pan.top() + curses.panel.update_panels() + STDSCR.noutrefresh(); curses.doupdate() + +def gameOverScreen(): + STDSCR.clear() + STDSCR.refresh() + + if ACCU_HIT_PER_ROUND + ACCU_MISS_PER_ROUND == 0: + accuracy = 0 + else: + accuracy = float(ACCU_HIT_PER_ROUND)/ (ACCU_HIT_PER_ROUND+ ACCU_MISS_PER_ROUND) * 100 + + win1 = curses.newwin(20,20, 5, 5) + win1.addstr(1,1,"Game over") + win1.addstr(2,1, "BEST LEVEL: " + str(LEVEL)) + win1.addstr(3,1, "TOTAL SCORE: " + str(ACCU_SCORE)) + win1.addstr(4,1, "HIT: " + str(ACCU_HIT_PER_ROUND)) + win1.addstr(5,1, "MISS: " + str(ACCU_MISS_PER_ROUND)) + win1.addstr(6,1, "OVERALL Accuracy: " + str(accuracy) + "%") + + win1.noutrefresh(); curses.doupdate() + goal_pan = curses.panel.new_panel(win1) + + curses.echo() + msg = "Enter your name: " + STDSCR.addstr(11, 20,msg) + STDSCR.addstr(12, 20 + len(msg),"") + uinput = STDSCR.getstr(19, 20 + len(msg), 20) + # save to the file + + if uinput != "": + to_save = [] + to_save.append(str(uinput.decode('ascii'))) + to_save.append(LEVEL) + to_save.append(ACCU_SCORE) + to_save.append(ACCU_HIT_PER_ROUND) + to_save.append(ACCU_MISS_PER_ROUND) + to_save.append(accuracy) + mfile = open(DATA_FILE,"a") + mfile.write(str(to_save)+"\n") + mfile.close() + + curses.noecho() + # ------------------------------------------------------------------------------ # Draw goal # ------------------------------------------------------------------------------ def drawGoal(current, goal): + goal_win = curses.newwin(3,18, 3, 90) goal_win.addstr(1,2,"CURRENT: " + str(current) + "/" +str(goal)) goal_win.box() @@ -527,6 +599,7 @@ def drawGoal(current, goal): # ------------------------------------------------------------------------------ # Draw life bar # ------------------------------------------------------------------------------ + def drawLife(lose): left = True @@ -550,6 +623,7 @@ def drawLife(lose): # Draw score #------------------------------------------------------------------------------ def drawScore(score = 0): + # Create a score window/panel l = 3 w = 50 @@ -564,7 +638,7 @@ def drawScore(score = 0): #------------------------------------------------------------------------------ # Draw combos #------------------------------------------------------------------------------ -def drawCombo(combo = 0, score = 0): +def drawCombo(combo , score ): """ draws combo panel on the screen to show combo score of the user @@ -594,18 +668,13 @@ def drawCombo(combo = 0, score = 0): # start fall word # ------------------------------------------------------------------- def start_fall_word(pauseSec, is_demo, diffc, ptype): - count_worddown = 0 - word_wordObj = {} - - #comboTimerCount = 1 - #showCombo = False # Create a combo window/panel combo_win = curses.newwin(10,10,5,5) combo_pan = curses.panel.new_panel(combo_win) combo_pan.hide() - # init + # init global ACCU_SCORE global EXIT_GAME global GO_NEXT @@ -676,6 +745,7 @@ def start_fall_word(pauseSec, is_demo, diffc, ptype): EXIT_GAME = True else: wordObj.moveDown() + new_word_interval += 1 count_worddown = 0 @@ -780,22 +850,48 @@ def getPauseSec(count, sec): msum = count % (weight * sec) return msum == 0 +def slow(): + for i in range(1,999999/2): + pass + for i in range(1,999999): + pass + +def drawCoor(): + STDSCR.clear() + #draw line 0 - off 1 - on + STDSCR.border(0) + STDSCR.refresh() + for x in range(MAX_X): + STDSCR.addstr(2,x, str(x%10)) + if x % 10 == 0: + STDSCR.addstr(1,x, str(x//10)) + + for y in range(MAX_Y): + STDSCR.addstr(y,2, str(y%10)) + if (y % 10 == 0): + STDSCR.addstr(y,1, str(y//10)) + + STDSCR.refresh() +# ------------------------------------------------------------------------------ +# Read English words +# ------------------------------------------------------------------------------ def readEngWord(): global ENG_WORDS global ENG_WORDS_LEN - # OPEN FILE - eng_file = open(ENG_FILE,"r") - ENG_WORDS = eng_file.readlines() + mfile = open(ENG_FILE,"r") + ENG_WORDS = mfile.readlines() ENG_WORDS_LEN = len(ENG_WORDS) - +# ------------------------------------------------------------------------------ +# Read Python commands +# ------------------------------------------------------------------------------ def readPhyWord(): global PY_WORDS global PY_WORDS_LEN #read files - py_file = open(PY_FILE,"r") - PY_WORDS = py_file.readlines() + mfile = open(PY_FILE,"r") + PY_WORDS = mfile.readlines() PY_WORDS_LEN = len(PY_WORDS) # ------------------------------------------------------------------------------ @@ -835,41 +931,4 @@ def printError(msg): #exit program sys.exit() - -def drawCoor(): - STDSCR.clear() - STDSCR.border(0) - STDSCR.refresh() - for x in range(MAX_X): - STDSCR.addstr(2,x, str(x%10)) - if (x % 10 == 0): - STDSCR.addstr(1,x, str(x//10)) - - for y in range(MAX_Y): - STDSCR.addstr(y,2, str(y%10)) - if (y % 10 == 0): - STDSCR.addstr(y,1, str(y//10)) - - STDSCR.refresh() - -def my_raw_input(stdscr, r, c, prompt_string): - curses.echo() - stdscr.addstr(r, c, prompt_string) - stdscr.refresh() - input = stdscr.getstr(r + 1, c, 20) - return input # ^^^^ reading input at next line - -def clear_line(y): - empty = " " * SCR_X_MAX - STDSCR.addstr(y, 1, empty) - -def debug(msg, level): - y = SCR_Y_MAX - 10 + level - clear_line(y) - - - -############################################################################### -# START -############################################################################### curses.wrapper(main) From 79135bc85cf205f8437f6942443a6aae23cf067f Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Thu, 16 Jun 2016 13:21:54 -0400 Subject: [PATCH 37/39] shows current score --- ICS4U-PCP_GIT/ICS4U-PCP.py | 76 +++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 14 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index b8ca372..22fb7a4 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -1,4 +1,3 @@ - import sys import curses import curses.panel @@ -129,6 +128,7 @@ def __init__(self, diffc="hard", ptype="coding"): self.panel = curses.panel.new_panel(win) self.panel.bottom() + def getX(self): return self.x @@ -365,7 +365,6 @@ def mainGameScreen(): main_rc = 1 gameScreen(WORD_START_PAUSE, diffc, ptype) - gameOverScreen() break # reset @@ -465,6 +464,7 @@ def gameScreen(pauseSec, diffc, ptype): if GO_NEXT: STDSCR.addstr(5,20,"****** Completed ********") + showCurrentScoreScreen() pauseSec = pauseSec /2 #speed @@ -501,6 +501,8 @@ def statScreen(): miss = "" acc = "" + #1 2 3 4 5 6 + #split by comma user, level, score, hit, miss, acc = line.split(',') user = user.strip("'") level = level.strip() @@ -509,8 +511,16 @@ def statScreen(): miss = miss.strip() acc = acc.strip() - rank = 1 + formatline = '{0:20} {1:5} {2:8} {3:8} {4:8} {5:8}'.format( + user,level,score,hit,miss,acc+"%") + + if int(score) in score_formatline: + score_formatline[int(score)].append(formatline) + else: + score_formatline[int(score)] = [ formatline ] + rank = 1 + # display only top 10 scores = list(score_formatline.keys()) scores.sort() scores.reverse() @@ -536,21 +546,55 @@ def statScreen(): if rank >= 11: break + ofile.close() test_pan = curses.panel.new_panel(stat_win) test_pan.top() curses.panel.update_panels() STDSCR.noutrefresh(); curses.doupdate() -def gameOverScreen(): + +#------------------------------------------------------------------------------ +# Show Current Score screen +# - show after each game +#------------------------------------------------------------------------------ + +def showCurrentScoreScreen(): STDSCR.clear() STDSCR.refresh() + if IS_DEBUG: + drawCoor() + global LEVEL - if ACCU_HIT_PER_ROUND + ACCU_MISS_PER_ROUND == 0: + l = 20 + w = 50 + x = 3 + y = 3 + + if (HIT_PER_ROUND + MISS_PER_ROUND) == 0: accuracy = 0 else: - accuracy = float(ACCU_HIT_PER_ROUND)/ (ACCU_HIT_PER_ROUND+ ACCU_MISS_PER_ROUND) * 100 + accuracy = (float(HIT_PER_ROUND)/ (HIT_PER_ROUND + MISS_PER_ROUND)) * 100 + + accuracy = float("{0:.2f}".format(accuracy)) + goal_win = curses.newwin(l, w, y, x) + goal_win.addstr(1,1, "LEVEL: " + str(LEVEL)) + goal_win.addstr(2,1, "SCORE: " + str(ACCU_SCORE)) + goal_win.addstr(3,1, "HIT: " + str(HIT_PER_ROUND)) + goal_win.addstr(4,1, "MISS: " + str(MISS_PER_ROUND)) + goal_win.addstr(5,1, "Accuracy: " + str(accuracy) + "%") + goal_win.addstr(6,1, "Excellent " + str(EXC_COUNT)) + goal_win.addstr(7,1, "Good: " + str(GOOD_COUNT)) + goal_win.addstr(8,1, "Average: " + str(AVG_COUNT)) - win1 = curses.newwin(20,20, 5, 5) + goal_pan = curses.panel.new_panel(goal_win) + curses.panel.update_panels() + goal_win.noutrefresh();curses.doupdate() + goal_pan.hide() + LEVEL += 1 + + accuracy = float("{0:.2f}".format(accuracy)) + + win1 = curses.newwin(30,30, 5, 5) win1.addstr(1,1,"Game over") win1.addstr(2,1, "BEST LEVEL: " + str(LEVEL)) win1.addstr(3,1, "TOTAL SCORE: " + str(ACCU_SCORE)) @@ -563,11 +607,10 @@ def gameOverScreen(): curses.echo() msg = "Enter your name: " - STDSCR.addstr(11, 20,msg) - STDSCR.addstr(12, 20 + len(msg),"") + STDSCR.addstr(19, 20,msg) + STDSCR.addstr(19, 20 + len(msg),"__________________") uinput = STDSCR.getstr(19, 20 + len(msg), 20) # save to the file - if uinput != "": to_save = [] to_save.append(str(uinput.decode('ascii'))) @@ -586,7 +629,6 @@ def gameOverScreen(): # Draw goal # ------------------------------------------------------------------------------ def drawGoal(current, goal): - goal_win = curses.newwin(3,18, 3, 90) goal_win.addstr(1,2,"CURRENT: " + str(current) + "/" +str(goal)) goal_win.box() @@ -668,7 +710,6 @@ def drawCombo(combo , score ): # start fall word # ------------------------------------------------------------------- def start_fall_word(pauseSec, is_demo, diffc, ptype): - # Create a combo window/panel combo_win = curses.newwin(10,10,5,5) combo_pan = curses.panel.new_panel(combo_win) @@ -802,9 +843,9 @@ def start_fall_word(pauseSec, is_demo, diffc, ptype): lastSaved = USER_ENT - # + # Duration of combo box - # + if showCombo: comboTimerCount += 1 STDSCR.addstr(40,5,str(comboTimerCount)) @@ -856,6 +897,10 @@ def slow(): for i in range(1,999999): pass + +# ------------------------------------------------------------------------------ +# Draw coordinates +# ------------------------------------------------------------------------------ def drawCoor(): STDSCR.clear() #draw line 0 - off 1 - on @@ -931,4 +976,7 @@ def printError(msg): #exit program sys.exit() +############################################################################### +# START +############################################################################### curses.wrapper(main) From 3784031ac2ffe1fa0f991910e1c468b7462e745f Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Fri, 17 Jun 2016 13:45:44 -0400 Subject: [PATCH 38/39] Final --- ICS4U-PCP_GIT/ICS4U-PCP.py | 60 ++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index 22fb7a4..e5d22b3 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -4,9 +4,7 @@ import threading from random import randint -# ------------------------------------------------------------------------------ # Global variables -# ------------------------------------------------------------------------------ IS_DEBUG = False WORD_START_PAUSE = 0.2 # Initial word speed. Lower is Faster DATA_FILE = "data.dat" @@ -47,7 +45,6 @@ THREAD_OBJ = "" is_word_down_thread_stop = False # True: Stop falling words. # False: Start falling words - NEW_WORD_FREQ = 10 # lower, sooner ENG_WORDS = [] ENG_WORDS_LEN = 0 @@ -365,6 +362,7 @@ def mainGameScreen(): main_rc = 1 gameScreen(WORD_START_PAUSE, diffc, ptype) + gameOverScreen() break # reset @@ -464,6 +462,7 @@ def gameScreen(pauseSec, diffc, ptype): if GO_NEXT: STDSCR.addstr(5,20,"****** Completed ********") + dummy = drawContinue() showCurrentScoreScreen() pauseSec = pauseSec /2 @@ -551,13 +550,12 @@ def statScreen(): test_pan.top() curses.panel.update_panels() STDSCR.noutrefresh(); curses.doupdate() - + dummy = drawContinue() #------------------------------------------------------------------------------ # Show Current Score screen # - show after each game #------------------------------------------------------------------------------ - def showCurrentScoreScreen(): STDSCR.clear() STDSCR.refresh() @@ -569,7 +567,6 @@ def showCurrentScoreScreen(): w = 50 x = 3 y = 3 - if (HIT_PER_ROUND + MISS_PER_ROUND) == 0: accuracy = 0 else: @@ -589,9 +586,24 @@ def showCurrentScoreScreen(): goal_pan = curses.panel.new_panel(goal_win) curses.panel.update_panels() goal_win.noutrefresh();curses.doupdate() + dummy = drawContinue() goal_pan.hide() LEVEL += 1 + +# ------------------------------------------------------------------------------ +# Game over screen +# ------------------------------------------------------------------------------ +def gameOverScreen(): + STDSCR.clear() + STDSCR.refresh() + if IS_DEBUG: + drawCoor() + if ACCU_HIT_PER_ROUND + ACCU_MISS_PER_ROUND == 0: + accuracy = 0 + else: + accuracy = float(ACCU_HIT_PER_ROUND)/ (ACCU_HIT_PER_ROUND+ ACCU_MISS_PER_ROUND) * 100 + accuracy = float("{0:.2f}".format(accuracy)) win1 = curses.newwin(30,30, 5, 5) @@ -624,6 +636,25 @@ def showCurrentScoreScreen(): mfile.close() curses.noecho() + dummy = drawContinue() + # will return back to main screen + +def drawContinue(): + msg = "Press any to continue..." + w = len(str(msg)) + 2 + l = 3 + y = 40 + x = 20 + win = curses.newwin(l, w, y, x) + win.addstr(1,1,msg) + win.box() + + pan = curses.panel.new_panel(win) + curses.panel.update_panels() + win.noutrefresh();curses.doupdate() + STDSCR.getch() + pan.hide() + return pan # ------------------------------------------------------------------------------ # Draw goal @@ -665,7 +696,12 @@ def drawLife(lose): # Draw score #------------------------------------------------------------------------------ def drawScore(score = 0): - + """ + draws score panel on the screen + to show score of the user + :param score: int - the score of the user + :return: panel - the panel that contains the user scores + """ # Create a score window/panel l = 3 w = 50 @@ -843,9 +879,9 @@ def start_fall_word(pauseSec, is_demo, diffc, ptype): lastSaved = USER_ENT - + # # Duration of combo box - + # if showCombo: comboTimerCount += 1 STDSCR.addstr(40,5,str(comboTimerCount)) @@ -902,6 +938,10 @@ def slow(): # Draw coordinates # ------------------------------------------------------------------------------ def drawCoor(): + """ + draws coordinates on the screen while debugging + :return: None + """ STDSCR.clear() #draw line 0 - off 1 - on STDSCR.border(0) @@ -976,6 +1016,8 @@ def printError(msg): #exit program sys.exit() + + ############################################################################### # START ############################################################################### From 34bc3626102fffaa5b90c67fc5e2a13494bd4107 Mon Sep 17 00:00:00 2001 From: Aaron Choi Date: Sat, 18 Jun 2016 17:45:18 -0400 Subject: [PATCH 39/39] docstring done --- ICS4U-PCP_GIT/ICS4U-PCP.py | 161 +++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 80 deletions(-) diff --git a/ICS4U-PCP_GIT/ICS4U-PCP.py b/ICS4U-PCP_GIT/ICS4U-PCP.py index e5d22b3..6410e1b 100644 --- a/ICS4U-PCP_GIT/ICS4U-PCP.py +++ b/ICS4U-PCP_GIT/ICS4U-PCP.py @@ -1,10 +1,25 @@ +""" +------------------------------------------------------------------------------- +Name: textblaster.py +Purpose: + to create a program with the reference of SNAKES GAME + (https://gist.githubusercontent.com/sanchitgangwar/2158089/raw/5f3d0003801acfe1a29c4b24f2c8975efacf6f66/snake.py) + that can help computer learners who want to practice + and improve their typing skills (speed,accuracy) + and review python-terms easily and interestingly. + +Author: choi.A + +Created: 18/06/2016 +------------------------------------------------------------------------------ +""" + import sys import curses import curses.panel import threading from random import randint -# Global variables IS_DEBUG = False WORD_START_PAUSE = 0.2 # Initial word speed. Lower is Faster DATA_FILE = "data.dat" @@ -43,19 +58,14 @@ STDSCR = "" THREAD_OBJ = "" -is_word_down_thread_stop = False # True: Stop falling words. - # False: Start falling words +is_word_down_thread_stop = False # True: Stop falling words. # False: Start falling words NEW_WORD_FREQ = 10 # lower, sooner ENG_WORDS = [] ENG_WORDS_LEN = 0 PY_WORDS = [] PY_WORDS_LEN = 0 -# ------------------------------------------------------------------------------ -# class Word -# ------------------------------------------------------------------------------ # Create a word object placed in a panel - class Word(object): """ Representation of words @@ -125,14 +135,25 @@ def __init__(self, diffc="hard", ptype="coding"): self.panel = curses.panel.new_panel(win) self.panel.bottom() - def getX(self): + """ + gets x coordinate of words + :return: int - x coordinate of words + """ return self.x def getY(self): + """ + get y coordinate of words + :return: int - y coordinate of words + """ return self.y def moveDown(self): + """ + moves words down by 1 + :return: None + """ # y, x self.panel.move(self.y, self.x) curses.panel.update_panels() @@ -140,12 +161,13 @@ def moveDown(self): self.y += 1 def delWord(self): + """ + hides words from the screen + :return: None + """ self.panel.hide() curses.panel.update_panels(); STDSCR.refresh() -#------------------------------------------------------------------------------ -# main -#------------------------------------------------------------------------------ def main(stdscr): """ set up for the game to start and runs by calling the main page @@ -204,14 +226,6 @@ def main(stdscr): curses.endwin() -############################################################################### -# -# Screens -# -############################################################################### -#------------------------------------------------------------------------------ -# main Game screen -#------------------------------------------------------------------------------ def mainGameScreen(): """ makes the main screen of the game @@ -377,9 +391,6 @@ def mainGameScreen(): return main_rc -#------------------------------------------------------------------------------ -# game screen -#------------------------------------------------------------------------------ def gameScreen(pauseSec, diffc, ptype): """ makes game screen on the user screen to run the game @@ -474,11 +485,12 @@ def gameScreen(pauseSec, diffc, ptype): if EXIT_GAME: break -# ------------------------------------------------------------------------------ -# Stat Screen -# ------------------------------------------------------------------------------ def statScreen(): + """ + shows the top rankers of the game + :return: None + """ stop_thread() ofile = open(DATA_FILE, "r") @@ -552,11 +564,11 @@ def statScreen(): STDSCR.noutrefresh(); curses.doupdate() dummy = drawContinue() -#------------------------------------------------------------------------------ -# Show Current Score screen -# - show after each game -#------------------------------------------------------------------------------ def showCurrentScoreScreen(): + """ + shows the user stats at the end of every level + :return: None + """ STDSCR.clear() STDSCR.refresh() if IS_DEBUG: @@ -590,11 +602,11 @@ def showCurrentScoreScreen(): goal_pan.hide() LEVEL += 1 - -# ------------------------------------------------------------------------------ -# Game over screen -# ------------------------------------------------------------------------------ def gameOverScreen(): + """ + shows the user stats on the screen when the game is over + :return: None + """ STDSCR.clear() STDSCR.refresh() if IS_DEBUG: @@ -640,6 +652,11 @@ def gameOverScreen(): # will return back to main screen def drawContinue(): + """ + draws enter panel on the screen + in order to go to the next screen + :return: panel - the panel that contains message + """ msg = "Press any to continue..." w = len(str(msg)) + 2 l = 3 @@ -656,10 +673,13 @@ def drawContinue(): pan.hide() return pan -# ------------------------------------------------------------------------------ -# Draw goal -# ------------------------------------------------------------------------------ def drawGoal(current, goal): + """ + draws the game goal and current words counts on the screen + :param current: int - the current words counts + :param goal: int - the game goal in order to pass the level + :return: panel - the panel that contains game goal and current words counts + """ goal_win = curses.newwin(3,18, 3, 90) goal_win.addstr(1,2,"CURRENT: " + str(current) + "/" +str(goal)) goal_win.box() @@ -669,11 +689,13 @@ def drawGoal(current, goal): goal_win.noutrefresh();curses.doupdate() return goal_pan -# ------------------------------------------------------------------------------ -# Draw life bar -# ------------------------------------------------------------------------------ - def drawLife(lose): + """ + draws life pnael on the screen + to show the game lives of the user + :param lose: int - the miss count of the user + :return: panel - the life bar of the user contains user lives + """ left = True life_win = curses.newwin(MAX_Y-3 ,3, 3, 3) @@ -692,9 +714,6 @@ def drawLife(lose): return life_pan, left -#------------------------------------------------------------------------------ -# Draw score -#------------------------------------------------------------------------------ def drawScore(score = 0): """ draws score panel on the screen @@ -713,9 +732,6 @@ def drawScore(score = 0): score_win.noutrefresh();curses.doupdate() return score_pan -#------------------------------------------------------------------------------ -# Draw combos -#------------------------------------------------------------------------------ def drawCombo(combo , score ): """ draws combo panel on the screen @@ -736,16 +752,16 @@ def drawCombo(combo , score ): combo_win.noutrefresh();curses.doupdate() return combo_pan - -############################################################################### -# -# MISC. -# -############################################################################### -# ------------------------------------------------------------------- -# start fall word -# ------------------------------------------------------------------- def start_fall_word(pauseSec, is_demo, diffc, ptype): + """ + falls words down on the user screen + :param pauseSec: int - amount of puase time + :param is_demo: boolean - whether demo or gameplay + :param diffc: str - difficulty of the game + :param ptype: str - user selected game type + :return: None + """ + # Create a combo window/panel combo_win = curses.newwin(10,10,5,5) combo_pan = curses.panel.new_panel(combo_win) @@ -893,9 +909,6 @@ def start_fall_word(pauseSec, is_demo, diffc, ptype): count_worddown += 1 -#------------------------------------------------------------------------------ -# stop thread -#------------------------------------------------------------------------------ def stop_thread(): """ stops thread on the screen @@ -908,10 +921,6 @@ def stop_thread(): pass is_word_down_thread_stop = False - -#------------------------------------------------------------------------------ -# get pause sec -#------------------------------------------------------------------------------ def getPauseSec(count, sec): """ divide count by sec and check if the remainder is 0 @@ -933,10 +942,6 @@ def slow(): for i in range(1,999999): pass - -# ------------------------------------------------------------------------------ -# Draw coordinates -# ------------------------------------------------------------------------------ def drawCoor(): """ draws coordinates on the screen while debugging @@ -958,20 +963,24 @@ def drawCoor(): STDSCR.refresh() -# ------------------------------------------------------------------------------ -# Read English words -# ------------------------------------------------------------------------------ def readEngWord(): + """ + reads english words from a data file called ENG_FILE + and stores each word in a variable called ENG+WORDS + :return: None + """ global ENG_WORDS global ENG_WORDS_LEN mfile = open(ENG_FILE,"r") ENG_WORDS = mfile.readlines() ENG_WORDS_LEN = len(ENG_WORDS) -# ------------------------------------------------------------------------------ -# Read Python commands -# ------------------------------------------------------------------------------ def readPhyWord(): + """ + reads Python commands from a data file called PY_FILE + and stores each command in a variable called PY_WORDS. + :return: None + """ global PY_WORDS global PY_WORDS_LEN #read files @@ -979,9 +988,6 @@ def readPhyWord(): PY_WORDS = mfile.readlines() PY_WORDS_LEN = len(PY_WORDS) -# ------------------------------------------------------------------------------ -# Check requirements -# ------------------------------------------------------------------------------ def checkReq(): """ checks whether the game screen fits the user screen size @@ -997,9 +1003,6 @@ def checkReq(): "Current: " + str(MAX_X) + " X " + str(MAX_Y) + ". " "Required: " + str(REQ_X) + " X " + str(REQ_Y) ) -# ------------------------------------------------------------------------------ -# Print error message -# ------------------------------------------------------------------------------ def printError(msg): """ prints the given error message @@ -1016,8 +1019,6 @@ def printError(msg): #exit program sys.exit() - - ############################################################################### # START ###############################################################################