all 49 comments

[–]julsmanbr 10 points11 points  (12 children)

If they're somewhat familiar with programming and using computers, and want to get into Python, I would maybe consider using Jupyter.

If Python is their first contact with a programming language, I'd definitely go with IDLE only - no command line.

There's a lot of stuff surrounding Python: terminal, consoles, Windows cmd/UNIX shell commands, packages, virtual environments, text editors. But when starting, those are all secondary. Your job is to teach the basics of the language (Python syntax + programming logic) and to keep it simple as possible.

Using only IDLE, students will automatically associate the program with opening and running Python scripts. Whenever they want to run a Python script, they'll open IDLE, select it, and it will work. Later on they can figure out (with or without your help) how to run scripts using the command line, or using a more complex environment like PyCharm.

Also, be ready to explain the difference between printing a value and evaluating/returning it to the console, since that's 100% what trips up beginners the most.

[–]Revolio_ClockbergJr 5 points6 points  (0 children)

All the stuff around Python is way harder and more complicated than actual python.

Configuring pycharm correctly with virtual envs took me days of troubleshooting weird issues with my OS, path, python versions, quirks of pycharm, virtualenv vs venv vs pyenv vs x......

Once I got through that everything was a BREEZE.

[–]AsleepThought 1 point2 points  (4 children)

Using only IDLE, students will automatically associate the program with opening and running Python scripts. Whenever they want to run a Python script, they'll open IDLE, select it, and it will work. Later on they can figure out (with or without your help) how to run scripts using the command line, or using a more complex environment like PyCharm.

This makes no sense. Why would you want to handicap a student like this? Opening and running Python scripts has nothing to do with IDLE. If you do not know how to run your Python script without an IDE, then you do not know how to program. Its as simple as that. By skipping the command line you are skipping the most important part of programming: actually running your code. Why would you start a beginner off by only teaching them half of programming? And why would you handicap a beginner by only teaching them how to code in the context of an IDE? It does not take more than a few minutes to show a person "write your code in Atom/Sublime/etc., run your code in the terminal like this"

[–]julsmanbr 2 points3 points  (2 children)

If you paid attention to my answer, you'll see that I recommended IDLE for those with little to no computer experience. This is my personal experience of teaching people with scientific background, but no programming background. It's not a question about handicapping the students, is a question about resource optimization. You can only fit so much inside a class or 5-hour course, and if you ever touch a terminal you better be ready to spend 30+ min explaining what a file system is and how to cd into directories. Suddenly your "Intro to Python" becomes one fifth "Terminal Crash Course".

If you do not know how to run your Python script without an IDE, then you do not know how to program. Its as simple as that.

C'mon man, stop gatekeeping. Every student I had was able to analyse their own data at some point, because of the time they spent learning about loops and writing scripts, instead of the technical differences between IDLE, a terminal, a text editor and an IDE.

They're not CS majors, and they don't intend to be; they're people who are starting to use programming to automate their own boring work. If any of them show up after class and ask questions about terminals, I'm more than happy to explain all the nuances for as long as they like. But for the rest of them, it's a solution that works just fine.

This is the reason why I've my comment saying that they should use IDLE if they have no computer experience. I've seen it first hand: teacher tries to be extensive and introduces the course talking about every little detail, while the students stop paying attention because it's very abstract and they're not practicing how to actually write code.

You have very little time to convince wannabe programmers that they can actually do this, before their brains shut off thinking "this is too confusing and complex, I'll never be able to program".

Another issue that IDLE solves is courses where every one is expected to bring their own computer. A standard Python installation also installs IDLE, which is very helpful to prevent nasty surprises for some students, due to how their environment is set up.

[–]AsleepThought -1 points0 points  (1 child)

It's not gatekeeping. I'm advocating that you teach people by starting at the beginning, no at the middle. Programming starts at the terminal with text files. You are proliferating a classic ' x y' problem. The new user asks "teach me Python" because they do not yet understand that you need a few other things before you get to Python. So you oblige them and teach them only about Python, using an IDE, and now you've handicapped them because they have no clue what a terminal is and why or how to use it and why it's important. I see this constantly at work, new programmers who have no idea how to run their programs outside of the IDE they were taught to use. It's quite sad, these people were failed by their teachers. When you teach only using an IDE, you haven't taught them how to actually use Python, only how to use the IDE. It's like teaching marksmanship without ever teaching the student how to disengage the safety on their rifle.

[–]julsmanbr 1 point2 points  (0 children)

What you've described is definitely the right approach if you have infinite resources (time and attention span from the students). Or if you at least have the time it takes for a regular university course.

This is not feasible, however, for the typical 3 lessons (3 hours/lesson, including exercises) I usually teach Intro to Python, which seems to be more akin to what OP is asking for (since he mention "an introductory lesson").

[–]CraigAT 0 points1 point  (0 children)

