On Mar 23, 7:25 am, "sandeep patil" <[EMAIL PROTECTED]> wrote: > i have install python on window xp os. > C:/program files/python > > i have done print program it working but .py can't working > help me to how i will execute this file this file where i will save > it. > path execution how . > tell me about any envorment veriable in python to set before python > editor run,it path. etc > ************************************************************ > > >>> print ' sandeep patil' > sandeep patil > >>> print ' sandeep "bhagwan " patil ,msc. java j2ee developer" > > SyntaxError: EOL while scanning single-quoted string>>> print ' sandeep > "bhagwan " patil ,msc. java j2ee developer' > > sandeep "bhagwan " patil ,msc. java j2ee developer > > >>> import posix > > Traceback (most recent call last): > File "<pyshell#4>", line 1, in <module> > import posix > ImportError: No module named posix > > >>> phonebook = {'sandeep':9325,'amit':9822,'anand':9890} > >>> phonebook = {'titu':9423,'dadu':9422,'giri':9326} > >>> inverted_phonebook=invert(phonebook) > > Traceback (most recent call last): > File "<pyshell#7>", line 1, in <module> > inverted_phonebook=invert(phonebook) > NameError: name 'invert' is not defined>>> def invert(table): > > index={} > for key in table.key(): > value=table[key] > if not index.has_key(value): > index[value]=[] > index[value].append(key) > return index > ************************************************************************
Hi Sandeep. As you are working with Python on Windows, I would suggest that you install the Python for Windows extensions from here: http://sourceforge.net/project/showfiles.php?group_id=78018 It includes a very good application called PythonWin. Once installed, PythonWin will be available under Python in your Start menu. If you run PythonWin, File/New gives you the option to create a new Python script. To begin with, you can save into the Lib folder of your Python installation (probably C:\Python25\Lib). I usually add my initials at the front of the script name to differentiate my scripts from the standard ones if I put stuff in Lib. You should be able edit your PYTHONPATH variable in PythonWin - see the Tools options (though, now I look, my installation actually has a bug in this function), or alternatively, you can add a folder to your PYTHONPATH environment variable in RegEdit (if you know what you're doing). I hope this helps. J. -- http://mail.python.org/mailman/listinfo/python-list