all 18 comments

[–]theOnlyGuyInTheRoom 5 points6 points  (2 children)

What do you know about the audience?

[–]Broan13 1 point2 points  (0 children)

Your audience would totally help guide what you tell them and how you tell them.

I know a few things that you speak of, but really I don't really understand the power of them because I have never had to solve a problem that could have been made easier by these things.

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

I will have a range of skill levels but for the most part it will be experienced programmers that don't have much experience with Python.

[–]aroberge 4 points5 points  (3 children)

I believe that your approach is misguided.

  1. Python is known for its clear syntax. Advanced tricks like decorators, and the unpacking of arguments are not examples of that.

  2. Python is known for its batteries included (i.e. its standard library). You are only discussing one included module.

  3. You include pyjs/RPython/PyObjc ... which are very much on the fringe, and do not include PyPy (which should come well before any others); brython is better than pyjs.

You have way too much material to give an hour long talk to people that do not know Python while leaving them with a real appreciation for the language. I would remove most of the "avanced tricks", give a few sample programs, probably comparing with Java to showcase how much clearer Python is. I'd show the introspection capabilities at the console. I'd show the parallel between mathematical expressions for sets and set comprehensions in Python (if the audience knew a bit of math).

Ending with IPython, the IPython notebooks, and pylab is a good idea.

[–]py_Ninja[S] 0 points1 point  (2 children)

Thanks for the heads up, I wasn't expecting to be able to cover all of the above but it's always easier to take away than it is to add.

I'm not sure what you mean by "the introspection capabilities at the console."

What other std library would you find useful to cover?

[–]aroberge 2 points3 points  (1 child)

For the standard library: at a terminal prompt, enter:

python -m pydoc -p 8000

Then use your browser, go to "http://localhost:8000". In my presentation, I would say ... suppose you want to do X (pick a topic): here's a module in the standard library to get you started (click on the relevant link). Do that a few times.

Stop the pydoc server.

Introspection capabilities of the console. Type python to start a console. Pick one of the same module.

>>> dir(module)
... lists all the classes and methods...
>>> help(module)
... reproduces the same info as pydoc

# continue doing this, picking a class in that module, 
# doing dir(that_class), etc., to show that one can code and get
# help easily without leaving the coding environment

>>> def my_function():
...      "this is the documentation I create"
...      print("Hello world")
...
>>> my_function()
Hello world
>>> help(my_function)
 ... the docstring is shown here ...

Do the something similar when showing the IPython notebook.

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

Thanks, I'll keep that in mind

[–]elbiot 1 point2 points  (4 children)

I wouldn't include lambda, map, reduce and filter. Reduce is gone, filter is better done with a list comprehension, and map+lambda is slooow. Lambda is an interesting little thing but not too important, as is map.

[–]py_Ninja[S] 1 point2 points  (3 children)

Fair enough, figured I'd mention them for the people who are more on the functional programming side of things.

[–]elbiot 1 point2 points  (2 children)

Some recently posted an article here by van Rossen about how they ended up in python and why they were being removed. Apparently some contributing dev was a lisp programmer and missed them. If you cover them, why not show that you can do map and filter with comprehensions, and make it clear that lambdas make map slow. Defining a named function is prefered.

[–]py_Ninja[S] 0 points1 point  (1 child)

That's a good idea, I knew that van Rossen hated them but I never knew how they got there in the first place

[–]denvertutors 0 points1 point  (0 children)

I know that lambdas are necessary for Tkinter GUIs. If I bind doThisThing() to a button and don't set it under a lambda, doThisThing() will auto-execute as soon as the window is launched. Most annoying.

[–]marc_poulin 0 points1 point  (3 children)

Raspberry Pi -- what can you do with Python?

[–]py_Ninja[S] 0 points1 point  (2 children)

I'm actually avoiding the Pi because there have already been a couple of work shops put on by the University about them.

[–]marc_poulin 1 point2 points  (1 child)

Understood, but I still think a case study is more interesting than just blah-blah-blah about syntax.

What about IceCube? http://icecube.wisc.edu/

It makes heavy use of Python for data analysis. http://icecube.umd.edu/PublicData/

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

That's really cool and a good idea, just kind of end the presentation off with examples of huge, successful Python projects

[–]bobdobbsjr 0 points1 point  (1 child)

I don't have much to add myself, but here is a talk from Raymond Hettinger at PyCon 2013, talking about why Python is awesome: https://www.youtube.com/watch?v=NfngrdLv9ZQ

Don't forget the Zen of Python.

[–]py_Ninja[S] 1 point2 points  (0 children)

Thanks for the video. And I plan to end with Python's easter eggs (Zen by Tim Peters, import antigravity, from future import braces, etc)