Metadata-Version: 2.4
Name: jx_gui
Version: 1.0.0
Summary: Turn simple print() and input() programs into a GUI window with one line of code.
Author-email: "Mr. Inosuke" <inosukehasibira149@gmail.com>
License-Expression: MIT
Keywords: gui,beginner,tkinter,print,input,education
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Education
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Education
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# jx_gui

Turn a simple `print()` / `input()` program into a GUI window with one line.
Made for beginners who only know `print`, `input` and `if / else`.

## Install

```
pip install jx_gui
```

On Linux you may also need tkinter: `sudo apt install python3-tk`

## Use

Put your normal code inside a function, then pass that function to `win` (Windows) or `lix` (Linux):

```python
import jx_gui

def code():
    num_1 = int(input("Number 1 : "))
    num_2 = int(input("Number 2 : "))
    op = input("Operator (+ - * /) : ")

    if op == "+":
        print("Result :", num_1 + num_2)
    elif op == "-":
        print("Result :", num_1 - num_2)
    elif op == "*":
        print("Result :", num_1 * num_2)
    elif op == "/":
        if num_2 == 0:
            print("Cannot divide by 0")
        else:
            print("Result :", num_1 / num_2)
    else:
        print("Wrong operator")

jx_gui.win(code)     # Windows
# jx_gui.lix(code)   # Linux
```

Write `jx_gui.win(code)`, not `jx_gui.win(code())`.

## How it behaves

- `print()` shows the text in the window.
- `input("text")` shows the text above an input box. Press **Ok** (or Enter) to continue.
- Any `print()` or `input()` that is inside an `if / elif / else` appears as a popup with an **Ok** button.
- If your code crashes, the error is shown in the window and in a popup.

## License

MIT
