News for hackers. Stuff that matters.
Re:Python for Non-Programmers by danso on Friday April 03, 2020 @12:46PM (#22771242)
> Q. What do I need to install?

> 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.

Re:Python for Non-Programmers by qilo on Friday April 03, 2020 @01:33PM (#22771920)
Microsoft Store in Windows 10 has the Python 3.7 and 3.8 packages (prepared by PSF itself) with some limitations, which shouldn't matter for beginner users. So it's basically one click install.

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.

https://docs.python.org/3.8/using/windows.html#known-issues

Re:Python for Non-Programmers by danso on Friday April 03, 2020 @02:11PM (#22772348)
Is using the Microsoft Store the standard way for beginners to install Python? A lot of people might follow the installation instructions that show up at the top of a google search for "how to install python windows".

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.

Re:Python for Non-Programmers by xapata on Friday April 03, 2020 @02:00PM (#22772235)
python.org has shipped faulty distributions before, sadly. Best to make sure your lesson plan works on each Python version someone might use, on every OS, etc. Or just use a common configuration.

Also, are you abandoning Mac users?

Re:Python for Non-Programmers by qilo on Friday April 03, 2020 @02:18PM (#22772419)
I'm just a viewer of that course. I guess for Mac users, it's easy, cause MacOS already comes with Python (3.x?) preinstalled. The course author himself video streams from the MacOS system.
Re:Python for Non-Programmers by danso on Friday April 03, 2020 @03:20PM (#22773057)
MacOS has only had Python 2.x installed. Python and Ruby have both been deprecated in Catalina (10.15) and will not be pre-installed on MacOS in future releases:

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.

Re:Python for Non-Programmers by reuven on Saturday April 04, 2020 @04:24PM (#22781212)
I use a Mac, it's true -- but I also have plenty of people using Windows and Linux in the course. I try to help everyone to get it installed on their systems.

Also: The Mac comes with Python 2. I'm using Python 3, and hope that everyone will indeed install it!

Re:Python for Non-Programmers by ericol on Friday April 03, 2020 @02:44PM (#22772715)
I been trying to get one of my daughters to learn programming (With / through Python) for some time now. She's also willing, but life gets in the way and her dedications was sparse.

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.

Re:Python for Non-Programmers by commandlinefan on Friday April 03, 2020 @04:36PM (#22773712)
My son is taking a programming class in high school - they use repl.it for all their assignments. That makes installation a non-issue; eventually I assume they'll "graduate" to a local install, but it helps them focus on learning the language and not worrying about the environment (yet).
Re:Python for Non-Programmers by danielscrubs on Sunday April 05, 2020 @05:27AM (#22784689)
Girlfriend is learning programming/Java through a course that was suddenly made into a distance course (because of Corona). She's on the fourth week and the lessons are still 80% about the teacher trying to help students set up the online environment (https://codeanywhere.com). It seems frustrating for everyone involved.
Re:Python for Non-Programmers by reuven on Saturday April 04, 2020 @04:23PM (#22781201)
That's definitely not all I tell people to do. And I not only give people instructions, but also personal help when they have trouble installing things.

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.

Re:Python for Non-Programmers by totemandtoken on Friday April 03, 2020 @01:03PM (#22771487)
Yeah, I teach python to elementary and middle schoolers. The first lesson is getting everything installed and maybe explaining the basics of how files work on computers. PythonAnywhere is a really good idea though, I should look into that...
Re:Python for Non-Programmers by xapata on Friday April 03, 2020 @02:03PM (#22772273)
https://repl.it/ is good too.
Re:Python for Non-Programmers by Wowfunhappy on Friday April 03, 2020 @02:25PM (#22772495)
I wish there was something like repl.it but with an even more basic UI (but which still allowed saving and sharing of programs). Super-beginners don't need version control or a debugger, and I worry that extra visual noise draws away brain power when you're starting out.

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).

Re:Python for Non-Programmers by amasad on Friday April 03, 2020 @06:07PM (#22774408)
Repl.it CEO here, I'm curious which noise are you talking about? Here is how the empty python environment looks like (editor, console, and a huge green run button): https://answer-on-hn.amasad.repl.co/python.png

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

Re:Python for Non-Programmers by Wowfunhappy on Friday April 03, 2020 @06:21PM (#22774509)
Thank you! What I really want is that left sidebar gone (Files, Version Control, Packages, Debugger, Settings). Kids starting out don't need any of it.
Re:Python for Non-Programmers by amasad on Friday April 03, 2020 @07:45PM (#22775002)
Oh ok. I'll think about that. Slightly off topic but I just made a BASIC environment designed for kids learning to code. The theory is BASIC is still one of the best way languages to start with. Let me know if you try it:

- https://repl.it/languages/basic

- docs: https://docs.repl.it/misc/basic

Re:Python for Non-Programmers by reuven on Saturday April 04, 2020 @04:53PM (#22781436)
I must admit that I had heard of repl.it in the past, but never gave it a thought.

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.

Re:Python for Non-Programmers by _fullpint on Friday April 03, 2020 @02:19PM (#22772424)
Absolutely -- one of the tools I wish more classrooms used.

Even in a CS program, its surprising how difficult it is for many students to provision the correct software.

Re:Python for Non-Programmers by mixmastamyk on Friday April 03, 2020 @01:59PM (#22772228)
> (I always have students enable display of file extensions at the start; usually it's off by default for most OSes).

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.

Re:Python for Non-Programmers by kick on Friday April 03, 2020 @02:28PM (#22772535)
It's one of those things that seems like it would make things simpler, but actually makes it harder to understand.

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.

Re:Python for Non-Programmers by mixmastamyk on Friday April 03, 2020 @03:38PM (#22773211)
That file extensions are not the best way to handle metadata is neither here nor there at this point. They don't seem to be going away, so better get used to 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.

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.

Re:Python for Non-Programmers by kick on Friday April 03, 2020 @11:21PM (#22775973)
That file extensions are not the best way to handle metadata is neither here nor there at this point. They don't seem to be going away, so better get used to them.

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.

Re:Python for Non-Programmers by mixmastamyk on Saturday April 04, 2020 @02:53PM (#22780545)
There are elegant designs and poor designs. Not a great revelation I’d gather.

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.

Re:Python for Non-Programmers by catalogia on Friday April 03, 2020 @02:03PM (#22772275)
> Filename extensions are usually hidden in macOS, but if you find them useful, you can show them.

https://support.apple.com/guide/mac-help/show-or-hide-filena...

(This matches my experience. Perhaps you simply forget changing this setting.)

Re:Python for Non-Programmers by mixmastamyk on Friday April 03, 2020 @02:11PM (#22772345)
Yes, I don't use it much, and must have changed it the first day.
Re:Python for Non-Programmers by Ididntdothis on Friday April 03, 2020 @06:22PM (#22774512)
I think this is one of the secrets of the success of VBA. Open Excel and you have a full IDE.
Re:Python for Non-Programmers by contravariant on Friday April 03, 2020 @10:05PM (#22775609)
The flipside of this is that you can open an Excel file and expect a full VBA application to begin running immediately.

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.

Re:Python for Non-Programmers by tmh88j on Friday April 03, 2020 @09:21PM (#22775428)
Perhaps, but I think it's more likely that the only feasible option was to use VBA with excel, and excel is the "default" spreadsheet application used everywhere. It nearly the same reason why JavaScript became the default front end language thanks to Netscape, which was the "excel of browsers" during the dawn of the internet.
Re:Python for Non-Programmers by reuven on Saturday April 04, 2020 @04:09PM (#22781092)
I have a Discourse forum that's open to anyone who registers for the course. I've been helping people there to install Python and Jupyter, as well as an IDE (typically PyCharm) if they want.
Re:Python for Non-Programmers by rafaelm on Friday April 03, 2020 @12:58PM (#22771410)
I think Thonny is perfect for this. It includes Python 3.7, has a simple debugger and is multi-platform.

Not affiliated, just a happy user.

https://thonny.org/

Re:Python for Non-Programmers by xapata on Friday April 03, 2020 @02:06PM (#22772297)
> Explains scopes. Highlighting variable occurrences reminds you that the same name doesn't always mean the same variable and helps spotting typos. Local variables are visually distinguished from globals.

That'd be a good feature in any IDE.

Re:Python for Non-Programmers by jliu70 on Friday April 03, 2020 @05:03PM (#22773934)
Yep, I agree with Thonny. It comes with Raspbien as well.

Another beginner option which is quite similar to Thonny is Mu. https://codewith.mu

Re:Python for Non-Programmers by legionof7 on Friday April 03, 2020 @01:49PM (#22772123)
Replit is perfect for this.
Re:Python for Non-Programmers by Blake_Emigro on Friday April 03, 2020 @11:06PM (#22775912)
You know what's better than criticizing negatively? Helping. So, to avoid being a hypocrite, how can I help you? LOL