PacktPublishing / Python-GUI-Programming-with-Tkinter

Python GUI Programming with Tkinter, published by Packt
MIT License
254 stars 114 forks source link

Wrong syntax on hello world program #8

Open nirban256 opened 5 months ago

nirban256 commented 5 months ago

The given code is

"""Hello World application for Tkinter"""

from tkinter import *
from tkinter.ttk 
import *

root = Tk()

label = Label(root, text="Hello World")
label.pack()
root.mainloop()

It should be like this on the second line because otherwise it is giving me error

"""Hello World application for Tkinter"""

from tkinter import *
from tkinter.ttk import *

root = Tk()

label = Label(root, text="Hello World")
label.pack()
root.mainloop()

On the second line the import of 3rd line should be on the above line

If you can assign me the issue then I can create a pull requeest to solve the issue

Double-Guo commented 5 months ago

您好,已收到。祝好!

nirban256 commented 4 months ago

please merge the pull request @Double-Guo

LuckyIntel commented 2 months ago

Checked the code myself and yes lol it is acutally wrong. import * means import everything.But from what or where.So yes your fix is how this code actually should work.This repo is very old so no one will problaly care.

Double-Guo commented 2 months ago

您好,已收到。祝好!

nirban256 commented 2 months ago

您好,已收到。祝好!

can you please tell in english proper translation I couldn't find. Thank you.

LuckyIntel commented 2 months ago

您好,已收到。祝好!

can you please tell in english proper translation I couldn't find. Thank you.

I translated it and it says something like "message received, good luck".So it's just something like auto-reply.

nirban256 commented 2 months ago

您好,已收到。祝好!

can you please tell in english proper translation I couldn't find. Thank you.

I translated it and it says something like "message received, good luck".So it's just something like auto-reply.

ok thanks for clarifying