Powered by Blogger.

The

Turtle Python Logo Program


INPUT

import turtle

l1 = [[0.0, -238.0], [92.6, -219.3], [168.3, -168.3], [219.3, -92.6], [238.0, 0.0], [219.3, 92.6], [168.3, 168.3], [92.6, 219.3], [0.0, 238.0], [-92.6, 219.3], [-168.3, 168.3], [-219.3, 92.6], [-238.0, 0.0], [-219.3, -92.6], [-168.3, -168.3], [-92.6, -219.3], [0.0, -238.0], [0.0, -256.0], [-99.6, -235.9], [-181.0, -181.0], [-235.9, -99.6], [-256.0, 0.0], [-235.9, 99.6], [-181.0, 181.0], [-99.6, 235.9], [0.0, 256.0], [99.6, 235.9], [181.0, 181.0], [235.9, 99.6], [256.0, 0.0], [235.9, -99.6], [181.0, -181.0], [99.6, -235.9], [0.0, -256.0], [0.0, -256.0], [0.0, -256.0], [0.0, -256.0], [0.0, -256.0], [0.0, -256.0]]
l2 = [[-83.1, 17.3], [-64.3, 16.4], [-13.81, 32.1], [3.2, 70.7], [-18.9, 115.4], [-70.5, 130.1], [-76.5, 129.9], [-82.7, 129.3], [-82.7, 128.7], [-82.7, 128.1], [-93.8, 128.1], [-104.9, 128.1], [-104.9, 127.5], [-104.9, -128.6], [-82.7, -126.9], [-104.9, -128.6], [-104.8, 20.4]]
l3 = [[-82.7, 110.4], [-75.9, 111.0], [-69.7, 111.2], [-34.8, 101.6], [-20.8, 73.4], [-32.0, 46.1], [-63.8, 35.8], [-72.2, 36.1], [-82.7, 37.2], [-82.7, 38.3], [-82.7, -126.9], [-82.7, 110.4]]
l4 = [[81.7, -76.9], [58.9, -114.2], [25.0, -134.9], [21.13, -125.4], [17.2, -115.9], [42.5, -101.7], [58.0, -79.0], [33.8, -13.4], [9.63, 52.2], [22.3, 52.2], [35.0, 52.2], [52.6, -1.8], [70.2, -55.8], [87.9, -1.8], [105.6, 52.2], [117.6, 52.2], [129.6, 52.2], [105.7, -12.3], [81.7, -76.9], [81.7, -76.9]]
l5 = [[220.5, 96], [168.9, 96], [117.3, 96], [90.5, 107.1], [79.3, 134], [79.3, 180.7], [79.3, 227.5], [88.3, 227.5], [97.3, 227.5], [97.3, 180.7], [97.3, 134], [103.2, 119.9], [117.3, 114], [168.9, 114], [220.5, 114], [220.5, 105], [220.5, 96]]


def drawseg(l):
    turtle.pu()
    turtle.goto(l[0][0], l[0][1])
    turtle.pd()
    for a, b in l[1:]:
        turtle.goto(a, b)


drawseg(l1)
drawseg(l2)
drawseg(l3)
drawseg(l4)
drawseg(l5)
turtle.mainloop()


OUTPUT



Share
Tweet
Pin
Share
No Comments
Python TKinter Theme Program | TKinter | WaoFamHub



INPUT

from tkinter import Tk, Label, Button, Entry, X

import tkinter
from tkinter import ttk
from tkinter import messagebox


class Root(Tk):
    def __init__(self):
        super().__init__()

        for x in [ttk.Label, ttk.Button, ttk.Entry, ttk.Checkbutton, ttk.Radiobutton]:
            x(self, text='Some ' + x.__name__).pack(fill=X)
        pb = ttk.Progressbar(self, length=100)
        pb.pack(fill=X)
        pb.step(33)

        ttk.Label(self, text='Select theme:').pack(pady=[50, 10])

        self.style = ttk.Style()
        self.combo = ttk.Combobox(self, values=self.style.theme_names())
        self.combo.pack(pady=[0, 10])
        button = ttk.Button(self, text='Apply')
        button['command'] = self.change_theme
        button.pack(pady=10)

    def change_theme(self):
        content = self.combo.get()
        try:
            self.style.theme_use(content)
        except:
            print("Failed to set theme " + content)


root = Root()
root.mainloop()

