This message was edited by iwilld0it at 2003-6-4 18:20:14
: : First off, hello Infidel (yes you have zapped my curiosity.)
: : Listen I looked at the www.python.org site and see alot of stuff. Im impressed. I downloaded Python 2.2 and the Win32 COM thing. I played with it for a little bit and I am not really sure where to begin.
: : Could anyone guide me through a simple example using the compiler and then a real simple example using the Win32 portion, so that I can whet my apetite. You could direct me to an example program online for instance, so I could dissect it and ask questions later.
: : OR can someone recommend a good starting path of articles I can read. Mainly starting with how to use the compiler and migrating to learning the language syntax and basics, then the hard-core Object Oriented aspects. Keep in mind im using Windows 2000, so I will probably concentrate more on Win32. Im not ready to go all googly eyes yet so I probably wont pick up a book just yet.
: : Any help for a Visual Basic Veteran, BUT a Python newbie will be appreciated.
: Cool! Welcome aboard.
: The standard tutorial should be under
: Start -> Programs -> Python 2.2 -> Python Manuals.
: When you installed the win32 extensions, there should have been a small tutorial installed at
: Start -> Programs -> Python 2.2 -> COM Readme
: That page has a link to the documentation which has some good examples.
: First off, python doesn't have a compiler. Since it's technically a "scripting" language, it's interpreted. Since you got Python 2.2, the interpreter should be something like C:\Python22\python.exe (if you used the default paths).
: Normally to run a python script, you would pass it as the first argument to the interpreter:
: C:\Python22\python.exe myscript.py
: Windows should have .py files registered if you ran the installation package, so you can just double-click a .py file and it will execute in the interpreter. Windows also recognizes the .pyw extension and will execute those scripts without displaying a command box.
: One of the coolest things about the Python interpreter is that you can run it interactively (kind of like the "immediate" window of VB, only far more powerful). There are a couple of ways to do this. Either open a command box and run the interpreter there, or choose IDLE from the start menu, or since you installed the win32 extensions, there is PythonWin which gives you an MDI interface. I prefer PythonWin, so I would start with that. PythonWin also gives you easier access to the COM stuff.
: I really recommend starting with the standard tutorial. I'll check back here periodically during the day to see if you have any questions.
I whipped through some documentation and I must admit I am stoked about
how strings and list are handled. I love that slice notation and the fact that you can slice strings from the end as well. Anyways, I got to
functions and am a little frustrated.
I cant seem to get the value of say like the List objects Count function to print properly. Please tell me if im handling functions
>>> mylist = [1,2,3]
<built-in method count of list object at 0x010ABC48>
I tried ...
>>> ct = mylist.count
But the count comes up zero. I guess im not sure how premade functions and custom functions work.
Also, how do i program a script in PythonWin editor without it being
interpreted as I go along. I kinda want to write a complete script then feed it all at once to the interpreter.