0

I am just at the very start of what I think is gonna be a long journey exploring the world of applications in Google App Engine using Python.

I have just downloaded Python 2.6.4 from the Python official website and installed it on my computer (I am using Windows XP). I also downloaded the App Engine Python software development kit (SDK) (from this page) and installed it, too. Both of these steps were suggested on the second page of Google App Engine's Getting-Started Guide.

However, when I moved on to the third page, which is titled as "Hello, World!", I ran into a sort of complication. It is written there:

"Create a directory named helloworld. All files for this application reside in this directory. Inside the helloworld directory, create a file named helloworld.py, and give it the following contents..."

I am kind of puzzled here: How do I create a .py file? Is it like I need to create a notepad file (.txt) and name it helloworld.py (when I did so, it didn't change into any different file of any different, but rather stayed an ordinary .txt file) or should I somehow create that file using Google App Engine Launcher that I have installed?

unwind
  • 391,730
  • 64
  • 469
  • 606
brilliant
  • 2,489
  • 8
  • 26
  • 28
  • App Engine does not support Python 2.6. You will have better luck using a Python 2.5 release. Sad, but true. – JasonSmith Dec 08 '09 at 11:26
  • 1
    not to be too cruel but, this will indeed be a long journey if your first step in creating the program was asking how to use your editor :( – KevinDTimm Dec 08 '09 at 11:30
  • @jhs: Thanks for telling me that. I'll change to Python 2.5 – brilliant Dec 08 '09 at 14:21
  • @kevindtimm: I have no other choice - there hasn't yet been one person in this world who'd be born with an innate knowledge of how to use Google App Engine. No matter how long this journey is gonna be, sooner or later I should to start it anyway. BTW, my question was not about how to use my editor, but how to create a .py file (after I have already created its twin using my favorite editor). – brilliant Dec 08 '09 at 14:30

5 Answers5

3

When you downloaded and installed Python, you also installed IDLE. You can use this to easily write, run, debug and save .py files with syntax highlighting. To get started, just open IDLE, and select File -> New Window.

2

A .py file is a text file containing Python syntax. Use your favourite programming editor, or even NotePad.

Regarding your second problem, there's an option in Windows Explorer about hiding file extensions. Make sure it isn't checked -- you might well actually have renamed your file helloworld.py.txt but only seen helloworld.py

1

I am kind of puzzled here: How do I create a .py file? Is it like I need to create a notepad file (.txt) and name it helloworld.py?

I'm not on windows, but thats how it works on other operating systems: Create a file with an editor, then save as ...

ps. and .py is the extension (like .docx, .bat, ...), but it's just a convention (although a highly recommended one) ..

pps. heard the http://www.e-texteditor.com/ has more capabilities than notepad ..

miku
  • 181,842
  • 47
  • 306
  • 310
1

You have to be aware that the ending signifies recognition of files, not content. Name a file .py simply hints to the user (and the GUI) that it most likely is a python file.

That being said, python files are merely text files. You can simply create a text file with Notepad (or your editor of choice) and rename the ending to .py and work from there. Most modern editors will also highlight the syntax based on file endings.

pavium
  • 14,808
  • 4
  • 33
  • 50
Christian P.
  • 4,784
  • 7
  • 53
  • 70
1

You will need a better editor than Notepad. With Notepad, use Save As..., and type "helloworld.py" in the dialog, including quotes so that the file extension is .py instead of .txt

Roy Tang
  • 5,643
  • 9
  • 44
  • 74
  • WOW!!! This quotes point was the crucial one - now the file (its icon) looks like a normal .py file. Thanks a lot! – brilliant Dec 08 '09 at 11:03