[Tutor] ADO problem

2007-07-16 Thread János Juhász
Dear All, I have a good sample about using ADO to reach windows active directory. import win32com.client c = win32com.client.Dispatch("ADODB.Connection") c.Open("Provider=ADSDSOObject") rs,rc=c.Execute(""" SELECT name, description, department >From 'LDAP://DC=VELUX, DC=ORG' where objectClas

Re: [Tutor] ADO problem

2007-07-16 Thread Tim Golden
János Juhász wrote: > while not rs.EOF: > print rs.Fields[0].Value, rs.Fields[1].Value > rs.MoveNext() > > It print the next result: > IT (u'\xc1kos Szab\xf3',) > IT (u'Szabolcs K\xe1m\xe1n',) > ... > > So rs.Fields[1] is a tuple. Well, here's the most obvious thing: By the look of it

Re: [Tutor] Bundle help!

2007-07-16 Thread Jason Massey
A nice tutorial on using regular expressions in Python: http://www.amk.ca/python/howto/regex/ On 7/15/07, bhaaluu <[EMAIL PROTECTED]> wrote: Hi! http://docs.python.org/lib/module-re.html Regular Expressions module. On 7/15/07, Sara Johnson <[EMAIL PROTECTED]> wrote: >

Re: [Tutor] How to improve

2007-07-16 Thread taserian
Thank you both, Alan and Gregor. Sorry I didn't reply earlier; just a bit overwhelmed with a family situation over here. Alan, looks like I'll have to go over list comprehension as a way to initialize variables. I recall when I first started programming this, I tried wordlist = [] * 31, completel

Re: [Tutor] tutor

2007-07-16 Thread bhaaluu
Greetings Alan, et al, On 7/14/07, ALAN GAULD <[EMAIL PROTECTED]> wrote: > > > What do you find challenging? I find _ALL OF IT_ [computer programming] challenging. Perhaps that is why computer programming is my hobby. If it wasn't challenging, it wouldn't hold my interest for very long. Part of

[Tutor] Basic DB question

2007-07-16 Thread z machinez
Hi All, I am just starting out with Python and was hoping someone could point me in the direction of reading materials for working with RDBMS? In particular, I am working with two various relational databases. One of which stores real-time data for trading. In Python I am planning on building var

Re: [Tutor] eyeD3 module installation on XP

2007-07-16 Thread Terry Carroll
On Fri, 13 Jul 2007, Richard Querin wrote: > Any pointers on how to go about installing this module? There's a file > called 'setup.py.in' as well. Not sure what that does.. Richard; I'm stumped. Can you try version 0.6.10? See why below. I'm using eyeD3-0.6.10, so I know it's possible to inst

Re: [Tutor] Basic DB question

2007-07-16 Thread Andreas Kostyrka
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 DBAPI is an interface standard describing what you can expect in a database access module, like psycopg. Andreas z machinez wrote: > Hi All, > > I am just starting out with Python and was hoping someone could point me > in the direction of reading

[Tutor] CGI Calculator

2007-07-16 Thread Darren Williams
Hi all, I am a Python convert coming from a JavaScript background (as you can probably tell) and am currently writing my first application using Python which will be a calculator for an online game I used to play (thought it would be a decent first project) but am not sure on the syntax for ref

Re: [Tutor] CGI Calculator

2007-07-16 Thread Eric Brunson
Darren Williams wrote: > Hi all, > > I am a Python convert coming from a JavaScript background Welcome to Python, Darren. > (as you can probably tell) and am currently writing my first > application using Python which will be a calculator for an online game > I used to play (thought it would

Re: [Tutor] eyeD3 module installation on XP

2007-07-16 Thread Richard Querin
Sorry Tino, Missed your response completely. Your advice on using cygwin was spot-on. I hadn't thought of using that. Per my response to Terry, I've got the .10 version up and running now. Thanks. RQ ___ Tutor maillist - Tutor@python.org http://mail

[Tutor] Fwd: eyeD3 module installation on XP

2007-07-16 Thread Richard Querin
On 7/16/07, Terry Carroll <[EMAIL PROTECTED]> wrote: > You might want to try downloading .10 instead of the current release and > see if that works for you. See http://eyed3.nicfit.net/releases/ > > Sorry I can't help more. Nope. That's fine. Based on your response I was able to upgrade my Cygwi

Re: [Tutor] CGI Calculator

2007-07-16 Thread Darren Williams
Ok, now i've modified my script but am getting another error, i've commented a few useless (hopefully) lines out - #!/usr/bin/env python import cgitb; cgitb.enable() import cgi def main(): print "Content-type: text/html\n" form = cgi.FieldStorage() #if form.has_key("coatSize") and f

Re: [Tutor] CGI Calculator

2007-07-16 Thread Eric Brunson
Darren Williams wrote: > Ok, now i've modified my script but am getting another error, i've > commented a few useless (hopefully) lines out - > > #!/usr/bin/env python > > import cgitb; cgitb.enable() > import cgi > > [snip] > 17 while usedPockets > totalJunkies - labSpace * 17: > >

Re: [Tutor] CGI Calculator

2007-07-16 Thread Darren Williams
Now another problem - the script is just printing the word 'Tokens' over and over again, it's supposed to work like this (JavaScript version made by me) - http://nazkyn.brinkster.net/1.8.html Thanks in advance for any help :) - Original Message - From: "Eric Brunson" <[EMAIL PROTECTED]

Re: [Tutor] CGI Calculator

2007-07-16 Thread Eric Brunson
Darren Williams wrote: > Now another problem - the script is just printing the word 'Tokens' > over and over again, it's supposed to work like this (JavaScript > version made by me) - http://nazkyn.brinkster.net/1.8.html > > Thanks in advance for any help :) It's doing exactly what you've told i

Re: [Tutor] CGI Calculator

2007-07-16 Thread Darren Williams
That's just printing Tokens: 1 Tokens: 2 ... Tokens: 6000 etc... Can you recommend any tutorials for me? - Original Message - From: "Eric Brunson" <[EMAIL PROTECTED]> To: "Darren Williams" <[EMAIL PROTECTED]> Cc: Sent: Monday, July 16, 2007 2:48 PM Subject: Re: [Tutor] CGI Calculator

[Tutor] curses

2007-07-16 Thread Tiger12506
curses does not run on my Windows XP computer. Is this supposed to be a Linux only module? Traceback (most recent call last): File "", line 1, in File "C:\Python25\lib\curses\__init__.py", line 15, in from _curses import * ImportError: No module named _curses JS __

Re: [Tutor] curses

2007-07-16 Thread Tino Dai
On 7/16/07, Tiger12506 <[EMAIL PROTECTED]> wrote: curses does not run on my Windows XP computer. Is this supposed to be a Linux only module? Traceback (most recent call last): File "", line 1, in File "C:\Python25\lib\curses\__init__.py", line 15, in from _curses import * ImportError:

Re: [Tutor] curses

2007-07-16 Thread Luke Paireepinart
Tino Dai wrote: > > > On 7/16/07, *Tiger12506* <[EMAIL PROTECTED] > > wrote: > > curses does not run on my Windows XP computer. > Is this supposed to be a Linux only module? > > Traceback (most recent call last): > File "", line 1, in > File "C:\P

Re: [Tutor] curses

2007-07-16 Thread bhaaluu
On 7/16/07, Tiger12506 <[EMAIL PROTECTED]> wrote: > curses does not run on my Windows XP computer. > Is this supposed to be a Linux only module? > > Traceback (most recent call last): > File "", line 1, in > File "C:\Python25\lib\curses\__init__.py", line 15, in > from _curses import * >

[Tutor] ADO problem

2007-07-16 Thread János Juhász
Hi Tim, thanks your help. It is clear for me now. > From: Tim Golden <[EMAIL PROTECTED]> > Subject: Re: [Tutor] ADO problem > J?nos Juh?sz wrote: > > while not rs.EOF: > > print rs.Fields[0].Value, rs.Fields[1].Value > > rs.MoveNext() > > > > It print the next result: > > IT (u'\xc1kos S

Re: [Tutor] curses

2007-07-16 Thread Luke Paireepinart
Hey bhaaluu - I've enjoyed your posts to the list so far. They're very informative and well-written. -Luke bhaaluu wrote: > On 7/16/07, Tiger12506 <[EMAIL PROTECTED]> wrote: > >> curses does not run on my Windows XP computer. >> Is this supposed to be a Linux only module? >> >> Traceback (mos

Re: [Tutor] Here is newbie doc on how to implement generators

2007-07-16 Thread Kent Johnson
John Fouhy wrote: > def walkTree(tree): > # stack to hold nodes as we walk through > stack = [] > stack.append(tree) > > while stack: > value, children = stack.pop() > for child in reversed(children): # reverse children to get > the right order. > stack

Re: [Tutor] Here is newbie doc on how to implement generators

2007-07-16 Thread Kent Johnson
Dave Kuhlman wrote: > On Fri, Jul 13, 2007 at 12:39:40PM +1200, John Fouhy wrote: >> On 13/07/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote: >>> And, I have a question -- If you look at the example of the >>> iterative (non-recursive) generator (the Doubler class), you will >>> see that it walks a lis

Re: [Tutor] Here is newbie doc on how to implement generators

2007-07-16 Thread Kent Johnson
Dave Kuhlman wrote: > I find iterators and generators fascinating. So, in order to try > to understand them better myself, I've written up some notes. I'm > hoping that these notes might help someone new to the generators > and iterators in Python. You can find it here: > > http://www.rexx.

Re: [Tutor] interpreter restarts

2007-07-16 Thread Tiger12506
> But there's an exception to that - if you right-click a file in Windoze > and 'edit' it, > IDLE won't open up its subprocess, and as such, it can't restart the > interpreter session because it's running in the same > process as IDLE, and to restart the interpreter would mean restarting > IDLE. >

Re: [Tutor] curses

2007-07-16 Thread Tiger12506
> There IS a way to try Linux, Python, and curses WITHOUT > installing anything to the hard-drive of your MSWindowsXP > computer, and that is to download a Linux LiveCD ISO image, > and make a bootable CD from that image. Your computer > BIOS should be setup to boot from a CD. *That* is the proble

Re: [Tutor] Searching for word in text file

2007-07-16 Thread Kent Johnson
Vladimir Strycek wrote: > Hi all, > > i need script which open two text files and take first word from the > first file, runn throught first fords of second file and give me result > if its there or not... > > what i have so far is: > > import re, string > > # Nacitanie suborov na porovnanie

Re: [Tutor] reading random line from a file

2007-07-16 Thread Tiger12506
Perhaps ~this~ is what you are worried about performance-wise? Image NameMem Usage - python.exe11,096 K That's not too bad considering ~this~ explorer.exe 14,356 K svchost.exe24,000 K And I worry about the mp3 player I wrote in C using 2,520 K

Re: [Tutor] interpreter restarts

2007-07-16 Thread Luke Paireepinart
Tiger12506 wrote: >> But there's an exception to that - if you right-click a file in Windoze >> and 'edit' it, >> IDLE won't open up its subprocess, and as such, it can't restart the >> interpreter session because it's running in the same >> process as IDLE, and to restart the interpreter would mea

[Tutor] Serve a file using http

2007-07-16 Thread Sebastian Lara
Hello all, I'm using a SimpleXMLRPCServer to update a file remotely from a simple xml-rpc python client. After that, I need to serve this file but I don't know if I can do this with SimpleXMLRPCServer or if I need another server. Thanks in advance -- Sebastián Lara Menares Ingeniería Civil Elec

[Tutor] curses

2007-07-16 Thread max baseman
hello all sorry to bother I'm working on my first curses program ive been wanting to learn curses for a while now and now that a have a lop top with fedora core running in run level 3 ware im trying to program all the tools i'll use but curses will be my only gui ALAN has been helping me wi

Re: [Tutor] interpreter restarts

2007-07-16 Thread Sara Johnson
Luke, Jacob, et. al... Dumb question (may be slightly off course from what you two were discussing), but are you both describing how to get the IDLE to run along with the editor? I may just be getting too many things confused. I've tried to run IDLE, but that's not working. I have the same f

Re: [Tutor] CGI Calculator

2007-07-16 Thread Eric Brunson
Here's a start by Guido: http://docs.python.org/tut/tut.html And here's a bunch more: http://www.python.org/doc/Intros.html I'm not sure of your level of expertise, so I can't recommend any of them in particular. Darren Williams wrote: > That's just printing Tokens: 1 Tokens: 2 ... Tokens: 6

Re: [Tutor] tutor

2007-07-16 Thread Tiger12506
> please think about your first programming class, and then think about how > long it took the prof to teach the concept of array. > > yes, it's about a week, if he is really good. [gentle rant] Yes, and I find that most idiots in math classes NEVER gain the concept of multiplying fractions (longe

Re: [Tutor] reading random line from a file

2007-07-16 Thread Tiger12506
If you truly wish to kill yourself trying to make it as efficient memory as possible, then you can follow this example. (This is more like what I would write in C). The getrandomline function picks a random byte between the beginning and the end of the file, then backs up until the beginning of the

Re: [Tutor] interpreter restarts

2007-07-16 Thread Tiger12506
Hmmm. You should read closer ;-) > It sounds like python_icon.exe is a fake executable that just contains the > icon for python programs... > hence the name. Perhaps. If that's the case though, someone needs to talk to the guys who design the setup file for python. It is an inefficient waste of

[Tutor] IDLE Usage - was Interpreter Restarts

2007-07-16 Thread Tiger12506
> Luke, Jacob, et. al... > > Dumb question (may be slightly off course from what you two were > discussing), but are you both describing how to get the IDLE to run along > with the editor? I may just be getting too many things confused. I've > tried to run IDLE, but that's not working. I have

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-16 Thread Sara Johnson
First off, yes, I was referring to (I guess you could say) a non-python editor. I use an SSH editor set up by my school. If I type python at the prompt in SSH, I get the Python shell. My problem is, I can't open a GUI no matter what I subscribe to or purchase. I have Python 2.3 and yes, I ca

Re: [Tutor] interpreter restarts

2007-07-16 Thread Luke Paireepinart
Tiger12506 wrote: > Hmmm. You should read closer ;-) > Heh. You're right, I didn't read your whole message. I just skimmed it :P > >> It sounds like python_icon.exe is a fake executable that just contains the >> icon for python programs... >> hence the name. >> > > Perhaps. If that's

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-16 Thread Luke Paireepinart
Sara Johnson wrote: > First off, yes, I was referring to (I guess you could say) a > non-python editor. I use an SSH editor set up by my school. If I > type python at the prompt in SSH, I get the Python shell. My problem > is, I can't open a GUI no matter what I subscribe to or purchase. I

Re: [Tutor] 200 dollar questions!

2007-07-16 Thread Rikard Bosnjakovic
On 01/07/07, elis aeris <[EMAIL PROTECTED]> wrote: [...] > GainFocus(handle) > > Keyboard_event ( "hello python!") > Mouse_event (x,y, left, 2) > > the (x,y) = should be relative to the active window and independent of the > window's position. > 2 as in clicking twice. This sounds the renta