Re: [Tutor] how to *really* copy a list

2006-04-27 Thread John Fouhy
On 28/04/06, kevin parks <[EMAIL PROTECTED]> wrote: > In most case you are fine operating on the list in place and altering the > existing list. In some cases you want your code to stop molesting your poor > mutables and really honestly sincerly copy the dang thing. In this case i am > making a fun

Re: [Tutor] how to *really* copy a list

2006-04-27 Thread kevin parks
I know there is an answer to this somewhere. it is prolly the biggest stumbling block to all python n00bs, but it hasn't been an issue for me in a while. Suddenly i am getting bit by it and can't for the life of me keep straight the two way of opperating on lists. In most case you are fine

Re: [Tutor] Unicode Encode Error

2006-04-27 Thread Danny Yoo
>>> You're right, I realised after playing with Tim's example that the >>> problem was that I wasn't calling close() on the codecs file. Adding >>> this after the f.write(html_text) seems to flush the buffer which >>> means that the content now gets written to the file. >> >> Quick note: it may

Re: [Tutor] cycle w/ shuffle

2006-04-27 Thread Hugo González Monteverde
Hi Kevin, kevin parks wrote: > I am trying to write a loop that iterates over a sequence and do > something x number of times. But sometimes i will need more events > (larger number x) than i have have items in the sequence, so if i need > more events that i have stuff in my sequence i would li

Re: [Tutor] SOAP Modules - I need a little direction.

2006-04-27 Thread Kent Johnson
doug shawhan wrote: > The https/XML API is deprecated and will no longer be supported after > the first of June. :-/ What about the "Unified Schema XML API"? It's XML but it's not SOAP; the XML formats look pretty straightforward. They have a lot of fields but the structure is pretty simple. >

Re: [Tutor] SOAP Modules - I need a little direction.

2006-04-27 Thread doug shawhan
... Upon which I completely expose my ignorance of REST. I was completely concentrating on SOAP, since it seemed to have much more activity and had not looked at the REST description. It look like, for eBay's purposes, that to use the older xml-based systems, one must append "schema=1" to the reque

Re: [Tutor] SOAP Modules - I need a little direction.

2006-04-27 Thread doug shawhan
The https/XML API is deprecated and will no longer be supported after the first of June. :-/ The real drag is: the older XML api had *2* very nice python implementations. I was successfull in less than 10 minutes with both of those. It's a shame. I was hoping to avoid the REST method, as I would

Re: [Tutor] SOAP Modules - I need a little direction.

2006-04-27 Thread Kent Johnson
doug shawhan wrote: > The problem is, I am trying to develop a script to upload massive > amounts of stuff onto an ebay store. Unfortunately the folks at ebay > have settled on a couple sorts of soapism as their standard. (They seem > to be very Java and Dot Net happy over there ...) > > I woul

Re: [Tutor] SOAP Modules - I need a little direction.

2006-04-27 Thread doug shawhan
The problem is, I am trying to develop a script to upload massive amounts of stuff onto an ebay store. Unfortunately the folks at ebay have settled on a couple sorts of soapism as their standard. (They seem to be very Java and Dot Net happy over there ...) I would prefer nearly *any* other protoco

Re: [Tutor] Unicode Encode Error

2006-04-27 Thread Kent Johnson
Danny Yoo wrote: >> You're right, I realised after playing with Tim's example that the >> problem was that I wasn't calling close() on the codecs file. Adding >> this after the f.write(html_text) seems to flush the buffer which means >> that the content now gets written to the file. > > Hi Fran

Re: [Tutor] Unicode Encode Error

2006-04-27 Thread Danny Yoo
> You're right, I realised after playing with Tim's example that the > problem was that I wasn't calling close() on the codecs file. Adding > this after the f.write(html_text) seems to flush the buffer which means > that the content now gets written to the file. Hi Frank, Quick note: it may be

Re: [Tutor] Setting a global variable on class initialisation

2006-04-27 Thread Danny Yoo
> I know that overall Global variables are bad idea, however, I have a > situation where on on initialisation of a class, I need to read in two > files and then populate two lists. Hi Max, Could you give more context to this problem? I'm not sure we get it yet. *grin* > The lists need to w

Re: [Tutor] Unicode Encode Error

