GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - maelgruandWebDev/tutorialWindowPython

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
README.md
README.md
 
 
index.html
index.html
 
 

Repository files navigation

Create a window using an exernal file

File name : window.py

compile file in a venv environement :

mkdir PythonTuto
cd PythonTuto
# For linux (module venv of Python)
python3 -m venv env
# Windows
python -m venv env

#code into the env using command
# Linux
source env/bin/activate

# Window
env/Scripts/activate

Python Code example using Tkinter

#Linux and Window --> in venv
pip install tkinter
# Or
sudo apt install python3-tk

External file

window.py :
import tkinter as tk

#traditional form
root = tk.Tk()
root.geometry("500x500")
root.title("Tkinter tutorial")

root.mainloop()


# My form
def createWindow(title, size):
    window = tk.Tk()
    window.geometry(size)
    window.title(title)
    return window

In the main script :

main.py
import window as win

root = win.createWindow("A Tk window", "500x500")
root.mainloop

About

maelgruandwebdev.github.io/tutorialWindowPython/

Topics

computerpython-guidewebdev

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.