#๐ Gui
50 messages ยท Page 1 of 1 (latest)
@idle bronze
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
I think pygame is probably the best for this as its built to make games and it considered easy for beginners
tkinter would 100% be the simplest for a rock paper scissors game
You can't upload files here. You'll have to use this paste link
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Before handling the GUI, the first thing I would do is split your game logic into more specific functions. GUI is ultimately a window that will call functions for you at specific times
I think he want to make it more graphical tho
he said gui
for example, write a function that takes in two options of rock/paper/scissors and returns the winner
yes, tkinter is a GUI
GUI just means a visual window instead of terminal
Yes. Your functions are quite large and multi-purpose
I'm saying to split it into more specific functions
tkinter is definitely the simplest and more user friendly
but I'm saying that all GUI does is display already written code, and if your code is not written in a specific way, the GUI won't be able to understand it
Instead of using input(), you would use buttons
instead of print(), you would use labels
you need functions that can accept this data and return results so you can properly display them in the gui
you have to write them yourself
.rp tkinter
Here are the top 5 results:
There's a good intro to tkinter here
tkinter is builtin in python
so you don't have to download anything
it's a library
which is builtin
like math or time
it doesn't matter what editor you use, tkinter is part of python
module is a fancy name for a python file that you import
library is a collection of modules
framework is usually a more established way of interacting with another existing feature, like a framework for writing code that interacts with web
yes, that's all it is
when you import random, you're importing a python file named random.py
!e
import random
print(random)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
<module 'random' from '/lang/python/default/lib/python3.12/random.py'>
yes, you can have your own my_module.py and import things from there
yes withut the . py
import bip
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.