Your opinion on py4web tutorials: Command-line based or IDE-based?

407 views
Skip to first unread message

Tom Campbell

unread,
Jul 26, 2020, 12:02:44 AM7/26/20
to py4web

I am beginning the slow process of writing a set of illustrated, free py4web tutorials meant to get anyone, from experienced framework developer, to Python novice, up to speed. The plan is for recipe-style instructions so that merely by typing you'll be able to create a finished app in each lesson, and of course I'm hoping the surrounding text will also teach you what it all means.

That means excruciatingly complete instructions in the early lessons that will later serve as refreshers. For example, there will be links to "Create a view file", "Create a controller function", etc. I even purchased a Windows machine so I can do both Mac and Windows versions. (Hoping to do Linux but no promises.) I am also laboriously creating a comprehensive glossary.

I tend to think in terms of text files and directories, so I like the make-it-from scratch style used in the py4web docs:

OTOH py4web has this super handy IDE, which I imagine appeals to novices more, and I think py4web is a stunningly good framework for novices. 

So. Do I

  • Do only the command-line version, which is much easier for me to write. This means at least 2 versions, one for Windows and one for Mac, plus 1 more possible if I do one for Linux.
  • In addition, do the interactive IDE way, which also requires both Windows and Mac versions, meaning there will be at least 4 possible choices (6 if I include Linux) when you click the "Create a view file" link. This has a secret cost, which is that I'll have to update images as the IDE changes.
Ultimately, the goal is that by lesson 3 or whatever all I'll need is a place to link to when I say "Create a view file" so if you drop back into lesson 3 after a break you'll be able to see how it's done without running through lessons 1 and 2 again.

Thanks for your input! Feel free to contact me privately at tomca...@gmail.com if you wish. 

Jeff Muday

unread,
Jul 26, 2020, 2:38:03 PM7/26/20
to Tom Campbell, py4web
Thanks for asking Tom-- glad you are going to take on this project.  When web searching for Py4Web it is easy to see there are few links at all popping up.  Would be great to see some strong introductory materials and tutorials.

Here are my opinions for what they are worth -- including a question about Massimo's tools and work-flow.

1. You can skip Linux altogether if you want.  If you feel a need for an adaptation to a Linux version, I'd volunteer to port your instructions. (I tend to develop web apps on Windows and deploy on Linux).

2. Avoid an IDE for introductory steps.  Text editors are universal, a gui type editor like Atom or Sublime Text might make sense.

3. As for a portion where you might be introducing IDE development, you can't go wrong with PyCharm EDU/Community or Visual Studio Code.  A focus on free tools is important.

4. Does anyone know what Massimo uses for his programming environment?  IDE, text editors, debuggers, etc.  That might be a nice sidebar contributed by the creator!

--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/f79d49e9-4f74-4a62-a23d-bfd0fb1c56efo%40googlegroups.com.


--
Jeff Muday
IT Analyst
Wake Forest University
mudayja at wfu dot edu

Disclaimer: This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed.

Massimo DiPierro

unread,
Jul 26, 2020, 5:00:14 PM7/26/20
to Tom Campbell, py4web
About the IDE I strongly recommend Visual Studio for a number of reasons.
It works with a lot of languages and therefore I believe it to b the most popular.
It is very easy to use and has lots of plugins
It works over ssh.

One teaching to my son both Python and JS, the simplest solution was to give him an account to a remote VM and install only Visual Studio locally. Then he was able to install everything himself with apt-get using the VS terminal and use the same IDE for everything.

Many companies that moved to remote work use the same setup above because keeping files at home is often not feasible.

Massimo

tomca...@gmail.com

unread,
Jul 26, 2020, 11:09:57 PM7/26/20
to py4web
Thanks for the feedback, which came via email.

The consensus, also suggested by the good Dr. DiPierro, is to use Visual Studio Code as the IDE used in examples, which I think is an excellent idea since it's supported everywhere. I know he's an Emacs user so I was  little scared to hear from him ;)  Also Linux is optional, but a brave soul offered to port my documentation to Linux if need be. This probably won't be necessary since AFAIK the behavior of VSCode is identical in Linux, at least insofar as a tutorial would go.

Kevin Keller

unread,
Jul 26, 2020, 11:16:26 PM7/26/20
to tomca...@gmail.com, py4web
Thanks for doing this. 

I agree with VSCode for a beginners tutorial. 

I dont think there is much need for a separate Mac or Linux tutorial. 

Merely the installation of py4web and python is slightly different and how to use git. 

But I suppose you can just go ahead and use https://cmder.net/ on windows which pretty much gives you the Unix command line experience on Windows including git in the terminal .
So that way you deliver a uniform exeperiuence I suppose. 



--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.

Richard Behan-Howell

unread,
Jul 26, 2020, 11:27:28 PM7/26/20
to py4web

Tom,