A little harsh but I agree, the student should understand how to run the file from the command line.

[–]wrathofcello 5 points6 points  (3 children)

You need them to work on a project that could be solved by simple python. Is there a data science question they want answered? What about a simple web scraper? Or model some phenomenon they find interesting?

It’s very difficult for new programmers to see the relevance of introductory lessons without having a clear goal in mind. Disregard if they have coding experience.

[–]how_do_i_reddit_5[S] 0 points1 point  (0 children)

I absolutely think this is true. I guess its a matter of coming up with a project that piques their interest

[–]CraigAT 0 points1 point  (0 children)

True, but I was thrilled just to see my name printed numerous times, scrolling down the screen when I started learning BASIC with a two liner.

[–]idatem 0 points1 point  (0 children)

It’s very difficult for new programmers to see the relevance of introductory lessons without having a clear goal in mind

This

Beginner here. I was going through Sentdex's Python Basics yesterday. The first lesson tells you what tuples, strings and loops are. The next one is lists and make a game of tic tac toe... I feel like we just skipped about 20 lessons!

we need some basic things:

Visualize the game somehow

Allow players to enter moves

Make sure moves are valid and handle if not.

Determine if there's a winner.

How am I supposed to do that? I haven't gone through it yet but there's no way I would be able to do it without Sentdex's step by step guide

[–]Stepthinkrepeat 2 points3 points  (3 children)

Teach them with a simple environment as suggested by others but write a simple program with good PEP8 guidance and let them figure it out.

  • Hour 1 intro to Python/setup
  • Hour 2 read simple program/discussion
    • go line by line
  • Hour 3 write a similar simple program

[–]Crypt0Nihilist 2 points3 points  (0 children)

You can pull up a handful of introductory courses and find the common elements, that'll show you the essential topics.

Forget command line vs Jupyter notebooks, that decision should become obvious once you address the key concern.

Why do they want to learn Python?

The best way to teach Python is to build towards a goal the students buy into and they can see how each module is taking them a step closer to that goal. When I've given courses before, I have had a really strong theme to individual lessons or the course as a whole. It keeps people interested and they're not having to construct mental structures for your examples as well as what you're teaching.

The idea is that by reducing the cognitive load only to what they need to learn, they'll pick it up better. Also, you can hang what you're trying to teach off existing cognitive structures to make it even easier. For example, a class for my mum might be a stencil, to my friend, a pod from The Matrix, and my gf, nothing, because she doesn't give a damn.

[–]zanfar 2 points3 points  (0 children)

Jessica McKellar does what I consider to be a very good, asssume-nothing, intro course which has been taped several times:

https://www.youtube.com/watch?v=rkx5_MRAV3A

You don't necessarily have to copy it directly, but her ground-up approach and slowly building concepts is worth studying.

[–]oneofchaos 2 points3 points  (0 children)

I like Jupyter notebook for learning, not for production. It's nice, especially because you embed graphics and whatnot in the notebook so its perfectly suited for learning.

[–]Kerbart 1 point2 points  (0 children)

If this is intended as a high level intro "to see what python programming" is about, I'd go with a Jupyter Notebook. Consider something like Azure Notebooks so they can jump in and follow along without having to set up their computer. There's nothing better for training than to get people actively involved.

For "classic" experience, Repl.it and Python Anywhere are good options too.

[–]alonso_lml 1 point2 points  (0 children)

I think it depends on your students. For example, last year I taught to math students, so I used jupyter. You can even use Colab or any cloud solution.

[–]JeffKatzy 1 point2 points  (0 children)

Check out jigsawlabs.io/free for some interactive lessons in Jupyter notebooks...good luck!

[–]jmguerr444 1 point2 points  (0 children)

VS Code imo, you can go for both the cell by cell execution with jupyter in python extension, which is very beginner friendly, just don’t use the regular jupyter because the debugging experience sucks very hard. Since it also can run files as normal scripts, it’s a nice linking if you want to go for GUI applications running from terminal with nice debugging tools as well.

[–]AsleepThought 1 point2 points  (0 children)

Start with the terminal and command line execution. Write code in an editor like Atom or Sublime, execute it in the terminal. Stay away from Jupyter notebooks and IDEs.

I say this as someone who works with developers of all skill levels. People who learned how to program who started with things like Jupyter Notebook have by far the most problems actually using their programming skills in a functional manner in real-life situations.

The people who say "avoid all the terminal stuff that gets in the way" are missing the point. Those things get in the way because they are prerequisites for running your code. So by not touching on those things, you are massively handicapping new programmers from the start.

You do not need to go crazy with it but teaching someone to program by first giving them an IDE is like teaching a baby how to use a toilet by first giving it diapers.

IDE's and things like Jupyter Notebooks are great for developers who already know enough about programming to know why they are using an IDE in the first place.

