background preloader

Free

Facebook Twitter

Python GUI Programming with wxPython - video tutorials for easy, develop, graphical, aims, set, source, information, GUI, beginner_programming, fast. How to Learn wxPython. We have had a lot of questions on the newsgroup asking how to go about learning wxPython.

How to Learn wxPython

This page gives some pointers on how to do just that. Learn Python If you are new to Python, and especially if you are new to programming in general, it makes the most sense to learn Python first, without any GUI stuff. The wait can be frustrating, but it is worth it. Python is a very powerful language capable of doing many things both with and without GUIs. At a minimum, you should understand topics such as functions, modules, and classes.

Choose a good editor Features such as auto-completion, code highlighting, and an interactive window make for faster programming with less errors. See for a list of editors. Install wxPython If you don't already have wxPython installed, see the How to install wxPython page. Read the wxPython tutorials Wiki tutorials: A great place to start is the Getting Started page. External tutorial: Another great resource is the Zetcode wxPython tutorial. Read the demo files. Chapter 4: Templates. In the previous chapter, you may have noticed something peculiar in how we returned the text in our example views.

Chapter 4: Templates

Namely, the HTML was hard-coded directly in our Python code, like this: def current_datetime(request): now = datetime.datetime.now() html = "<html><body>It is now %s. </body></html>" % now return HttpResponse(html) Although this technique was convenient for the purpose of explaining how views work, it’s not a good idea to hard-code HTML directly in your views. Here’s why: Any change to the design of the page requires a change to the Python code. For these reasons, it’s much cleaner and more maintainable to separate the design of the page from the Python code itself. Template System Basics A Django template is a string of text that is intended to separate the presentation of a document from its data. Let’s start with a simple example template. This template is basic HTML with some variables and template tags thrown in. Using the Template System Creating Template Objects. Appendix F: Built-in Template Tags and Filters.

Chapter 4 lists a number of the most useful built-in template tags and filters.

Appendix F: Built-in Template Tags and Filters

However, Django ships with many more built-in tags and filters. This appendix lists the ones that were included at the time this book was written, but new tags get added fairly regularly. The best reference to all the available tags and filters is directly in your admin interface. Djangos admin interface includes a complete reference of all tags and filters available for a given site. To see it, go to your admin interface and click the Documentation link at the upper right of the page. The tags and filters sections of the built-in documentation describe all the built-in tags (in fact, the tag and filter references in this appendix come directly from those pages) as well as any custom tag libraries available. For those without an admin site available, reference for the stock tags and filters follows. Built-in Tag Reference block Defines a block that can be overridden by child templates. Cycle debug extends filter for.