Re: Hello World in Python
On Sun, Jan 25, 2015 at 6:14 PM, Rustom Mody wrote: > On Sunday, January 25, 2015 at 5:36:02 AM UTC+5:30, Chris Angelico wrote: > >> 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. > > Would be interested in how you manage that! > Am teaching a class where everyone has a laptop. > Having them setup with a bare modicum of uniformity is turning out some > challenge. > Some windows, some linux(es), even one blessed mac! Generally we use Google Hangouts - video chat, with options for screen-share (replacing the camera; let's face it, when you're discussing code, staring at talking heads isn't all that useful) and a few other neat features. But if uniformity is an issue, you might want to look into some kind of virtual Linux box like http://nitrous.io/ - that way, everyone's using the same system, and nobody has to worry about the stupid hassles of trying to support three different OSes. Though Nitrous mightn't be as important for you as it is for the Thinkful course; as part of the course, we teach PostgreSQL + Python + PsycoPG2 + SQLAlchemy, and if you're on a Mac and your student is on Windows, you'll *really* appreciate not having to figure out how to install that lot on a foreign platform! (In theory, the situation should be getting better. Installing stuff from PyPI under Windows has long been a massive nuisance, but it's starting to become a bit easier. But it's still a massive pain for someone who doesn't know Windows to try to walk a Windows person through the setup.) And hey. If you want a pay-for Python programming course, do check 'em out - www.thinkful.com. You get regular one-on-one mentorship, a highly responsive team of staff, and all sorts of random fun. There, I'm done advertising now. :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Hello World in Python
On Sunday, January 25, 2015 at 5:36:02 AM UTC+5:30, Chris Angelico wrote: > 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. Would be interested in how you manage that! Am teaching a class where everyone has a laptop. Having them setup with a bare modicum of uniformity is turning out some challenge. Some windows, some linux(es), even one blessed mac! -- https://mail.python.org/mailman/listinfo/python-list
Re: Hello World in Python
On 1/24/2015 7:12 PM, Terry Reedy wrote: On 1/24/2015 6:53 PM, Christopher J. Pisz wrote: I am trying to help a buddy out. I am a C++ on Windows guy. This buddy of mine is learning Python at work on a Mac. I figured I could contribute with non language specific questions and such. When learning any new language, I said, the first step would be a Hello World program. Let's see if we can get that to work. 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. It should. In a Windows console, using 3.4: C:\Programs\Python34>type tem.py # cat on Mac? print('Hello World!') C:\Programs\Python34>python tem.py Hello World! > Can anyone explain why there is no output? Without a copy of the file and command, as above, no. > Can anyone recommend a good walkthrough of getting set up and doing basics? Since you used 2.x print syntax: https://docs.python.org/2.7/ "Python Setup and Usage how to use Python on different platforms" "Tutorial start here" > I'll probably end up learning python myself, just to help out. You might possibly enjoy Python as a complement to C++. Some people prototype in Python and rewrite time critical functions in C++. One can access .dlls either directly (via the ctypes module) and write a wrapper file in C or C++. I believe Python has also been used to write tests for C++ functions (I know this is true for Python and Java, via Jython). Good docs. I got setup in Windows in 10 minutes. -- https://mail.python.org/mailman/listinfo/python-list
Re: Hello World in Python
On 1/24/2015 6:53 PM, Christopher J. Pisz wrote: I am trying to help a buddy out. I am a C++ on Windows guy. This buddy of mine is learning Python at work on a Mac. I figured I could contribute with non language specific questions and such. When learning any new language, I said, the first step would be a Hello World program. Let's see if we can get that to work. 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. It should. In a Windows console, using 3.4: C:\Programs\Python34>type tem.py # cat on Mac? print('Hello World!') C:\Programs\Python34>python tem.py Hello World! > Can anyone explain why there is no output? Without a copy of the file and command, as above, no. > Can anyone recommend a good walkthrough of getting set up and doing basics? Since you used 2.x print syntax: https://docs.python.org/2.7/ "Python Setup and Usage how to use Python on different platforms" "Tutorial start here" > I'll probably end up learning python myself, just to help out. You might possibly enjoy Python as a complement to C++. Some people prototype in Python and rewrite time critical functions in C++. One can access .dlls either directly (via the ctypes module) and write a wrapper file in C or C++. I believe Python has also been used to write tests for C++ functions (I know this is true for Python and Java, via Jython). -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Hello World in Python
On Sun, Jan 25, 2015 at 10:53 AM, Christopher J. Pisz 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 -- https://mail.python.org/mailman/listinfo/python-list