How to configure Python in Windows

cosmo_general at cosmo_general at
Fri Feb 29 03:04:23 CET 2008

On 2月28日, 下午6时52分, Larry Bates < at> wrote:
> cosmo_gene... at wrote:
> > Hi Folks,
> > I just downloaded precompiled Python for Windows, and it runs. Now I
> > have got the command line coding. However, I can't run my python
> > scripts. My python script,, is located in C:\\....\pydir, and I
> > have set the python interpreter on the directory. When I run
> > os.listdir(), I found my script of is right in the pydir. But,
> > when I tried to run command-line python, to compile it, I got
> > "Syntax error: invalid syntax". I guess the interpreter did not find
> > my script  In the past, I worked python on unix/linux, and I
> > knew how set the path, and I ran my python scripts smoothly. I wonder
> > anybody can help me to configure the python interpreter? Thanks!
> > Muddy Coder
> Syntax error is not give if interpreter can't find a script.  You should post
> full tracebacks on this newsgroup so we can help.  It is more likely that you
> actually have a syntax error in
> -Larry

Hi Larry,

Thanks for help. I retried to run the script. My script is as simple
import os


print "cwd is",dir

The results are:

1) If I edit it with a text editor, and try to compile at Python
shell, the error message is: SyntaxError: invalid syntax
2) If I run the module by pressing F5, it ran, and printed out the
directory name

Can you figure it out? Thanks!

More information about the Python-list mailing list