Re: [Tutor] smtp error

2005-09-06 Thread Danny Yoo
On Tue, 6 Sep 2005, Shitiz Bansal wrote: > does this error make sense to anyone? > > Traceback (most recent call last): > File "C:/Documents and > Settings/Administrator/Desktop/lkp.py", line 46, in > -toplevel- > s.sendmail(msg['From'], i, msg.as_string()) > File "C:\Python24\lib\smtpli

[Tutor] Literal string concatenation (Was: Re: Combining dictionaries)

2005-09-06 Thread Danny Yoo
On Tue, 6 Sep 2005, bob wrote: > At 04:14 PM 9/6/2005, Mike Cheponis wrote: > >On Tue, 6 Sep 2005, Danny Yoo wrote:[snip] > > > >How can I actively help fix these Python bugs? > > I am concerned when you use the term "bugs". The behaviors you describe > are part of the design of Python, and they

Re: [Tutor] Combining dictionaries

2005-09-06 Thread bob
At 04:14 PM 9/6/2005, Mike Cheponis wrote: >On Tue, 6 Sep 2005, Danny Yoo wrote:[snip] > >How can I actively help fix these Python bugs? I am concerned when you use the term "bugs". The behaviors you describe are part of the design of Python, and they work as designed. To me a bug is a failure o

Re: [Tutor] how to create a generic instance of an object?

2005-09-06 Thread Kent Johnson
John Burk wrote: > I've got a base class "Asset", and currently have about 20 sub-classes > (assetTypes) that will inherit from it, with more to follow, I'm sure. > All of the assetTypes will have the same methods, but they'll be > polymorphic; each assetType's methodA() will do something slightly

[Tutor] smtp error

