scratch-syntax 0.7.0__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {scratch_syntax-0.7.0/src/scratch_syntax.egg-info → scratch_syntax-0.7.2}/PKG-INFO +4 -1
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/README.md +2 -0
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/pyproject.toml +6 -2
- scratch_syntax-0.7.2/src/scratch_syntax/core.py +96 -0
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2/src/scratch_syntax.egg-info}/PKG-INFO +4 -1
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/src/scratch_syntax.egg-info/SOURCES.txt +1 -0
- scratch_syntax-0.7.2/src/scratch_syntax.egg-info/requires.txt +1 -0
- scratch_syntax-0.7.0/src/scratch_syntax/core.py +0 -95
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/LICENSE +0 -0
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/setup.cfg +0 -0
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/src/scratch_syntax/__init__.py +0 -0
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/src/scratch_syntax.egg-info/dependency_links.txt +0 -0
- {scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/src/scratch_syntax.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scratch_syntax
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: A syntax library designed to help scratch users transition to python
|
|
5
5
|
Author-email: Cade <cadey.matignas@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/cadeymatignas-source/scratch_syntax
|
|
@@ -10,6 +10,7 @@ Classifier: Operating System :: OS Independent
|
|
|
10
10
|
Requires-Python: >=3.8
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
|
+
Requires-Dist: keyboard>=0.1.0
|
|
13
14
|
Dynamic: license-file
|
|
14
15
|
|
|
15
16
|
# Scratch_Syntax
|
|
@@ -70,6 +71,8 @@ Also btw don't forget to put from scratch_syntax import * so the functions run c
|
|
|
70
71
|
## Update 0.7.0 notes. Keyboard update!!!
|
|
71
72
|
* Added keyboard function (when_key_pressed())!!!
|
|
72
73
|
|
|
74
|
+
## Update 0.7.2 note:
|
|
75
|
+
* I changed the wait_until function a bit so now it goes ```wait_until(condition) ``` instead of ```wait_until(action, condition)```
|
|
73
76
|
|
|
74
77
|
|
|
75
78
|
# All Functions
|
|
@@ -56,6 +56,8 @@ Also btw don't forget to put from scratch_syntax import * so the functions run c
|
|
|
56
56
|
## Update 0.7.0 notes. Keyboard update!!!
|
|
57
57
|
* Added keyboard function (when_key_pressed())!!!
|
|
58
58
|
|
|
59
|
+
## Update 0.7.2 note:
|
|
60
|
+
* I changed the wait_until function a bit so now it goes ```wait_until(condition) ``` instead of ```wait_until(action, condition)```
|
|
59
61
|
|
|
60
62
|
|
|
61
63
|
# All Functions
|
|
@@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scratch_syntax"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.2"
|
|
8
8
|
authors = [
|
|
9
|
-
|
|
9
|
+
{ name="Cade", email="cadey.matignas@gmail.com" },
|
|
10
10
|
]
|
|
11
11
|
description = "A syntax library designed to help scratch users transition to python"
|
|
12
12
|
readme = "README.md"
|
|
@@ -16,5 +16,9 @@ classifiers = [
|
|
|
16
16
|
"License :: OSI Approved :: MIT License",
|
|
17
17
|
"Operating System :: OS Independent",
|
|
18
18
|
]
|
|
19
|
+
|
|
20
|
+
dependencies = [
|
|
21
|
+
"keyboard>=0.1.0",
|
|
22
|
+
]
|
|
19
23
|
[project.urls]
|
|
20
24
|
Homepage = "https://github.com/cadeymatignas-source/scratch_syntax"
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
__lazy_modules__ = ["random", "time", "sys", "keyboard"]
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from random import randint
|
|
5
|
+
from time import sleep
|
|
6
|
+
|
|
7
|
+
from keyboard import is_pressed
|
|
8
|
+
|
|
9
|
+
_scratch_data = {"answer": ""}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def say(text):
|
|
13
|
+
"""This function says text. etc. say("hello")"""
|
|
14
|
+
print(text)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def say_for_seconds(texty, secs):
|
|
18
|
+
"""This function is basically saying text then waiting. etc. say_for_seconds("hello", 2)"""
|
|
19
|
+
print(texty)
|
|
20
|
+
sleep(secs)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def ask(question):
|
|
24
|
+
"""This one is like scratch's ask then wait function"""
|
|
25
|
+
_scratch_data["answer"] = input(question)
|
|
26
|
+
return _scratch_data["answer"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def answer():
|
|
30
|
+
return _scratch_data["answer"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def wait(seconds):
|
|
34
|
+
"""This function waits. etc. wait(1)"""
|
|
35
|
+
sleep(seconds)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def pick_random_number_from(a, b):
|
|
39
|
+
"""Picks a random number. example: pick_random_numer_from(1,100)"""
|
|
40
|
+
return randint(a, b)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def stop_all():
|
|
44
|
+
sys.exit(0)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def add_to_list(listname, item):
|
|
48
|
+
listname.append(item)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def insert_in_list(listname, index, item):
|
|
52
|
+
listname.insert(index, item)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def delete_from_list(listname, index):
|
|
56
|
+
listname.pop(index)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def delete_all_from_list(listname):
|
|
60
|
+
listname.clear()
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def replace_in_list(listname, index, item):
|
|
64
|
+
listname[index] = item
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def wait_until(condit):
|
|
68
|
+
while not condit:
|
|
69
|
+
sleep(1)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def repeat(action, timy):
|
|
73
|
+
for _ in range(timy):
|
|
74
|
+
action()
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def forever(actiono):
|
|
78
|
+
while True:
|
|
79
|
+
actiono()
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def repeat_until(actionon, condition):
|
|
83
|
+
"""This one repeats until condition becomes true"""
|
|
84
|
+
while True:
|
|
85
|
+
actionon()
|
|
86
|
+
if condition():
|
|
87
|
+
break
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def when_key_pressed(key):
|
|
91
|
+
"""This function checks when key is pressed"""
|
|
92
|
+
if is_pressed(key):
|
|
93
|
+
while is_pressed(key):
|
|
94
|
+
sleep(0.1)
|
|
95
|
+
return True
|
|
96
|
+
return False
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scratch_syntax
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: A syntax library designed to help scratch users transition to python
|
|
5
5
|
Author-email: Cade <cadey.matignas@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/cadeymatignas-source/scratch_syntax
|
|
@@ -10,6 +10,7 @@ Classifier: Operating System :: OS Independent
|
|
|
10
10
|
Requires-Python: >=3.8
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
|
+
Requires-Dist: keyboard>=0.1.0
|
|
13
14
|
Dynamic: license-file
|
|
14
15
|
|
|
15
16
|
# Scratch_Syntax
|
|
@@ -70,6 +71,8 @@ Also btw don't forget to put from scratch_syntax import * so the functions run c
|
|
|
70
71
|
## Update 0.7.0 notes. Keyboard update!!!
|
|
71
72
|
* Added keyboard function (when_key_pressed())!!!
|
|
72
73
|
|
|
74
|
+
## Update 0.7.2 note:
|
|
75
|
+
* I changed the wait_until function a bit so now it goes ```wait_until(condition) ``` instead of ```wait_until(action, condition)```
|
|
73
76
|
|
|
74
77
|
|
|
75
78
|
# All Functions
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
keyboard>=0.1.0
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
__lazy_modules__ = ["random", "time", "sys", "keyboard"]
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from random import randint
|
|
5
|
-
from time import sleep
|
|
6
|
-
|
|
7
|
-
from keyboard import is_pressed
|
|
8
|
-
|
|
9
|
-
_scratch_data = {"answer": ""}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def say(text):
|
|
13
|
-
"""This function says text. etc. say("hello")"""
|
|
14
|
-
print(text)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def say_for_seconds(texty, secs):
|
|
18
|
-
"""This function is basically saying text then waiting. etc. say_for_seconds("hello", 2)"""
|
|
19
|
-
print(texty)
|
|
20
|
-
sleep(secs)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def ask(question):
|
|
24
|
-
"""This one is like scratch's ask then wait function"""
|
|
25
|
-
_scratch_data["answer"] = input(question)
|
|
26
|
-
return _scratch_data["answer"]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def answer():
|
|
30
|
-
return _scratch_data["answer"]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def wait(seconds):
|
|
34
|
-
"""This function waits. etc. wait(1)"""
|
|
35
|
-
sleep(seconds)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def pick_random_number_from(a, b):
|
|
39
|
-
return randint(a, b)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def stop_all():
|
|
43
|
-
sys.exit(0)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def add_to_list(listname, item):
|
|
47
|
-
listname.append(item)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def insert_in_list(listname, index, item):
|
|
51
|
-
listname.insert(index, item)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def delete_from_list(listname, index):
|
|
55
|
-
listname.pop(index)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def delete_all_from_list(listname):
|
|
59
|
-
listname.clear()
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def replace_in_list(listname, index, item):
|
|
63
|
-
listname[index] = item
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def wait_until(varibab, condit):
|
|
67
|
-
while varibab != condit:
|
|
68
|
-
sleep(1)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def repeat(action, timy):
|
|
72
|
-
for _ in range(timy):
|
|
73
|
-
action()
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def forever(actiono):
|
|
77
|
-
while True:
|
|
78
|
-
actiono()
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def repeat_until(actionon, condition):
|
|
82
|
-
"""This one repeats until condition becomes true"""
|
|
83
|
-
while True:
|
|
84
|
-
actionon()
|
|
85
|
-
if condition():
|
|
86
|
-
break
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def when_key_pressed(key):
|
|
90
|
-
"""This function checks when key is pressed"""
|
|
91
|
-
if is_pressed(key):
|
|
92
|
-
while is_pressed(key):
|
|
93
|
-
sleep(0.1)
|
|
94
|
-
return True
|
|
95
|
-
return False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scratch_syntax-0.7.0 → scratch_syntax-0.7.2}/src/scratch_syntax.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|