Automatically support new changes with Python
I was working on a program,that I need to support new additions. Hmmm. Let me give you some background on the program.
It is an educational software program that has quizzes for the user to take, just t开发者_StackOverflow社区o gain odd knowledge. Now, It currently supports 6 subjects, all organized with directores on the HDD ( i.e. the Science directory is called science. ) and the way you launch the subject to see what quizzes you have to take is by pushing a button on the home screen.
This sort of thing prevents easy subject additions. I want to be able to add a subject later on without having to recode the home screen and re organize all the buttons. I would use a Listbox and os.listdir(...), but I was kind of wanting something prettier than a Listbox. I am using Tkinter on Windows. The Python version I am using is 2.6
Is there a "fancy" listbox sort of thing that can be styled to work with the background?
You can add buttons dynamically just fine, nothing is forcing you into the listbox. That said, I don't know why you care so much about "prettiness" since you're using Tkinter, which is very ugly by default.
精彩评论