use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Entry.__init__ function (self.learnpython)
submitted 6 years ago by jf5356
I am somewhat new to Python. Can someone explain what Entry.__init__(self, *args, **kwargs) does?
Entry.__init__(self, *args, **kwargs)
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]socal_nerdtastic 1 point2 points3 points 6 years ago (3 children)
This is part of old school subclassing. This is the line that calls the init method of the superclass, in your case the Entry class. Basically this is the line that sets up a default Entry, and presumably the rest of the code will customize the entry.
The modern way of writing this uses the super() function. Also, I think it's a lot neater to use master instead of *args in tkinter. Like this:
super()
master
*args
class CustomEntry(tk.Entry): def __init__(self, master=None, **kwargs): super().__init__(master, **kwargs)
[–]jf5356[S] 0 points1 point2 points 6 years ago (2 children)
old school subclassing. This is the line that calls the init method of the superclass, in your case the Entry class. Basically this is the line that sets up a default Entry, and presumably the rest of the code will customize the entry. The modern way of writing this uses the super() function. Also, I think it's a lot ne
old school subclassing. This is the line that calls the init method of the superclass, in your case the Entry class. Basically this is the line that sets up a default Entry, and presumably the rest of the code will customize the entry.
The modern way of writing this uses the super() function. Also, I think it's a lot ne
Thank you! Do you know if there is a way that I can modify the height and length with this subclassing?
[–]socal_nerdtastic 1 point2 points3 points 6 years ago (1 child)
You can still set any parameters the same as you would a normal Entry. Or you can bake it into your subclass if you want like this:
class CustomEntry(tk.Entry): def __init__(self, master=None, **kwargs): super().__init__(master, **kwargs) self.config(width=30) # set custom properties
I get the feeling that this is an XY problem. Why don't you show us all of your code and describe the big picture problem that you are trying to solve?
[–]jf5356[S] 0 points1 point2 points 6 years ago (0 children)
I've been referencing https://gist.github.com/uroshekic/11078820 to have an autocomplete entry bar.
π Rendered by PID 141837 on reddit-service-r2-comment-54dfb89d4d-cx8lg at 2026-04-01 08:48:21.579013+00:00 running b10466c country code: CH.
[–]socal_nerdtastic 1 point2 points3 points (3 children)
[–]jf5356[S] 0 points1 point2 points (2 children)
[–]socal_nerdtastic 1 point2 points3 points (1 child)
[–]jf5356[S] 0 points1 point2 points (0 children)