How to execute (.py) Python files locally in the web browser?

Is there a way to execute (.py) Python files locally in a web browser without running a web server? Do not use an external service too. Therefore, if the Internet is not available, the file will still run in the browser. I want to run this code on my PC in Chrome or IE. Thank you.

def concept (phrase):

# divide var (phrase) into spaces and assign to var (words)
words = phrase.split ()

# use this to list the titles of Python files and the links to open them
files = {1: "file0001.txt",
2: "file0002.txt",
3: "file0003.txt",
4: "file0004.txt",
5: "file0005.txt",
6: "file0006.txt",
7: "file0007.txt",
8: "file0008.txt",
9: "file0009.txt"}

# Change the keys to search for simple keyword phrases.
Concepts = {& # 39; GAMES & # 39;[1,2,4,3,3],
& # 39; TWENTY & # 39;[5,3,5,3,5],
& # 39; MACHINE & # 39;[4,9,9,9,4],
& # 39; DATABASE & # 39;[5,3,3,3,5],
& # 39; LEARNING & # 39;[4,9,4,9,4]}

# iterate through all the var (words) found in var (word)
for word in words:
# convert to uppercase, search var (word) in dict & # 39; concepts & # 39 ;, if it is not found, the return is not found "
if word.upper () is not in the concepts:
print ("& # 39; {} & # 39 ;: not found in the database  n" .format (word)) not in the concepts
plus:
# to match the keys in the values ​​in the list & # 39; concept & # 39; of dict in the & # 39; files & # 39; from dict
by pattern in concepts[word.upper()]:
print (files[pattern])

# returns the input box at the end of the query
while True
concept (entry ("Introduce idea of ​​the concept:"))