As someone who has just gone through this exercise as a python novice with no web experience, I can give you some good insight. I am however an experienced developer but not in these languages. The first thing that strikes you is the sheer amount of knowledge and languages that you need to know. (HTML, CSS, JQuery(javascript), Bootstrap or Bulma, Python, and then how the whole framework actually passes stuff around, its anomalies, its gotchas…) not to even mention Git, Basic Linux, VirtualEnv, Nginx, Gunicorn… and then of course SQL.

 I have done development in a lot of languages and learned them really fast but web programming has been the hardest in terms of the volume of stuff and all the cogs that you need to know.

 The Django tutorial and format that helped me the most was the Django Girls Tutorial, https://tutorial.djangogirls.org/en/, which really helped me to get a good understanding of all the technologies and concepts.

 Just wanted to say, that coming from Django - I love web2py! and py4web! especially as I can quickly deploy it anywhere and get someone else working on it so easily. The Ticketing system, backwards compatibility, auto migrations and not relying on modules that break when they get updated are huge for me. I develop simple CRUD based applications used in manufacturing and industrial automation. So, I don’t need all the bells and whistles but want future predictability.


Anyway, here are my suggestions for a tutorial, as someone who has freshly learned these frameworks.

1.    I would get them started using something that is common to all OS’s, like the inbuilt IDE, so you don’t have to have each version and as you say update images as the IDE’s change.

2.    With the IDE, I would separate that from learning the actual code. Certainly, have a step to set it up and use the inbuilt IDE, but that should be decoupled from the exercises. With perhaps other steps to setup each type of IDE, PyCharm, VS, Notepad++ but that really isn’t the focus here.

3.    I really like Massimo’s idea of using visual studio and the inbuilt CLI

4.    I would include steps using basic git to push/pull straight off

