Re: [Tutor] tuples versus lists

2006-09-15 Thread Bob Gailer
John Fouhy wrote: Generally, you should use a tuple when you have different things that you want to clump together to make one data structure. Whereas you should use a list when you have multiple things that are the same, that you want to iterate over. Different perspective: tuples are

Re: [Tutor] pymssql or ODBC

2006-09-15 Thread Chris Hengge
looking at your link, is your con wrong? for example... the one on the link you provided is written: con = (Driver={SQL Server};, Server=whatever, etc... I am not at work so I dont have the server to run this code against, but it looks like you are doing what I've been trying to accomplish :]

Re: [Tutor] pymssql or ODBC

2006-09-15 Thread Luke Paireepinart
Chris Hengge wrote: looking at your link, is your con wrong? for example... the one on the link you provided is written: con = (Driver={SQL Server};, Server=whatever, etc... It looks to me like these are all separate commands (I.E. They're separated by a semicolon) So the way you showed

[Tutor] UnicodeEncodeError

2006-09-15 Thread emilia12
Hi list, i am using site-package (webPy) that generates UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128). The full message is: Traceback (most recent call last): File c:\python24\lib\site-packages\web.py, line 1786, in run_wsgi_app result

Re: [Tutor] pymssql or ODBC

2006-09-15 Thread Tim Golden
[Chris Hengge] | Does anyone know how to make pymssql use windows authentication? I'm fairly sure, from previous experience and a brief perusal of the source, that pymssql doesn't offer the possibility of pass-through authentication. When I use it, I have to ask my DBA to set up a specific user.

Re: [Tutor] pymssql or ODBC

2006-09-15 Thread Tim Golden
| Does anyone know how to make pymssql use windows authentication? | | Also, can anyone point me to a simple ODBC guide for SQL? OK, bit of a summary. If it's not answering your questions, hopefully it'll answer someone else's! 1) mxODBC [http://www.egenix.com/files/python/mxODBC.html] NB:

Re: [Tutor] How do I open my browser from within a Python program

2006-09-15 Thread Simon Brunning
On 9/15/06, Will Shattuck [EMAIL PROTECTED] wrote: On 9/14/06, Simon Brunning [EMAIL PROTECTED] wrote: To open a web browser from within a python program, you want something like: import webbrowser webbrowser.open('www.google.com') I learned something tonight :) I only have 5 or 10

Re: [Tutor] UnicodeEncodeError

2006-09-15 Thread Kent Johnson
[EMAIL PROTECTED] wrote: Hi list, i am using site-package (webPy) that generates UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128). It looks like your data contains unicode strings. When you call str() on a unicode string it tries to

Re: [Tutor] pymssql or ODBC

2006-09-15 Thread János Juhász
I am using the next two solution for connecting to our mssql server when the odbc connection is set for all the PCs, I use this: import dbi, odbc cn = odbc.odbc('DSN=scalaDB;UID=query;PWD=query;DATABASE=DB') When there is no connection set and distributed, I usually choose this import

Re: [Tutor] Problems serving up PDF

2006-09-15 Thread Python
On Thu, 2006-09-14 at 18:01 -0800, Tim Johnson wrote: * Luke Paireepinart [EMAIL PROTECTED] [060914 17:37]: Sounds like it's working to me. On Internet Explorer 6, Windows XP, the user experience is different. IE ignores the file name, and does no progress reporting, but does

Re: [Tutor] quick ?

2006-09-15 Thread Johan Geldenhuys
I would make list of all the numbers in the beginning and then just add numbers in a range to the list. It's much easier to test for something in a list than to compare each number with the previous one. Here is a example: import random def randnum(): c = [] l = len(c) # Numbers in

[Tutor] Trying to catch an exception...

2006-09-15 Thread William O'Higgins Witteman
I am running a program (via py2exe) that is reading some XML files with xml.minidom. I am getting an error wherein I pull a value from a tag which (I think) happens to be empty. Thus, it throws this error: AttributeError: 'NoneType' object has no attribute 'data' Here's the code that creates

Re: [Tutor] tuples versus lists

2006-09-15 Thread Dave Kuhlman
On Thu, Sep 14, 2006 at 11:14:20PM -0700, Bob Gailer wrote: John Fouhy wrote: Generally, you should use a tuple when you have different things that you want to clump together to make one data structure. Whereas you should use a list when you have multiple things that are the same, that

Re: [Tutor] Trying to catch an exception...

2006-09-15 Thread Alan Gauld
William O'Higgins Witteman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am running a program (via py2exe) that is reading some XML files with xml.minidom. I am getting an error wherein I pull a value from a tag which (I think) happens to be empty. Thus, it throws this error:

Re: [Tutor] Trying to catch an exception...

2006-09-15 Thread Kent Johnson
William O'Higgins Witteman wrote: I am running a program (via py2exe) that is reading some XML files with xml.minidom. I am getting an error wherein I pull a value from a tag which (I think) happens to be empty. Thus, it throws this error: AttributeError: 'NoneType' object has no attribute