Coding_tuts

Coding_tuts

Programming tutorials


Python Write in file and read from file

6 Apr 2023 1 minute read 0 comments SlashReal

file open("yourfilename.txt", "a") file.write(  str(your_variable)) file.close() file = open("youfilename.txt", "r") print(file.read())

Python count seconds

5 Apr 2023 1 minute read 0 comments SlashReal

import time counter = 0 while 0 < 1:     seconds = time.time()     local_time = time.ctime(seconds)     counter = counter +1     print('Seconds: ' , counter)     time.sleep(1)

Python show messagebox

4 Apr 2023 1 minute read 0 comments SlashReal

from tkinter.messagebox import showinfo  message = 'my message' showinfo(                title='my title'                 message = message               )

Change Label text Python

24 Mar 2023 1 minute read 0 comments SlashReal

label = ttk.Label(root, text='My Label') label.pack(ipadx=10, ipady=15) label.config(text='text changed')

How to make a button with Python

22 Mar 2023 1 minute read 0 comments SlashReal

#If you have read the simple GUI tutorial def mybutton_Clicked():        print('Button Clicked myButton = ttk.Button(root, text='My Button', command= myButton_Clicked) myButton.pack(ipadx=10, ipady=30, expand=True)

How to make a simple GUI with Python

22 Mar 2023 1 minute read 0 comments SlashReal

import tkinter as tk from tkinter import ttk root = tk.Tk() root.geometry('300x200') root.title('My GUI') root.mainloop()

Chō - Han

21 Mar 2023 1 minute read 0 comments SlashReal

Chō - Han  import random  ranum = int(random.uniform(1, 6)) ranum2 = int(random.uniform(1, 6)) erg = ranum + ranum2 rest = erg % 2 if rest == 1:     print('Han') else:       print('Chō')   Thats a japanese gambling game.