5.    I really liked the format of the Django girl’s tutorial, and that is why I chose Django first up, (https://tutorial.djangogirls.org/en/) because they get you started on PythonAnywhere, with Git straight up and you can see a clear path to actually launching your app amongst the overwhelming amount of stuff to learn.

6.    Start with the fundamentals and get them to type in exercises to really understand: request, response, Controllers, Views and HTML basics. I struggled at first understanding these concepts, particularly with using the request... In code and understanding where they come from. I found myself learning by simply printing it to the page and then checking, so this would be good. The web2py book and py4web docs are good, however the snippets lack the larger context for absolute beginners. I often found myself reading though the book, but not getting detailed info about things. I would love to have a link on say, request, and response that took you to the definition and flow charts about how data flows, and what you can and can't get out of it. I guess this is where the glossary comes in?

7.    Even simple things like I would look at an example on other sites, but not know that the javascript needs to be in a <SCRIPT> tag.

 8.    With respect, the one thing I struggled with a bit in the PyDAL book was that there was overwhelming choice in the query format. You can do it this way, and this way and that way… (Which is great), but what I needed at the time, was just an easy to remember way of getting records using SQL terminology and explaining simply that db(<where clause>).select(<select clause>)…

 9.    I would also love to see a step by step on a best practice production workflow, i.e. develop locally, push to git test, pull to test server on PythonAnywhere, then pull to production server. (cover off on how the database should be handled with migrations etc.)

  

The takeaway, is that py4web is just one cog in a whole eco system of stuff that novices need to understand to start developing.

 

For those that are interested, what follows is my experience of NOT finding web2py, and how I got here.

 A year or so ago I needed to create a web application, but didn’t know where to start, a friend was using rails and there were many tutorials, so I started there. I was an old hat at c++ development but I found that I was too impatient to learn ruby and as soon as I wanted to do something outside of the scaffolding I didn’t have the depth of knowledge of rails and ruby to easily do what I wanted and got frustrated by the magic that I didn’t understand.

 That and I wanted to learn python, (for fintech and AI), so I searched around, maybe I didn’t see web2py or maybe it got washed out in the noise of other python frameworks “below” the popularity of Django, but I switched to Django. This went well initially but I struggled with deployment after using Cookiecutter Django and frustrating times trying to deploy to live servers when the migrations throw all sorts of errors. …

(I'm still trying to forget the number of hours I wasted on getting Django to run under Gunicorn and Nginx and the pesky migrations... ;( I ended up paying someone to deploy it into production, it was beyond me. Maybe that reflects more on me, but I'm impatient and just want to get things working.

 After about a year of not touching it, I went back to do some changes and found myself getting anxious about Django Migrations that had caused me so much grief before, especially on a live site. So, about a month ago I found web2py, and immediately took to it. Its lovely. Took me about 2 days of playing through the book and I started and almost finished two new simple applications within about a week. I was seriously impressed.

 Then I discovered py4web and thought wow this is even better because its simpler and faster. So I started porting my apps, but I had a hard time adjusting to Vue and the new concept of a single page app and struggled with a few teething issues getting basic crud working with Publisher.grid.

 So, I went back to web2py and just got it done and launched. (I am looking forward to using py4web in the future, but web2py hits the sweet spot for me now.) 

 

Regards,

Richard.

tomca...@gmail.com

unread,
Jul 29, 2020, 11:49:28 PM7/29/20
to py4web
Richard, you've pretty much suggested exactly what I plan to do. Thanks for pointing me to the Djangogirls tutorial.

Andrew Rogers

unread,
Nov 6, 2020, 1:12:54 PM11/6/20
to py4web
Just stumbled on this old post. I would like to echo Richard's comments. Seems we have similar initial knowledge and faced similar challenges. Some comments loosely related tutorials.

1. I really liked being able to install web2py on Windows from a single file and everything started up fine. For real beginners that is a gem.

2. I think some of the examples apps in web2py required some authentication. I was sad when i went to run some but couldnt because the app account i created didnt have permission. I dont think there needs to be any security on any example apps. 

3. What sold it to me once i found my way in was the ease of creating forms and ... well ... everything. Menus, grids, forms, authentication etc. I think a short video showing off (very briefly) everything it can do it helps potential 'buyers' see why they should persist. Those examples I think need to be beautiful, not just functional. I would perhaps split that into interface stuff (grid, forms, menus etc), pydal (which i really like), and then all the behind the scenes stuff. 

4. I am still not sure who the target audience is for py4web. If it is people like Richard and me, then it's kind of important to give a big picture overview. I also had no web development experience. So directing the new user to some good source that explains the big picture would help. I had to find those pieces and then try and fit them into the web2py framework myself. 

5. I had the same problem with pydal - there were multiple ways of doing things that i kept getting confused. I understand it pretty well now but it definitely took longer than it needed to. I think what was lacking were examples in the book (I am not complaining i have got excellent value for money!). It seemed like Massimo had tried to use every possible different way of doing something so that the manual touched on them all. I have found that useful recently but at the start it was a bit troublesome.

6. Short videos, in long playlists, are good. I watched most of Massimo's long videos but it was a little hard to get back to the parts i thought i needed. His approach to the videos was great. Started very very small and worked his way up. 

Thanks to everyone who is working on this!
Andrew

Tom Campbell

unread,
Nov 7, 2020, 5:03:29 PM11/7/20
to py4web
Andrew, I'm slowly putting together an approach very similar to what you've outlined. The reason it's so slow is that while writing the tutorials I'm going from first principles and carefully documenting the many wonderful, but original, features of py4web as I go. A lot of that work shows up in the glossary here: https://github.com/tomcam/py4webcasts/blob/master/docs/glossary.md. Creating short, clear, accurate entries for things like PyDAL(https://github.com/tomcam/py4webcasts/blob/master/docs/glossary.md#pydal), DAL (https://github.com/tomcam/py4webcasts/blob/master/docs/glossary.md#dal), or view (https://github.com/tomcam/py4webcasts/blob/master/docs/glossary.md#view) is taking a lot of time up front. But it will let me link back to these in future docs, making them more robust and modular. These tutorials will be the basis of videos, which will all be pretty short. Generally these tutorials/videos will be concise but will still show the development of complete apps from start to finish.

I am also taking notes for pages/videos that sell py4web. We do need a one-stop marketing shop and I am confident I'm the right person for this. Brevity is hard, though, so it'll be about a month before I have good first drafts.

AGRogers

unread,
Nov 9, 2020, 4:49:38 AM11/9/20
to Tom Campbell, py4web
Great Tom. Good to have someone like you pushing this side of things along. It makes a huge difference to people like me who need all the help they can get. The docs I have seen are looking nice and makes me feel more confident moving from web2py. I just submitted a pull request with a few trivial changes and one more substantial change. My main part of my web2py journey is drawing to a close so I expect my next project to be in py4web. I will try and contribute to the manuals as best i can. 

___________________________
www.TenOutOfTen.org



On Sun, 8 Nov 2020 at 03:03, Tom Campbell <tomca...@gmail.com> wrote:
Andrew, I'm slowly putting together an approach very similar to what you've outlined. The reason it's so slow is that while writing the tutorials I'm going from first principles and carefully documenting the many wonderful, but original, features of py4web as I go. A lot of that work shows up in the glossary here: https://github.com/tomcam/py4webcasts/blob/master/docs/glossary.md. Creating short, clear, accurate entries for things like PyDAL(https://github.com/tomcam/py4webcasts/blob/master/docs/glossary.md#pydal), DAL (https://github.com/tomcam/py4webcasts/blob/master/docs/glossary.md#dal), or view (https://github.com/tomcam/py4webcasts/blob/master/docs/glossary.md#view) is taking a lot of time up front. But it will let me link back to these in future docs, making them more robust and modular. These tutorials will be the basis of videos, which will all be pretty short. Generally these tutorials/videos will be concise but will still show the development of complete apps from start to finish.

I am also taking notes for pages/videos that sell py4web. We do need a one-stop marketing shop and I am confident I'm the right person for this. Brevity is hard, though, so it'll be about a month before I have good first drafts.

--
You received this message because you are subscribed to a topic in the Google Groups "py4web" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/py4web/gnPCfFldKwM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/e888b768-7351-414a-b1a0-121a58f06d1fo%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages