-
-
Notifications
You must be signed in to change notification settings - Fork 2
Usage
To install the Python Logo Widgets, you can use an executable package (Windows), install from the Python Package Index, import the widgets into your project, or hard code the widgets into your project.
- To run the executable package, download the latest
.zip
file from GitHub Releases page. - Extract the
.zip
file using a program like 7-Zip. - (Optional) Move the files to
C:\Program Files
and create a shortcut. - Double click on
main.exe
. - Enjoy the program!
-
Download and install Python.
-
Open a terminal and run the command:
pip install running-calculator
. -
Open your code file, and navigate to the top of your code.
-
Add the respective
import
statement:-
Python Logo:
from python-logo-widgets.logo import *
-
Python Powered Length:
from python-logo-widgets.length import *
-
Python Powered Width:
from python-logo-widgets.width import *
-
Python Logo:
-
Call each of the respective widgets:
-
Python Logo:
logo_widget()
-
Python Powered Length:
length_widget()
-
Python Powered Width:
width_widget()
-
Python Logo:
-
Save and run the file (
F5
).
- Copy the
logo.py
,length.py
,width.py
files, andimgs
folder to your project. - Import each of the widgets (and
Tkinter
) into your project:
# Import Statements
from tkinter import *
from logo import *
from length import *
from width import *
-
Call each of the respective widgets:
-
Python Logo:
logo_widget()
-
Python Powered Length:
length_widget()
-
Python Powered Width:
width_widget()
-
Python Logo:
-
Save and run the file (
F5
).
-
Create a
imgs
folder in the root directory of your program. -
Copy the respective image from the Python Logo Widgets
imgs
folder to your program'simgs
folder. -
Open the your code file, and navigate to the top of the code.
-
Add the respective
import
statement:-
Python Logo:
from logo import *
-
Python Powered Length:
from length import *
-
Python Powered Width:
from width import *
-
Python Logo:
-
Copy the respective function to the top of your code file, making it available everywhere else:
- Python Logo:
def logo_widget(): # Window Statements window = Tk() window.title("Python Logo Widget") # Edit title as needed # Image Statements img = PhotoImage(file = "imgs/logo.gif") # Edit image as needed label = Label(window, image = img, bg = "black") # Edit border as needed # Pack Statements label.pack(side = BOTTOM) # Edit pack as needed # Sustain Window window.mainloop()
- Python Powered Length:
def length_widget(): # Window Statements window = Tk() window.title("Python Powered Widget") # Edit title as needed # Image Statements img = PhotoImage(file = "imgs/length.gif") # Edit image as needed label = Label(window, image = img, bg = "black") # Edit border as needed # Pack Statements label.pack(side = BOTTOM) # Edit pack as needed # Sustain Window window.mainloop()
- Python Powered Width:
def width_widget(): # Window Statements window = Tk() window.title("Python Powered Widget") # Edit title as needed # Image Statements img = PhotoImage(file = "imgs/width.gif") # Edit image as needed label = Label(window, image = img, bg = "black") # Edit border as needed # Pack Statements label.pack(side = BOTTOM) # Edit pack as needed # Sustain Window window.mainloop()
-
Edit the
label.pack()
statement to pack it either at theTOP
,BOTTOM
,LEFT
orRIGHT
of your program window. -
Call each of the respective widgets:
-
Python Logo:
logo_widget()
-
Python Powered Length:
length_widget()
-
Python Powered Width:
width_widget()
-
Python Logo:
-
Save and run the file (
F5
).
Want to make a change? Open an issue!
Want a basic overview? Read the README
.
Want to download the project? Head to the Releases page.
Want to start contributing? Open an Issue or a Pull Request.