2006-04-27 Thread Frank Moore
Kent Johnson wrote: >Do you explicitly close the output file? If not, the data may not be >actually written. > > Kent, You're right, I realised after playing with Tim's example that the problem was that I wasn't calling close() on the codecs file. Adding this after the f.write(html_text) seem

Re: [Tutor] Setting a global variable on class initialisation

2006-04-27 Thread Tim Golden
[Max Russell] | I know that overall Global variables are bad idea, however, | I have a situation where on on initialisation of a class, I | need to read in two files and then populate two lists. | The lists need to would appear to need to be outwith the | class I am working with and global. |

Re: [Tutor] Setting a global variable on class initialisation

2006-04-27 Thread Kent Johnson
Max Russell wrote: > Hello- > > I know that overall Global variables are bad idea, however, I have a > situation where on on initialisation of a class, I need to read in two > files and then populate two lists. What do you mean by class initialization? If you want to read the files and popul

[Tutor] Setting a global variable on class initialisation

2006-04-27 Thread Max Russell
Hello-   I know that overall Global variables are  bad idea, however, I have a situation where on on initialisation of a class, I need to read in two files and then populate two lists. The lists need to would appear to need to be outwith the class I am working with and global.   Can anyone

Re: [Tutor] Web-templating systems

2006-04-27 Thread Winfried Tilanus
On 04/26/2006 Kent Johnson wrote: > I think Kid meets your requirements: > http://kid.lesscode.org/ > > Other template systems that seem to be popular these days: > Cheetah > HTMLTemplate > Myghty Thanks for the suggestions (also for those off-line). Kid and cheetah look the most promising. I wil

Re: [Tutor] Unicode Encode Error

2006-04-27 Thread Kent Johnson
Frank Moore wrote: > The later code (where I use codecs) is not giving me an error (I must > have got that error during an intermediate step I performed). > However, it's also not writing anything away. It seems to be silently > failing as html_text definitely has content. Do you explicitly clos

Re: [Tutor] Unicode Encode Error

2006-04-27 Thread Tim Golden
[Frank Moore] | I'm getting the following error when I try and write some HTML with | German text in it. | | UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in | position 1367: ordinal not in range(128) | | I've now read the 'Unicode - How To' by AMKuchling and | changed the

Re: [Tutor] Unicode Encode Error

2006-04-27 Thread Kent Johnson
Frank Moore wrote: > Hi, > > I'm getting the following error when I try and write some HTML with > German text in it. > > UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in > position 1367: ordinal not in range(128) > > This was my code: > > html_text = open(inFile, 'r'

[Tutor] Unicode Encode Error

2006-04-27 Thread Frank Moore
Hi, I'm getting the following error when I try and write some HTML with German text in it. UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 1367: ordinal not in range(128) This was my code: html_text = open(inFile, 'r').read() # ... do some processing on

[Tutor] Python and Oracle

2006-04-27 Thread Linda Kvam
I have Oracle 10g and Python 2.4 on my PC. I just installed cx_Oracle and then entered - import cx_Oracle -in PythonWin and got the following error - >>> import cx_Oracle Traceback (most recent call last): File "", line 1, in ? ImportError: DLL load failed: The specified procedure could not be f

Re: [Tutor] Tutor FAQ

2006-04-27 Thread Alan Gauld
> Py2exe makes an executable of your Python program. For Windows only. > http://sourceforge.net/projects/py2exe/ > I believe Gordon McMillan's installer (now called pyInstaller) also makes Linux (and Irix!) executables so may be worth a link/mention here too. http://pyinstaller.hpcf.upr.edu/cg

Re: [Tutor] Alan Gauld's tut - namespaces

2006-04-27 Thread Kent Johnson
Alan Gauld wrote: > However I'll refrain from saying much more since I do think the > namespaces topic could be significantly improved if only I could > find better words and examples. Hi Alan, Looking at the tutorial, I think it jumps too quickly to more advanced material (multiple modules) bef

Re: [Tutor] Regex across multiple lines

2006-04-27 Thread Ed Singleton
On 26/04/06, Liam Clarke <[EMAIL PROTECTED]> wrote: > Hi Frank, just bear in mind that the pattern: > > patObj = re.compile(".*", re.DOTALL) > > will match > > >This is my title > > > But, it'll also match > > >This is my title > > Some content here > > Another title; not going to