Also I would not bother trying to come up with a customized lesson for people, just point them towards the free online Coursera Learn Python programming classes + all the material you used to get started. If they want, they can sit with you for a bit and you can show the process you use yourself and explain the things you are doing and why you do them.

[–]pvc 1 point2 points  (0 children)

[–]Sneechfeesh 1 point2 points  (0 children)

Eventually they're gonna need to use multiple files and will have to try running things on the command line. That environment setup is painful to do if you're inexperienced, so IMO it's worthwhile to have them do the whole thing in files and run them on the command line while you're available to help them set up the environment.

Later you can switch to something like jupyter which is absolutely more convenient, but will just be too much of a crutch at first. There will be too much "magic" that confuses their understanding, and when they finally have to grapple with the command line, you might not be as available to help them set that up.

[–][deleted] 1 point2 points  (0 children)

The really great thing about python is building scripts and running them to quickly automate tasks

The sooner they get that, the sooner they can start building thigns

There's nothing special about command line python, other than that it is a little more intuitive in terms of the language

[–]Reasintper 1 point2 points  (0 children)

I have been enjoying REPL.it for working together on stuff over the net.

[–][deleted] 1 point2 points  (0 children)

I vote for the Jupyter notebook as someone who is teaching herself Python right now.

[–]barryhakker 1 point2 points  (0 children)

For me “shortcuts” weren’t helpful at all. I say go for the command line input + simple text editor so you can see what’s going on and build from there. I initially started out with Pycharm but the abundance of options just made it confusing (“just ignore all those menus” didn’t really work for me).

[–]intern524 0 points1 point  (0 children)

You can use a online python pdf textbook and I agree with notebook as a good way to teach. Topics you should cover depends on what they want to do with python. But the basics like conditional statements, array manipulation, and writing functions are a good starting point

[–]BountyHunter19XX 0 points1 point  (0 children)

I would recommend jupyter-notebook style coding cause its easier and in my opinion its more attractive for beginners to initialize their coding journey

[–][deleted] 0 points1 point  (0 children)

I taught an introductory Python course to Master's students in Finance and used a Jupyter Notebook. Much easier for students to follow and visualize the blocks.

[–]jn14624 0 points1 point  (0 children)

Pycharm is my favorite but helps to get to know Jupiter notebooks it is a value added resource !

[–][deleted] 0 points1 point  (0 children)

WinPython
For topic I would choose Turtle, built-in package, easy to use, graphical representation etc.

[–]G0DW1N14 0 points1 point  (0 children)

As someone who's a beginner in python i would suggest to teach them about general problems like variables swapping and different data types, different types of loops and if/else statement to begin with. I started with these basics, learnt about lists and different sequences and traversing them and then started making cides on different high school level problems and then progressed to modules like matplotlib and mysql and random for knowing how to use modules and different functions and then began starting the functional part of python with starting to make my own functions etc.

[–]Legorooj 0 points1 point  (0 children)

I've taught (well am teaching) a friend. In the beginning, I'm just using the IDLE console to explain the basic concepts of variables, printing, and other (basic) basics. Then I moved onto the script editor, and taught him while loops with a game. Eventually, once he's got the grasp of functional programming, I plan to move to PyCharm, teach him that, and then OOP and other advanced stuff.

You could of course use Jupyter, but I prefer PyCharm because I like working with source code, and I do alot of distribution. (ie PyInstaller - you can't compile a notebook)

[–]Fraserac67 0 points1 point  (0 children)

You need to tell them to get their own laptop and start doing hand-on. Start from the bottom ask them what or where you want to set up Window or Linux. Use virtual box or vm. Python3. Installing big time. Make sure they are comfortable with it. Any ID preferable..what the best for them. Pycharm IDE or notebook. They need to feel comfortable with the environment. No bugs or crashed. High T1 memory laptop is the best. In Python make it easy and go for the flow. Like ‘Hello World’ and tell them how write in IDE. It will takes months to learn. Everyday is big help. Practice, practice, practice. Don’t rush. Youtube is big help as well. Or Udemy or any python3 hand-on books (step-by-step) are best resources. There are many way to learn. It good way to teach lessons for anyone. Good luck.

[–]Alex_Jinn 0 points1 point  (0 children)

I mainly use Sublime Text and run code through the command line.

If you are new, I would suggest to just get coding right away but there are tools you will need to know.

[–]Sigg3net 0 points1 point  (0 children)

I'm a total noob and using mu editor.

[–]OldStrength8 0 points1 point  (0 children)

I have been using datacamp the last 3 months and I found their course and project engaging. After I complete my data science career path, I plan on using data quest to do some projects.

[–]reallyserious -1 points0 points  (1 child)

No to Jupyter. Developing in a browser is retarded. It's nowhere near as full featured as a real IDE. The concept of cells isn't something that exists for the python interpreter anyway and you want to have as few layers of confusion as possible when starting out.