2005-09-06 Thread Shitiz Bansal
does this error make sense to anyone? Traceback (most recent call last): File "C:/Documents and Settings/Administrator/Desktop/lkp.py", line 46, in -toplevel- s.sendmail(msg['From'], i, msg.as_string()) File "C:\Python24\lib\smtplib.py", line 692, in sendmail raise SMTPDataError(code,

Re: [Tutor] CREATING A PR.EXE FROM A PR.PY

2005-09-06 Thread Dax Reyes
Hello Jack, Do you still need help regarding exe creation? In case you do. Here are some notes I took way back in 2003. you must create a setup.py put something like from distutils.core import setup import py2exe sbiGui = ['samplemodule', 'samplemodule.checkstatus','samplemodule.client'] sbiModu

Re: [Tutor] how to create a generic instance of an object?

2005-09-06 Thread Danny Yoo
> Perhaps I'm taking the wrong approach here with the Asset/AssetType > base-class/sub-class organization; it's beginning to feel that way. > > I've tried something like this: > > > class Asset: pass > > > class Foo(Asset): pass > > > from asset import Asset > from foo import Foo > > klass = '

[Tutor] how to create a generic instance of an object?

2005-09-06 Thread John Fouhy
On 07/09/05, John Burk <[EMAIL PROTECTED]> wrote: > What I want to do is to pass in the assetType at runTime via an external > script, create a new instance of it, and then run that instance's > methods. That way I won't have to have 20 or more " if assetType== " > if/elif statements, and maintain

[Tutor] how to create a generic instance of an object?

2005-09-06 Thread John Burk
I've got a base class "Asset", and currently have about 20 sub-classes (assetTypes) that will inherit from it, with more to follow, I'm sure. All of the assetTypes will have the same methods, but they'll be polymorphic; each assetType's methodA() will do something slightly different from it's sibli

Re: [Tutor] Combining dictionaries

2005-09-06 Thread Danny Yoo
> >> He wants c = a + b to work when a and b are dictionaries. > >> > >> Why is Python broken in such an obvious way? > > > It might not be obvious. If a and b overlap so that they share keys, > > then we might have the following situation: > > I did consider that, but of course, "update" has to

Re: [Tutor] Combining dictionaries

2005-09-06 Thread Mike Cheponis
On Tue, 6 Sep 2005, Danny Yoo wrote: >> No, that's not what he wants. >> >> He wants c = a + b to work when a and b are dictionaries. >> >> Why is Python broken in such an obvious way? > It might not be obvious. If a and b overlap so that they share keys, then > we might have the following situ

Re: [Tutor] Combining dictionaries

2005-09-06 Thread Danny Yoo
> No, that's not what he wants. > > He wants c = a + b to work when a and b are dictionaries. > > Why is Python broken in such an obvious way? Hi Mike: It might not be obvious. If a and b overlap so that they share keys, then we might have the following situation: c1 = a + b c2 = b + a

Re: [Tutor] General Information Request

2005-09-06 Thread Danny Yoo
On Tue, 6 Sep 2005, Lane, Frank L wrote: > I found a really neat technique on the web using a built in called > "apply", with it you can do struct.pack() using an array for the values. > I can't find the technique in the release documentation and what's there > says apply is deprecated, use the

[Tutor] win32 properties tab

2005-09-06 Thread Eric Walker
Is there a way to pull the info listed on the properties tab , say of an image file from windows with python.. All the meta data...ie Title, Subject, Keywords, Comments, Author Any Ideas? -- Eric Walker EDA/CAD Engineer Work: 208-368-2573 ___ Tutor ma

[Tutor] Combining dictionaries

2005-09-06 Thread Mike Cheponis
>Is this what you want ? > >c = dict(a) >c.update(b) > >Pierre >> Is there an easy way to combine dictionaries? >> >> a = {} >> b = {} >> >> a = {'a':'a', 'b':'b', 'c':'c'} >> b = {'1':1, '2':2, '3':3} >> c = a + b # doesn't seem to work >> >> desired: >> c = {'a':'a', 'b':'b', 'c':'c', '1':1,

[Tutor] General Information Request

2005-09-06 Thread Lane, Frank L
Title: Message Hi List,   I wanted to write to ask about help reading the Python documentation.   I found a really neat technique on the web using a built in called "apply", with it you can do struct.pack() using an array for the values.  I can't find the technique in the release documentat

Re: [Tutor] threading problem in GUI

2005-09-06 Thread nephish
Pierre Barbier de Reuille wrote: >nephish a écrit : > > >>Pierre Barbier de Reuille wrote: >> >>[...] >>ok, i am still having a little problem understanding. >>tried it but i don't know if i have things set in the right order. >> >> >>gtk.gdk.threads_init() >># Here initialize what you want >>[.

Re: [Tutor] threading problem in GUI

2005-09-06 Thread Pierre Barbier de Reuille
nephish a écrit : > Pierre Barbier de Reuille wrote: > > [...] > ok, i am still having a little problem understanding. > tried it but i don't know if i have things set in the right order. > > > gtk.gdk.threads_init() > # Here initialize what you want > [...] > # Launch the Gtk loop > gtk.gdk.t

Re: [Tutor] threading problem in GUI

2005-09-06 Thread nephish
Pierre Barbier de Reuille wrote: >nephish a écrit : > > >>Hello there ! >> >> > >Hello, > > > >>i am having a problem with threading. >>OK, i have this GUI app that i am building with pygtk. >>there is a process (four actually, just working on getting one right now) >>that needs to run in

Re: [Tutor] threading problem in GUI

2005-09-06 Thread Pierre Barbier de Reuille
nephish a écrit : > Hello there ! Hello, > i am having a problem with threading. > OK, i have this GUI app that i am building with pygtk. > there is a process (four actually, just working on getting one right now) > that needs to run in the background. Please, do not mix "process" and "threads"

[Tutor] threading problem in GUI

2005-09-06 Thread nephish
Hello there ! i am having a problem with threading. OK, i have this GUI app that i am building with pygtk. there is a process (four actually, just working on getting one right now) that needs to run in the background. there is a button that starts the background function. But, it locks up the gui.

Re: [Tutor] Is there an easy way to combine dictionaries?

2005-09-06 Thread Byron
Lane, Frank L wrote: > Is there an easy way to combine dictionaries? Hi Frank, Yes, there is -- please see the "addDict" method that I have provided below: Byron --- def addDicts(a, b): c = {} for item in a: c[item] = a[item] for item in b:

Re: [Tutor] Is there an easy way to combine dictionaries?

2005-09-06 Thread Pierre Barbier de Reuille
Is this what you want ? c = dict(a) c.update(b) Pierre Lane, Frank L a écrit : > Hi List, > > Is there an easy way to combine dictionaries? > > e.g. > > a = {} > b = {} > > a = {'a':'a', 'b':'b', 'c':'c'} > b = {'1':1, '2':2, '3':3} > c = a + b # doesn't seem to work > > desired: > c =

[Tutor] Is there an easy way to combine dictionaries?

2005-09-06 Thread Lane, Frank L
Title: Message Hi List,   Is there an easy way to combine dictionaries?   e.g.   a = {} b = {}   a = {'a':'a', 'b':'b', 'c':'c'} b = {'1':1, '2':2, '3':3} c = a + b # doesn't seem to work   desired: c = {'a':'a', 'b':'b', 'c':'c', '1':1, '2':2, '3':3}   Thanks, Frank ___

Re: [Tutor] Game Engine HowTos?

2005-09-06 Thread Kent Johnson
Googling "python game engine" gives some interesting hits including existing game engines that might be useful examples and some low-level toolkits you might want to use. Or you might want to join efforts with one of the open-source engines and work on that. Kent Joseph Quigley wrote: > Are th

[Tutor] dialog boxes

2005-09-06 Thread Victor Reijs
Hello all of you, I want to use yes/no-, text-, info-, checklist- dialog boxes in my image manipulation program (on a Windows XP Pro system using python 2.2 and 2.3). What is the best way to do this? Thanks for your feedback. All the best, Victor