Step 1. Can't figure out how to open hello.py

523 views
Skip to first unread message

Newbie 001

unread,
Feb 26, 2014, 2:09:22 AM2/26/14
to python-g...@googlegroups.com
Opened up cmd, went down to google exercises, could not open hello.py
Found Python27, typed Python in search and opened up python editor.
Now what? "./hello.py" results in invalid syntax error.

Downloaded Notepad++.
It says here " If running hello.py gives the error "Unknown option: -", the file may have the wrong line-ending. Here are the preferences to set for common editors to treat tabs and line-endings correctly for Python:"

But this line here
"Windows Notepad++ -- Tabs: Settings > Preferences > Edit Components > Tab settings, and Settings > Preferences > MISC for auto-indent. Line endings: Format > Convert, set to Unix."

makes zero sense to me whatsoever. Where do I see the option for Line endings, or Format --> Convert??

Newbie 001

unread,
Feb 26, 2014, 2:26:02 AM2/26/14
to python-g...@googlegroups.com
Also, further confusion.
Why do I even need Notepad++?
I can bring up the python box by typing python in cmd, and I can say open file and open hello.py and edit its code there.

But I can't type in the python box "python hello.py Alice" or "hello.py". This is extremely frustrating.

Newbie 001

unread,
Feb 26, 2014, 2:35:09 AM2/26/14
to python-g...@googlegroups.com
Can I really not type in
python hello.py
OR
hello.py

in the Python shell???


On Tuesday, February 25, 2014 11:09:22 PM UTC-8, Newbie 001 wrote:

Robert Mandić

unread,
Feb 26, 2014, 7:13:58 AM2/26/14
to python-g...@googlegroups.com
start => run => cmd

Then type in:
<PATH TO YOUR PYTHON EXECUTABLE> <PATH  TO YOUR PROGRAM>

For example:
C:\Python27\python27.exe C:\Users\YourUserName\Desktop\google-exercises\hello.py




--
You received this message because you are subscribed to the Google Groups "Python GCU Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-gcu-for...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Lp, Robert

Newbie 001

unread,
Feb 26, 2014, 11:20:23 AM2/26/14
to python-g...@googlegroups.com
Hi Robert, that didn't work for me.

And is there a way I can just launch hello.py from my Python shell?
I'm able to open Python shell from typing in "python" in my Start > Search


On Tuesday, February 25, 2014 11:09:22 PM UTC-8, Newbie 001 wrote:

Newbie 001

unread,
Feb 26, 2014, 11:50:31 AM2/26/14
to python-g...@googlegroups.com
I think I figured out what the problem is:
I have a folder called Joe Smith and the space is throwing the cmd line off. I've tried "Joe Smith", Joe\ Smith, etc but it's not working.


On Tuesday, February 25, 2014 11:09:22 PM UTC-8, Newbie 001 wrote:

Robert Mandić

unread,
Feb 26, 2014, 12:27:59 PM2/26/14
to python-g...@googlegroups.com

Please paste full output.

--

Newbie 001

unread,
Feb 26, 2014, 1:03:44 PM2/26/14
to python-g...@googlegroups.com
Hi, I've made some progress.

C:\python27\python.exe "C:\users\joesmith\desktop\joe smith\python\google-python-exercises\hello.py"

This works, but i am unable to create this:
C:\google-python-exercises> python hello.py Alice
Hello Alice

as shown on the Python Set Up page:
https://developers.google.com/edu/python/set-up



On Tuesday, February 25, 2014 11:09:22 PM UTC-8, Newbie 001 wrote:

Newbie 001

unread,
Feb 26, 2014, 1:05:04 PM2/26/14
to python-g...@googlegroups.com
Also, do I really have to type that all out everytime I wish to run a .py file?
I can launch the Python shell, can't I just run files using that?
I can open using the tab File-->Open-->hello.py that way, but I don't know how I would do hello.py Alice

Gregory Rodrigues

unread,
Apr 11, 2014, 6:14:51 AM4/11/14
to python-g...@googlegroups.com
Not sure if you are still having issues with this but: 

I have a couple of questions: 

1. What output do you get when you type in "python" in the CMS Prompt?
2. What is the output that you get when you type "python hello.py Alice"? 

I would really help if you could paste the complete output here.. 

Andy Tyriver

unread,
Apr 22, 2016, 9:50:31 AM4/22/16
to Python GCU Forum
I have tried everything to make this work.

The Command Prompt lets me load Python so I can print strings, but I cannot run python hello.py Alice from the Python set up page either. I get invalid syntax errors.

Kotipalli Harathi

unread,
Apr 22, 2016, 9:53:50 AM4/22/16
to python-g...@googlegroups.com
hello what's this

--
You received this message because you are subscribed to the Google Groups "Python GCU Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-gcu-for...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sovutta Sar

unread,
Apr 22, 2016, 5:52:24 PM4/22/16
to Python GCU Forum
Did you install python properly?

Supun Sudaraka

unread,
Apr 22, 2016, 7:45:50 PM4/22/16
to python-g...@googlegroups.com
On Fri, Apr 22, 2016 at 7:20 PM, Andy Tyriver <tyri...@gmail.com> wrote:
I have tried everything to make this work.

The Command Prompt lets me load Python so I can print strings, but I cannot run python hello.py Alice from the Python set up page either. I get invalid syntax errors.

Can you show me the code?
 

--
You received this message because you are subscribed to the Google Groups "Python GCU Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-gcu-for...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Greg

unread,
Apr 25, 2016, 9:33:14 AM4/25/16
to python-g...@googlegroups.com
This is because python is not added in your system class path .. from CMD run the command "path" it should see the C:\python27\ in the output if not you need to add it to system class path.

HTH,
Greg

Gregory Rodrigues

--
You received this message because you are subscribed to a topic in the Google Groups "Python GCU Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-gcu-forum/_5NTOo07onQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python-gcu-for...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages