Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. menator01

    Python Pygame pong - part 2 (The paddle)

    In part 2 we will: create the paddle class create allsprites group create the paddle movement import pygame # Create empty list and sprite group players = [] allsprites = pygame.sprite.Group() class Player(pygame.sprite.Sprite): ''' Player class will define our player and player...
  2. menator01

    Python Simple Tkinter Calculator Part 1 - Tkinter Window

    In this tutorial we will get our tkinter window running and define our 2 classes import tkinter as tk from decimal import Decimal class Window: def __init__(self, parent): self.parent = parent ''' We will be using the grid manager ''' parent.columnconfigure(0...
  3. menator01

    Python Introduction to a Simple Tkinter Calculator

    Tkinter Calculator In this tutorial we will build a simple calculator using tkinter and python. Modules needed tkinter tkinter is installed by default with python if it does not come with your version of python, it can be installed by Ubuntu - sudo apt install python3-tk MacOS - brew install...
  4. menator01

    Python Simple Tkinter Calculator - Full Code

    Here is the full working code # Do the imports import tkinter as tk from decimal import Decimal class Window: def __init__(self, parent): self.parent = parent ''' We will be using the grid manager ''' parent.columnconfigure(0, weight=1) parent.rowconfigure(0...
  5. menator01

    Python Random background color with tkinter

    A tutorial on generating a random background color in tkinter ''' First we import the needed modules for our script ''' import tkinter as tk from random import choices ''' Initiate tkinter and start its mainloop ''' root = tk.Tk() ''' It's usually best not to give a fixed but, for this...
  6. menator01

    Python Tkinter taskbar image from the web

    How to use a image from the web for tkinters taskbar icon # Do the imports import tkinter as tk from urllib.request import urlopen # Initiate the root window root = tk.Tk() # get the image from an url img_url = urlopen('https://my-python.org/images/png/ratt.png') # Read the data from the...
  7. menator01

    Python Example of tkinter using pillow to get and display images from web

    Displaying three images from the web using pillow and tkinter # Do the imports import tkinter as tk from PIL import Image, ImageTk from urllib.request import urlopen import io # Iniate the root window root = tk.Tk() # Empty list to keep a reference to the images images = [] # Setup a list...
  8. menator01

    Python tkinter working with toplevel window

    Example of tkinter's toplevel window using the mvc (Model, View, Controller) approach # Do the imports import tkinter as tk class TopWindow: ''' Class for a Toplevel window ''' def __init__(self): ''' Initiate the window ''' self.window = tk.Toplevel(None)...
  9. menator01

    Python Tkinter listbox with scrollbar

    A Basic listbox with scrollbar # Do the imports import tkinter as tk from tkinter import font # Create the window root = tk.Tk() root.title('Tkinter listbox and scrollbar') root.minsize(400,400) # get available fonts fonts = font.families() # Create tkinter listbox widget listbox =...
  10. menator01

    Python tkinter ttk treeview example

    Basic example of tkinter ttk treeview with alternating row colors and styles text # Do the imports import tkinter as tk from tkinter import ttk, font # Initiate the root window root = tk.Tk() # Setting min size root.minsize(400,300) # Get some data for inserting fonts = list(font.families())...
  11. menator01

    Python Pygame pong - part 1 (Getting pygame window up and running)

    In this tutorial we will build a simple pong game with python and pygame. The final result should be simular to the below image Pygame can be installed using pip install pygame or python3 -m pip install pygame Create a python file called pong.py in the text editor of choice. I prefer vscode...
  12. menator01

    CSS Grid Issues I Need Help With

    This part is fine .grid-container > div { background-color: rgba(255, 255, 255, 0.8); text-align: left; padding-left: 9px; padding-top: 1px; font-size: 11px; } Just the code blocks below it had effect. starting with the .name class I tried changing background color and font size and...
  13. menator01

    CSS Grid Issues I Need Help With

    This part here is what is preventing the name text from centering. .grid-container > div { background-color: rgba(255, 255, 255, 0.8); text-align: left; padding-left: 9px; padding-top: 1px; font-size: 11px; } From my testing everything below this block is irrelevant and does not...
  14. menator01

    Pillow

    Module for working with images in python
  15. menator01

    GUI sub forum

    I think it would be great.
  16. menator01

    GUI sub forum

    A general section for gui help. I'm only familiar with python guis. Mainly tkinter and pyqt. I've been exploring the forum site a little and noticed there was not one and thought that I might request one. I don't know if there are many if any questions regarding guis. Thanks.
  17. menator01

    Tkinter rock paper scissors

    Here is a practice project I did a few years ago. Tkinter Rock Paper scissors. #! /usr/bin/env python3 # Do the imports import os import tkinter as tk from tkinter import messagebox from functools import partial import random as rnd # Used to close the register window without causing an...
  18. menator01

    GUI sub forum

    Not sure where to post request and do not really know if there are many if any request for a GUI section in the forum. So anyhow I would like to add a request for a GUI section. I am only familiar with python guis but, am sure that some of the other scripting languages have it as well. Thanks.
  19. menator01

    PyQt

    PyQt documentation
  20. menator01

    wxPython

    Learn wxPython
Back
Top Bottom