OUTPUT



Share
Tweet
Pin
Share
No Comments
Python TKinter Text Editor Program



INPUT

from tkinter import *
from tkinter.filedialog import *
from tkinter.messagebox import *
from tkinter.font import Font
from tkinter.scrolledtext import *
import file_menu
import edit_menu
import format_menu
import help_menu

root = Tk()

root.title("Text Editor-Untiltled")
root.geometry("300x250+300+300")
root.minsize(width=400, height=400)

text = ScrolledText(root, state='normal', height=400, width=400, wrap='word', pady=2, padx=3, undo=True)
text.pack(fill=Y, expand=1)
text.focus_set()

menubar = Menu(root)

file_menu.main(root, text, menubar)
edit_menu.main(root, text, menubar)
format_menu.main(root, text, menubar)
help_menu.main(root, text, menubar)
root.mainloop()

OUTPUT




Share
Tweet
Pin
Share
No Comments
Python Simple Calculator Program With TKinter Calculator




INPUT

from tkinter import Tk, Label, Button, Entry


class Root(Tk):
    def __init__(self):
        super().__init__()
        self.title_label = Label(self, text="A Simple Calculator :)")
        self.title_label.pack()
        self.entry = Entry(self)
        self.entry.pack()
        self.entry.insert(0, "1+2")
        self.label = Label(self, text="")
        self.label.pack()
        self.button = Button(self, text="Compute", command=self.onclick)
        self.button.pack()

    def onclick(self):
        self.label.configure(text=str(eval(self.entry.get())))


root = Root()
root.mainloop()

OUTPUT



Share
Tweet
Pin
Share
No Comments
Older Posts

About me

Labels

  • C Programming
  • Java Programming
  • Python Programming
  • Software Engineering

recent posts

Sponsor

Facebook

Blog Archive

  • ▼  2020 (39)
    • ▼  April (11)
      • Software Engineering - Agile Model | VCMIT
      • Software Engineering - Incremental Model | VCMIT
      • Software Engineering - Spiral Model | VCMIT
      • Software Engineering - RAD (Rapid Application Deve...
      • Software Engineering - Waterfall Model | VCMIT
      • Software Requirements In Software Engineering | VCMIT
      • Why Software Engineering is Popular? | VCMIT
      • What is Software Engineering? | VCMIT
      • A Brief History Of Software | VCMIT
      • Types Of Software | VCMIT
      • What Is Software? | VCMIT
    • ►  March (28)

Popular Posts

  • Types Of Software | VCMIT
    Types Of Softwares The two main types of software are system software and application software. System software is a type of computer progra...
  • A Brief History Of Software | VCMIT
    History Of Software The Early Days of Software Computer scientist Tom Kilburn is responsible for writing the world’s very first piece of sof...
  • Software Engineering - RAD (Rapid Application Development) Model | VCMIT
    RAD (Rapid Application Development) Model RAD is a linear sequential software development process model that emphasizes a concise developmen...
  • Python Turtle Python Logo Program | Turtle | VCMIT
    Turtle Python Logo Program INPUT import turtle l1 = [[0.0, -238.0], [92.6, -219.3], [168.3, -168.3], [219.3, -92.6], [238.0, 0.0], [219.3, 9...
  • Applications Of C Programming | Audience & Prerequisites | VCMIT
    Applications of C Programming C was initially used for system development work, particularly the programs that make-up the operating system....
  • Write A Program To Implement Liang - Barsky Line Clipping Algorithm | VCMIT
    Write A Program To Implement Liang - Barsky Line Clipping Algorithm INPUT #include<stdio.h> #include<graphics.h> #include<mat...
  • Why Software Engineering is Popular? | VCMIT
    Why Software Engineering is Popular? Here are important reasons behind the popularity of software engineering: Large software – In our real...
  • What is Software Engineering? | VCMIT
    What is Software Engineering? Software engineering is defined as a process of analyzing user requirements and then designing, building, and ...
  • Software Requirements In Software Engineering | VCMIT
    Software Requirements The software requirements are description of features and functionalities of the target system. Requirements convey th...
  • Draw The Walking Man On The Screen Program In C | BGI | VCMIT
    Draw The Walking Man On The Screen Program In C INPUT #include<stdio.h> #include<graphics.h> #define ScreenWidth getmaxx() #defi...

Created with by ThemeXpose | Copy Blogger Themes