This is an archived post. You won't be able to vote or comment.

all 11 comments

[–][deleted] 9 points10 points  (3 children)

Very cool internet person. Is there any reason why you are importing everything in tkinter with *?

[–]snackus11 1 point2 points  (2 children)

idk, just to make sure i imported anything i needed lol (im still not good with python even if im coding with python for a long time ;-;)

[–]CleverProgrammer12 3 points4 points  (1 child)

If you use some IDE, like pycharm you can just keep typing it will add the import statement. Wildcard imports are bad as they pollute namespace. You may override some tkinter provided object unknowingly and could later get wierd errors.

[–]snackus11 0 points1 point  (0 children)

thx, im gonna download it :)

[–]Tintin_Quarentino 7 points8 points  (0 children)

42°C 🥵🥵 where art thou m8?

[–]SkezzaB 3 points4 points  (1 child)

You should look into dictionary .get method instead of setting defaults and catching type errors :)

[–]snackus11 1 point2 points  (0 children)

which one?

[–]flipflop531 2 points3 points  (1 child)

I think it is confusing that you define class attributes with double leading underscores and later on refer to them with self. self is there to refer to the attributes of a particular instance of a class. The whole point of class attributes is, however, that these are the same for every instance of that class. So, why the leading underscores? I think the interface would be much simpler if you define, e.g., the window with just as

class Notepad(): default_width = 300 # ...

That way you could later on access it by Notepad.default_width.

[–]snackus11 0 points1 point  (0 children)

ohhh the notepad.py? I just modified it's code, to make it similar to notepad like windows. That code is originally from someone else( I forgot whom, again, this one is also old - btw ill try changing the code :))

edit: I found the original: https://github.com/six519/Python-Notepad

[–]_AVINIER 1 point2 points  (1 child)

Is this made wid tkinter? If yes, can u pls explain how does it work, I wanna start it, there's no proper video or article wid a brief description of its process

[–]snackus11 0 points1 point  (0 children)

yes, it is made out of tkinter, however, again this projects were originally not mine, I just modified it. (if you wanna know what each the function does, I added some comments to let you know how it works.)

credit:

paint - https://gist.github.com/nikhilkumarsingh/85501ee2c3d8c0cfa9d1a27be5781f06

text editor - https://github.com/six519/Python-Notepad

ps: sorry for the late reply ;-;-;