py2gui 0.1.0__py3-none-any.whl
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.
- py2gui/game_example.py +659 -0
- py2gui/py2gui.py +875 -0
- py2gui/test.py +110 -0
- py2gui-0.1.0.dist-info/METADATA +9 -0
- py2gui-0.1.0.dist-info/RECORD +8 -0
- py2gui-0.1.0.dist-info/WHEEL +5 -0
- py2gui-0.1.0.dist-info/licenses/LICENSE +21 -0
- py2gui-0.1.0.dist-info/top_level.txt +1 -0
py2gui/test.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
from py2gui import display, user_type_in, run, clear, copy_text, select_all, exit_gui, user_write, display_colored, display_paragraph
|
|
2
|
+
|
|
3
|
+
def main():
|
|
4
|
+
display_colored("Welcome to the Py2GUI Test Application!", fg_color="34", bold=True) # Blue bold text
|
|
5
|
+
display("Hello, world!")
|
|
6
|
+
|
|
7
|
+
name = user_type_in("Enter your name: ")
|
|
8
|
+
display(f"Hi {name}!")
|
|
9
|
+
display("This is a test.")
|
|
10
|
+
|
|
11
|
+
if user_type_in("type clear to clear ") == "clear":
|
|
12
|
+
clear()
|
|
13
|
+
else:
|
|
14
|
+
display("You didn't clear")
|
|
15
|
+
if user_type_in("type copy to copy last line ") == "copy":
|
|
16
|
+
copy_text()
|
|
17
|
+
display("Last line copied to clipboard.")
|
|
18
|
+
user_write("So btw... how are you feeling? ")
|
|
19
|
+
else:
|
|
20
|
+
display("You didn't copy")
|
|
21
|
+
display("This is some \033[1;32mgreen bold text\033[0m and this is \033[1;31mred bold text\033[0m.")
|
|
22
|
+
|
|
23
|
+
display("Select all text and copy it manually to see select_all in action.")
|
|
24
|
+
|
|
25
|
+
if user_type_in("type select_all to select all text ") == "select_all":
|
|
26
|
+
select_all()
|
|
27
|
+
display("All text selected.")
|
|
28
|
+
if user_type_in("type copy to copy all selected text ") == "copy":
|
|
29
|
+
copy_text()
|
|
30
|
+
display("All text copied to clipboard.")
|
|
31
|
+
else:
|
|
32
|
+
display("You didn't select all")
|
|
33
|
+
|
|
34
|
+
display("=== display_colored Method Demo ===")
|
|
35
|
+
display_colored("Blue text", fg_color="34")
|
|
36
|
+
display_colored("Red background", bg_color="41")
|
|
37
|
+
display_colored("Bold green", fg_color="32", bold=True)
|
|
38
|
+
display_colored("Underlined yellow", fg_color="33", underline=True)
|
|
39
|
+
display_colored("Italic cyan", fg_color="36", italic=True)
|
|
40
|
+
display_colored("Bold white on red", fg_color="37", bg_color="41", bold=True)
|
|
41
|
+
|
|
42
|
+
display("=== display_paragraph Demo ===")
|
|
43
|
+
display_paragraph("This is a paragraph that spans\\nmultiple lines.\\t\\tIt has tabs too!")
|
|
44
|
+
display_paragraph("No newline at the end of this one")
|
|
45
|
+
display("This adds a newline after the paragraph")
|
|
46
|
+
|
|
47
|
+
display("=== Font Demo ===")
|
|
48
|
+
display("Default font", parse_ansi=False)
|
|
49
|
+
display("Arial font", font_family="Arial", parse_ansi=False)
|
|
50
|
+
display("Helvetica bold", font_family="Helvetica", font_style="bold", parse_ansi=False)
|
|
51
|
+
|
|
52
|
+
display("=== ANSI Color Terminal Demo ===", parse_ansi=False)
|
|
53
|
+
display("")
|
|
54
|
+
|
|
55
|
+
# Basic colors
|
|
56
|
+
display("Basic ANSI Colors:")
|
|
57
|
+
display("\033[30mBlack\033[0m \033[31mRed\033[0m \033[32mGreen\033[0m \033[33mYellow\033[0m")
|
|
58
|
+
display("\033[34mBlue\033[0m \033[35mMagenta\033[0m \033[36mCyan\033[0m \033[37mWhite\033[0m")
|
|
59
|
+
display("")
|
|
60
|
+
|
|
61
|
+
# Bright colors
|
|
62
|
+
display("Bright Colors:")
|
|
63
|
+
display("\033[90mGray\033[0m \033[91mBright Red\033[0m \033[92mBright Green\033[0m")
|
|
64
|
+
display("\033[93mBright Yellow\033[0m \033[94mBright Blue\033[0m \033[95mBright Magenta\033[0m")
|
|
65
|
+
display("")
|
|
66
|
+
|
|
67
|
+
# Background colors
|
|
68
|
+
display("Background Colors:")
|
|
69
|
+
display("\033[40;37mBlack Background\033[0m \033[41mRed Background\033[0m")
|
|
70
|
+
display("\033[42mGreen Background\033[0m \033[43mYellow Background\033[0m")
|
|
71
|
+
display("")
|
|
72
|
+
|
|
73
|
+
# Text styles
|
|
74
|
+
display("Text Styles:")
|
|
75
|
+
display("\033[1mBold\033[0m \033[3mItalic\033[0m \033[4mUnderline\033[0m \033[9mStrikethrough\033[0m")
|
|
76
|
+
display("")
|
|
77
|
+
|
|
78
|
+
# Combined styles
|
|
79
|
+
display("Combined Styles:")
|
|
80
|
+
display("\033[1;31mBold Red Text\033[0m")
|
|
81
|
+
display("\033[1;4;32mBold Underlined Green Text\033[0m")
|
|
82
|
+
display("\033[1;33;44mBold Yellow on Blue\033[0m")
|
|
83
|
+
display("\033[1;37;41mBold White on Red\033[0m")
|
|
84
|
+
display("")
|
|
85
|
+
|
|
86
|
+
# Extended colors
|
|
87
|
+
display("Extended Colors:")
|
|
88
|
+
display("\033[38;5;9mRed (256 color)\033[0m \033[38;5;10mGreen (256 color)\033[0m")
|
|
89
|
+
display("\033[38;5;12mBlue (256 color)\033[0m")
|
|
90
|
+
display("")
|
|
91
|
+
|
|
92
|
+
# Get user input
|
|
93
|
+
display("Now let's get some input...")
|
|
94
|
+
name2 = user_type_in("What's your name? ")
|
|
95
|
+
if name2:
|
|
96
|
+
display(f"\033[1;32mHello, {name2}!\033[0m")
|
|
97
|
+
|
|
98
|
+
age = user_write("How old are you? ")
|
|
99
|
+
if age:
|
|
100
|
+
display(f"\033[1;36mYou are {age} years old.\033[0m")
|
|
101
|
+
|
|
102
|
+
display("Rerun test?")
|
|
103
|
+
if user_type_in("type yes to rerun ") == "yes":
|
|
104
|
+
main()
|
|
105
|
+
else:
|
|
106
|
+
display("Goodbye!")
|
|
107
|
+
exit_gui()
|
|
108
|
+
|
|
109
|
+
if __name__ == "__main__":
|
|
110
|
+
run(main) # GUI runs on main thread, your logic runs in worker thread
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
py2gui/game_example.py,sha256=jl_Ko5_UcYxjEpDpWrf-K8mYERgXII431xlhIaOvvrA,26666
|
|
2
|
+
py2gui/py2gui.py,sha256=wtGvNzCPccDFXI_9YpXfhuxF7NB1TcCt3Qc4naZmNAQ,38182
|
|
3
|
+
py2gui/test.py,sha256=eWdoQUIKF_VVyaw6fckkN6jZu5-D8IkcqBQzDkBlKXM,4353
|
|
4
|
+
py2gui-0.1.0.dist-info/licenses/LICENSE,sha256=9SfUknNU1t6kFscrCqKPf3vPbcxbyq-jPtX6J_mpgoo,1065
|
|
5
|
+
py2gui-0.1.0.dist-info/METADATA,sha256=egNc7muDEgGXQyyqX6K5_lOEGcyZy-NsaTWAgsJR9gw,215
|
|
6
|
+
py2gui-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
7
|
+
py2gui-0.1.0.dist-info/top_level.txt,sha256=NFgf8RRbdgAbdKXmuKobDL9dUeIc-911JuRuzzbR-7w,7
|
|
8
|
+
py2gui-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 andy64lol
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
py2gui
|