Background in python
I am trying to add a background image in python but I cannot figure out how to do so, I am using python 3.0. I am new to programming :)
I have put together driver code for a pygame application from stuff I found on the internet here: https://repl.it/@mwilki7/python-game
[line 31] BackGround = Background('your_background_image_here.png', [0,0])
with whatever name your background image is.
You might need to resize the window:
[line 12] size = (700, 500)
so that your background image fits inside
@mwilki7 Thanks a lot! But just a quick question, where should I type my code?
I have coded my whole program using functions so I only have to call for main() in order for the program to run.
Here's my program:
@AhmadAyyeh Okay, so it looks like both of your programs runs on the terminal (meaning that you
input from the terminal), and there really isn't any way to stick an image onto the terminal. All it can do is display characters.
But in your first program, it looks like you're trying to make a GUI using tkinter, which is what you should do if you really wanted to show that image.
How you would go about making a GUI in tkinter is by using textboxes instead of
inputs and using a button to submit, and maybe lists or comboboxes if you want to make it look better.
If you decide that it is worth learning tkinter for the sake of the image, here's an answer that will help
Thanks alot for your help, I kind of understood how to work with tkinter but I have another problem, whenever I run the program, for some reason it keeps showing soundex_code as p160 and cannot figure out how to fix it....
can you please help me figure it out? here's my code with tkinter:
and here's my original code:
(by the way, for some reason when I run the code on repl and press on get data it does not always output data (probably connection issues) but when I run it on IDLE on my desktop it works)