[Tutor] Looking for some direction

DL Neil PyTutor at danceswithmice.info
Sat May 11 18:12:28 EDT 2019


Cranky,

It is a little difficult to answer your question.

First impression is that your experience gives you good ideas of how to 
solve the problem. Some of them may not suit the Python environment as 
well as (say) that of PHP/MSFT. So, a learning opportunity there too.

Second impression is that there are a lot of moving parts. How many of 
them do you know well, and how many are learning-targets? Trying to 
tackle 'too much' that is 'new' may result in heavy frustration. (no 
mention of skill-levels, so 'just sayin')

The web-ref is not a book, but a *simple* article. It will serve, as 
long as you stick within the narrow scope of that article. The instant 
you deviate or customise, you're 'on your own'. For this reason, my 
recommendation is always a (proper/full) book*, if at all possible. You 
speak of MVC, so one (of many) Python web framework is Mig Grinberg's 
"Flask". Apart from his own, there are several other books which cover 
this subject. Following such a text will enable you to start-out on 'toy 
examples' and then gather expertise. Likely, you will re-shape this 
project whilst learning.

* I used the term "book" but the last person to whom I recommended such 
couldn't afford the cost, and these days there are many excellent 
on-line and equally structured alternatives, eg Python courses on 
Coursera.org and edX.org (both 'freemium' offerings) - IIRC(?) Flask is 
available on Lynda (LinkedIN).


That said, let's try responding to each of your points:-


On 12/05/19 6:59 AM, Cranky Frankie wrote:
> I'm a long time IT professional trying to teach myself object-oriented
> programming. As such I want to build a traditional PC app using MVC (Model
> - View - Controller) architecture. Just want to make sure I'm heading about
> this in the best way so I'm looking for some direction.
> 
> For the Model or persistence layer I want to use SQLite. For the View or
> GUI I want to use wxPython. For the Controller I want to of course use
> Python. I'm also planning on using Git for source control.
> 
> 1) For the IDE I'm most comfortable with Netbeans/Java, but I'm forcing
> myself to try and get comfortable with PyCharm. Is it worth sticking it out
> with PyCharm, or should I go with the Python module in Netbeans? Or is
> there another IDE I should look at?

To my observation an IDE is less important in Python (than for highly 
structured, strongly typed, compiled, ... languages). My advice is, once 
you've chosen and found that it works, do NOT switch editor/IDE in 
anything less than one year. Under the 80-20 'rule', we use a basic few 
editing 'features' to do most of our work. Thus, it stands to reason 
that it will take periods of 'real time' before you decide 'there must 
be an easier way' to achieve some functionality and go looking in the 
editor's menus/help/etc to see if/what it might be! The other aspect is 
that 'religious wars' are fought over "which is the best editor/IDE" 
style questions. If you believe 'everyone' you'll 'jump' so often that 
you'll never figure-out 'which'. So, given that PyCharm is 
purpose-built, has a good reputation, and you have already used it: "if 
it ain't broke, why fix it"? (NB I don't use it, but have in the past)


> 2) For wxPython I'm finding a lot of the documentation is outdated. Is this
> book any good:
> 
> http://www.blog.pythonlibrary.org/2019/05/08/creating-gui-applications-with-wxpython-now-available/
> 
> Or is there a better book/course/website I should be working with? Or is
> there a better grahpics framework at this point for a traditional desktop
> app?

- attempted to tackle in 'strategy' comments, above


> 3) For the O-O part, I'm comfortable with Inheritance and Composition. Do I
> need to worry about any of the more advanced design patterns? This app will
> be for vehicle ownership - tracking maintenance, etc. Nothing fancy.

At risk of creating a dichotomy, whilst there are books which attempt to 
'translate' the original gang-of-four patterns (and more) into 'Python', 
none has really impressed. "Pythonista" talk of "pythonic" solutions. 
Personal observations when learning Python (as if I'm not still...) 
included the need to desist from trying to solve a problem in 
xyz-other-language and 'translate' that to Python, but to learn how 
Python's construction enables its own solution-approach - sometimes 
quite distinctive. My favorite simple example of this is that many other 
languages offer do/for-loops. However Python's construct should be 
called for-each because it does not manage an index, eg loop-around 
doing something with array[index]; but instead/additionally "iterates" 
over a "collection", eg for item in list: ... Which also disposes of the 
need to learn the GoF iterator pattern as a "pattern" - but does not 
excuse you from understanding the "idiom". Once again, such are best 
(IMHO) learned from the cohesive and comprehensive coverage of a decent 
Python book*, cf numerous and unrelated web/blog/etc entries.


> 4) I plan to write my Use Case in Libre Office Write. For the UML diagrams,
> is there a simple app to handle that? I don't need it to generate code but
> I'd like to have a nice class diagram if possible.

There are many UML tools. Most operating at an higher level and 
understanding the abstraction/components, thus better than using 
LibreOffice tools to 'roll your own' as 'pretty pictures' (without the 
tool understanding their meaning)!


> 5) I'm really having trouble envisioning the GUI screens. How does one get
> a handle on that? Just draw the screens on paper, or what?

Yes! Paper, whiteboard, chalkboard, glass, ... It is a very iterative 
process, even after?especially after delivering the first MVP!


> Any ideas very much appreciated.

The MVP system design/project management ideas of iterative development 
repeats the theme of progressive-learning outlined earlier. Great things 
start from small-beginnings. Don't "bite off more than you can chew". 
Keep things manageable, reign-in your expectations, and thus help 
yourself to maintain your enthusiasm over the life of the project...

All the best,
-- 
Regards =dn


More information about the Tutor mailing list