-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debug the main.py function for the new game function
- Loading branch information
1 parent
a7f0c59
commit 0e8f1a8
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file specifies files that are *not* uploaded to Google Cloud | ||
# using gcloud. It follows the same syntax as .gitignore, with the addition of | ||
# "#!include" directives (which insert the entries of the given .gitignore-style | ||
# file at that point). | ||
# | ||
# For more information, run: | ||
# $ gcloud topic gcloudignore | ||
# | ||
.gcloudignore | ||
# If you would like to upload your .git directory, .gitignore file or files | ||
# from your .gitignore file, remove the corresponding line | ||
# below: | ||
.git | ||
.gitignore | ||
|
||
node_modules | ||
#!include:.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from time import sleep | ||
import asyncio | ||
|
||
|
||
def background(f): | ||
def wrapper(*args,**kwargs): | ||
return asyncio.get_event_loop().run_in_executor(None,f,*args,**kwargs) | ||
return wrapper | ||
|
||
@background | ||
def loop_function(i): | ||
for j in range(10): | ||
loop_function2(j) | ||
|
||
def loop_function2(i): | ||
for k in range(10): | ||
sleep(2) | ||
loop_function3(k) | ||
|
||
|
||
def loop_function3(i): | ||
print(i) | ||
sleep(2) | ||
|
||
loop = asyncio.get_event_loop() | ||
looper = asyncio.gather(*[loop_function(i) for i in range(100) ]) | ||
loop.run_until_complete(looper) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gGnj0vj7GTpCMDHdUU7AoVhAIBWaNcS74VGyODkEt4ZDV9SdQiI4LRBGwgnryT2r |