Hello World in Python

Chris Angelico rosuav at gmail.com
Sun Jan 25 01:05:12 CET 2015


On Sun, Jan 25, 2015 at 10:53 AM, Christopher J. Pisz
<cpisz at austin.rr.com> wrote:
> So my buddy creates opens the IDE they gave at the workplace, creates a new
> project, adds a demo.py file, writes one line : print "Hello World", hits
> Run in the IDE and indeed the display is shown at the bottom when it
> executes.
>
> I say the next step would be to get that to run on the command line. So
> (keep in mind I know nothing about macs) my buddy opens a "zsh?" window, cd
> to the directory, and I say the command i most likely: python demo.py
>
> It looks like it executes but there is no output to the command line window.
>
> Can anyone explain why there is no output?
> Can anyone recommend a good walkthrough of getting set up and doing basics?

Your broad methodology is fine! I'd normally expect that to work
correctly. Was the file properly saved? Ask him to display the file
(cat demo.py) to make sure it's what he thinks. Or maybe he's in a
different directory to the one he thinks he's in; again, catting the
file will help. Otherwise, it might be a weird problem with his shell,
but that's hard to diagnose.

One thing that I really like doing with my Python students (full
disclosure: I'm a mentor with www.thinkful.com and am thus at times
paid to help people learn Python) is some form of screen-sharing, so I
can watch him/her trying things. There are a number of zero-dollar
ways to do this, and it helps enormously. Flip on screen-share, ask
him to run the script, and see where that leads.

Good luck!

ChrisA



More information about the Python-list mailing list