File tree 2 files changed +23
-0
lines changed
10-external-libraries/rocks-game
11-error-handling/rocks-game
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ #################################
2
+ #
3
+ # NOTE TO WINDOWS USERS: Please see the following github issue
4
+ # if you find weird characters instead color from colorama:
5
+ #
6
+ # https://github.com/talkpython/python-for-absolute-beginners-course/issues/7
7
+ #
8
+ # Apparently, even though it's supposed to adjust automatically, it doesn't always.
9
+ # We've added a test to force it to do so at the beginning of main().
10
+ #
11
+
1
12
import datetime
2
13
import random
3
14
import json
4
15
import os
16
+ import platform
5
17
18
+ import colorama
6
19
from colorama import Fore
7
20
from prompt_toolkit import prompt
8
21
from prompt_toolkit .completion import WordCompleter , Completer , Completion
11
24
12
25
13
26
def main ():
27
+ # See comment at top of file.
28
+ if platform .system () == 'Windows' :
29
+ colorama .init (convert = True )
30
+
14
31
print (Fore .WHITE )
15
32
log ("App starting up..." )
16
33
Original file line number Diff line number Diff line change 1
1
import datetime
2
+ import platform
2
3
import random
3
4
import json
4
5
import os
5
6
7
+ import colorama
6
8
from colorama import Fore
7
9
8
10
rolls = {}
9
11
10
12
11
13
def main ():
12
14
try :
15
+ # See comment at top of the rpsgame.py in CHAPTER 10.
16
+ if platform .system () == 'Windows' :
17
+ colorama .init (convert = True )
18
+
13
19
print (Fore .WHITE )
14
20
log ("App starting up..." )
15
21
You can’t perform that action at this time.
0 commit comments