Posts

Showing posts from 2024

Python tkinter trick

This trick allows you to link a label's text directly to a variable, so the label updates automatically whenever the variable changes. Example: Dynamic Label with StringVar import tkinter as tk # Create the main window root = tk.Tk() root.title("Dynamic Label with StringVar") # Create a StringVar to hold the label's text dynamic_text = tk.StringVar() dynamic_text.set("Hello, Tkinter!") # Create a label that uses StringVar label = tk.Label(root, textvariable=dynamic_text, font=("Arial", 16)) label.pack(pady=20) # Function to update the label's text def update_text(): current_text = dynamic_text.get() dynamic_text.set(f"{current_text} 🎉") # Create a button to trigger the text update button = tk.Button(root, text="Update Text", command=update_text) button.pack(pady=10) # Run the application root.mainloop()

Daily quiz#1

Loading…

Python tabs using tkinter

Python TTK Tabs Tutorial In this tutorial, we’ll learn how to create tabs in Python using the ttk.Notebook widget from the tkinter library. Tabs are a great way to organize content in your GUI applications. Code Example # Import tkinter and ttk import tkinter as tk from tkinter import ttk # Create the main window root = tk.Tk() root.title("Bonedev Python TTK Tabs Example") # Create a Notebook widget (Tab container) notebook = ttk.Notebook(root) # Create two frames that will hold content for each tab frame1 = ttk.Frame(notebook) frame2 = ttk.Frame(notebook) # Add frames as tabs to the notebook notebook.add(frame1, text="Tab 1") notebook.add(frame2, text="Tab 2") # Add content to Tab 1 label1 = ttk.Label(frame1, text="This is the content of Tab 1.") label1.pack(padx=20, pady=20) # Add content to Tab 2 label2 = ttk.Label(frame2, text="This is the content of Tab 2.") label2.pack(padx=20, pady=20) # Pack the...

share tutorials

Image
    Your Own Post post your own tutorial(small) click  here  to post your own tutorial in subject type your small tutorial title and in body type your content or example code  or click on + button in top right a mail window open

FUNCTIONS IN PYTHON

 Functions in python Functions are used for call something while coding  like your own code line follow Python def text (text): print (text) text( "sample" ) Light/Dark M Copy

Conditions in js(JAVASCRIPT)

  Conditions in js conditions are if then else else if  like a copy of events TO DO THIS:- JavaScript let variable = 2 // The real if sample if ( variable + 2 = 5 ) { console.log ( "false" ) } else { console.log ( "true" ) } Light/Dark M Copy

CREATING TABLES IN HTML

 -:HOW TO CREATE TABLES IN HTML     :- how to create tables in html to create follow me. TYPE:-      HTML Table Example <table> <tr> <th> Column #1 </th> <th> Column #2 </th> </tr> <tr> <td> Row #1 </td> <td> Row #2 </td> </tr> <!-- YOU CAN ADD MANY COLUMNS AND ROWS YOU LIKE --> </table> Light/Dark Mode Copy result= Collumn#1 collumn#2 row#1 row#2

JOKE#2

A JOKE How to make YouTube in html.  Simple  Type  <iframe src=" https://www.youtube.com " />

Tip idea

Blog post request Loading…

A TIP#3

Image
Using Figure and Figcaption in HTML Below is an example of how to use the <figure> and <figcaption> elements to properly structure images and their captions: This is the caption for the image. Using these elements enhances accessibility and provides better context for your images! the code HTML Figure Example <figure> <img src = "example.jpg" alt = "Description of the image" width = 400 /> <figcaption> This is the caption for the image. </figcaption> </figure> Light/D Copy

A tip2

Image
Ti p :   U s e   t h e    <hr>   T a g  f o r   H o r i z  o n t a l  R u l e s  The <hr> tag creates a horizontal line that can be used to separate content sections visually. It’s great for indicating a thematic break in your content. Example: < h2 > Section 1 </ h2 > < p > This is some content for section 1. </ p > < hr > < h2 > Section 2 </ h2 > < p > This is some content for section 2. </ p >

Update variable in js

Image
      -:TO UPDATE A VARAIBLE IN JS:-             Let var = 0                             var = var + 1 //Write how much you want to update

A tip for html

Image
   A   t i p   f o r   H T M L                                                                                                                                            Why you use script src and link stylesheets                             But you can directly add it by  <script>                               and css by  <style> 😅😅            

A joke

                                A JOKE                    Why developers prefer dark mode                                beacuse light attract bugs 🐛