Python for Non-Programmers
pythonfornonprogrammers.com
pythonfornonprogrammers.com
> Just Python is enough. Other installation suggestions and support are available in the forum.
Speaking as someone who has taught Python to non-programmers in classroom and workshop settings, this seems like far too vague an instruction. For many novice (including the instructor!), the installation and system setup is the most frustrating and confusing part of hands-on learning. With non-programmers, you can never assume a base level of computing understanding – this includes things like not knowing how to get into the command-line, or install a text editor, or even what filenames and file extensions are (I always have students enable display of file extensions at the start; usually it's off by default for most OSes).
I would think you'd want to do this kind of thing having students use something like CoLab or PythonAnywhere. Sure, it's nice to run code from your own system, but that's not an immediate concern for most people trying to learn the basics.
Not affiliated, just a happy user.
That'd be a good feature in any IDE.
Another beginner option which is quite similar to Thonny is Mu. https://codewith.mu
Even in a CS program, its surprising how difficult it is for many students to provision the correct software.
We use Trinket.io at my Girls Who Code club (or did before Coronavirus mayhem shut it down). It has the simpler interface, but one huge flaw—the free version is some kind of weird hybrid interpreter that will attempt to run both python 2 and python 3 code (in the same program, even).
We continue to test with kids and they intuitively get it with little instructions. If you want to make the environment even simpler just add "?lite=1" to the url and it will look like this: https://answer-on-hn.amasad.repl.co/lite.png
- https://repl.it/languages/basic
- docs: https://docs.repl.it/misc/basic
I tend to use Jupyter because it's easy to sho, relatively easy to use, and I can distribute its documents. But installing it gives newcomers a lot of trouble, which is a shame.
I'll look more at repl.it! I'm not sure if/when/how I'll use it, but knowing about additional, newbie-friendly tools is crucial in my line of work, and helps me to improve my classes.
The issues has to do with the way Microsoft Store apps are sandboxed within the environment, to quote:
Because of restrictions on Microsoft Store apps, Python scripts may not have full write access to shared locations such as TEMP and the registry. Instead, it will write to a private copy. If your scripts must modify the shared locations, you will need to install the full installer.
Also, are you abandoning Mac users?
https://developer.apple.com/documentation/macos_release_note...
> Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages. If your software depends on scripting languages, it’s recommended that you bundle the runtime within the app.
Also: The Mac comes with Python 2. I'm using Python 3, and hope that everyone will indeed install it!
In my experience (this was before PythonAnywhere/Jupyter/etc and other online services were as established as they are now), I just had students download the Anaconda click-installer, which would basically ensure they'd have the expected Python version, plus a bunch of useful packages installed by default. Sure, for advanced developers who need to maintain varying setups and packages, Anaconda was sometimes problematic (at least in the past), but that's not an issue for most beginners...and it's easy to remove Anaconda at the end of the semester.
Isn't that just Windows? I don't remember Mac doing that, and certainly other Unixes wouldn't make such a brain-dead decision.
It's one of those things that seems like it would make things simpler, but actually makes it harder to understand.
https://support.apple.com/guide/mac-help/show-or-hide-filena...
(This matches my experience. Perhaps you simply forget changing this setting.)
Normally I agree with this point of view, but file extensions don't make sense for what's probably the most common use-case: people clicking on a file, and waiting for it to do something.
If they get a mail attachment that's something like `week04.xlsx`, they aren't going to be right-clicking and opening in Excel, they're just going to click twice on it. The type of file doesn't really matter to them, they just want it to open in the right program. The extension probably just serves to confuse most users.
The problem is you when you need to specify a filename and the displayed value is different that the true value, causing any number of errors, for unexplained reasons. That's the worst kind of simplification in my opinion.
Reminds me of other bad decisions from older Windows versions. Instead of a proper filesystem permissions, Explorer would tell you "Don't look in here, you could break something." I like to call it the "Band-aid over a gaping wound" model.
I think they're pretty great at it, actually. I'm fully used to them, and I like them.
The problem is you when you need to specify a filename and the displayed value is different that the true value, causing any number of errors, for unexplained reasons. That's the worst kind of simplification in my opinion.
Not a problem for the casual user, which is the majority of people using Windows.
Reminds me of other bad decisions from older Windows versions. Instead of a proper filesystem permissions, Explorer would tell you "Don't look in here, you could break something." I like to call it the "Band-aid over a gaping wound" model.
Why not? It doesn't cost Microsoft anything, and it doesn't harm anyone using Windows.
Further, there’s no point in hobbling a general purpose device anymore as those folks have moved on to tablets etc. The division between workstations and appliances is a good one imho. Mixing metaphors has a poor track record.
This week with lockdown and everything she started to study again.
I had recently "upgraded" her laptop from Windows to Debian, and installed both PyCharm and Miniconda on it.
So, this week she managed to configure PyCharm to use the Miniconda python interpreter, and I gave her a few instructions (That were actually a repetition or some I gave her a while back) on to how to run Jupyter.
Come the next day, and she calls me to ask me how to run some notebook she had in a backup. She had already copied them in a folder (A different one that the one she was using the previous day).
So I told her "Ok, so you go to the folder and run Jupyter in it".
"Dad. Run... WHERE!"
The amount of assumed knowledge we programmers have, and usually assume other people (Even non-programmers) have, is enormous.
I didn't even click in the link, but if all are all the instructions they give to install python, they are off to a not actually bad but chopped foot start.
I've been teaching non-programmers for years, and know that they need help getting it set up. I try to offer as much as possible of that kind of help in the course.
Or well, luckily someone eventually realised that that wasn't a good idea so now they just open with a big warning saying that the file in read only mode. Hopefully you also get some more intelligible warnings when it actually tries to run VB code.
I often wonder if imperative programming is actually a beginner-friendly abstraction - in particular, because of name rebinding and interior mutability. My university's CS course is highly technical, but also targeted at non-programmers (officially, the lecturers cannot expect any computing experience at all) - and it teaches Haskell, which addresses some of those concerns.
You know, a very common newbie Lisp question is "why is my list still the same after append".
I bet you no Python beginner asks why their list is different after list.append(3), having expected a new list to be returned and the original one left alone.
Imperative is intuitive; the real world is apparently imperative. Though it can be described by functions in which t is just a parameter, the way those functions play out is that the past values of t are not available.
To take a more level view, the expectations w.r.t. append could be conditioned by prior exposure to other languages. However, any exposure to computers at all reinforces the imperative view. Almost all content is manipulated destructively: documents, settings, you name it.
a = [1, 2, 3]
b = a
b.append(4)
assert a == [1,2,3]
No matter which paradigm we use, there are going to be hidden traps new programmers need to learn. I think there might be fewer roadblocks in an immutable language because you can examine each function in isolation. There's a smaller chance a beginner will screw something up on line 10 which causes a problem on line 150. More moving parts makes it easier to get stuck on a buggy program.On the other-other hand, it is a slower ramp up to doing useful things. It's much easier to read/write to files and draw graphics in an imperative language.
If the immutable language has a single equality operator which makes it impossible to tell whether or not a value has been cloned, you might be safe from this issue.
Deep vs shallow operations is an issue in both imperative and functional programming. In python, you have '==' vs 'is' for different types of equal. You have deep vs shallow copy: https://docs.python.org/3/library/copy.html
I beg to differ. The real world is declarative. But as software developers we mostly suck at creating declarative ways to express problems. The spreadsheet being the one example of an intuitive declarative UI that non-programmers grok easily.
Your average corporate VP of engineering uses a declarative interface to issues charters to his developers: "You need to hit X performance target, Y cost of goods, and Z MTBF. By Date D. Go."
Declarative is the way the world works.
Perhaps an inviting flower is declarative to a bee, or reactive chemicals are declarative to each other.
Other than that, I'm not so sure.
The industry will catch on, eventually.
Assuming that many of its audience are self-learning/non-CS-careerists, Python's popularity and adoption rate is also going to be a major draw. Learning Python as an attractive job skill is as much an incentive as the intellectual accomplishment.
Programmers tend to favor the declarative approach because it leads to simpler programs, but it's only easier to understand if you are trained in (somewhat advanced) mathematics; most people succeed in avoiding learning any mathematics.
But yes, mutability is surprising. It's something to explicitly teach.
God forbid that the functional crowd gets their way. Most people are terrible at recursive thinking. That's why those languages have such a reputation for being difficult.
The declarative languages are also a good starting point, but the most used one (SQL or spreadsheets) are somewhat orthogonal to what one tries to do with python.
You need for loops. You need if statements. You can't just hope that they will get recursion.
I'm teaching Python because... well, because I teach Python, and this is my way of helping people who want to learn.
I also believe that Python is a good first language for many people. Not everyone, but for a lot of people. It's not only relatively easy to learn, but it's practical. Many people want to learn Python because of their jobs.
I am in particular interested to see how much depth you expose the "non-programmers" to. Is it just an applied course? E.g., here is a function X that does Y. Or do you focus also on the implications in memory and, for example, Python's object model?
Good luck. We need more non-programmers to learn to code. Not for coding's sake. Most of them won't become developers. But it allows academics from all kinds of disciplines to teach their students advanced stuff. I see programming just like most students independent of the major must take Calculus 101 or Statistics 101.
BTW, I am the author of this introduction to Python (also for non-CS majors): https://github.com/webartifex/intro-to-python
I teach Python at a business school. Due to Corona, the campus was closed and I put all my lectures on YouTube: https://www.youtube.com/playlist?list=PL-2JV1G3J10lQ2xokyQow...
Subscribe to my channel https://www.youtube.com/user/webartifex if you are interested in more Python applications in the field of business administration. I am new to YouTube and will post at most 2 meaningful videos a month. No monetization, no hidden product placements.
See also this HN post from last week: https://news.ycombinator.com/item?id=22669084
I'm going through the comments now and responding...
I don't mean "someone who doesn't know how to program" vs "someone who does".
I mean the common trope of a (for example) midlevel data scientist or someone who knows how to use python and says "I'm not a programmer", yet knows more programming than most junior devs I know.
Session 1 was about basic input/printing. Session 2 was about "if" statements. Session 3 was about numbers. Session 4 will be the first of several talking about strings.
My goal is to help people learn to program if they haven't done so already, or (especially) if they have been frustrated.
7am, Pacific. My wife has shown a bit of interest but 7am is just too early in our household to get up and start leaning right away. Seems like it would be a good course though. She could still listen to the recordings, but being able to ask questions live would be more engaging.