ANN: Chicago Python Users Group, Thurs March 9

2006-03-08 Thread Brian Ray
Come to this months Chicago Python User Group Meeting and find out what happens when you cross a Chipmunk with a Python. This is sure to be our best meeting yet. Confirm your attendance: mtobis aat gmail doot com with ChiPy March in your subject line. On Topics - Someone will fake a

Re: asynchat - operation could not complete w/ blocking

2006-03-08 Thread Andreas R.
Fredrik Lundh wrote: Andreas R. wrote: I'm using Python's asynchat module for networking. When calling the sendall() method of asynchat, I sometimes get the error message the operation could not complete without blocking. what sendall method ? to get proper output buffering with

Re: Reading binary from a file...

2006-03-08 Thread Laurent Pointal
Steve Holden a écrit : KraftDiner wrote: Hi! In python I'm able to read in binary data from a file. data = file.read() # Reads in an entire file. Note that you should open the file in binary mode to be platform-agnostic and as portable as possible. (Just in case you aren't). However the

Re: asynchat - operation could not complete w/ blocking

2006-03-08 Thread Erik Max Francis
Andreas R. wrote: The problem I was having with push, is that is does not always send complete packages. The solution to this was to use sendall() instead, but sendall() gives blocking error messages. The purpose of asynchat's push methods is to queue outgoing data and send it when

Re: sending a text message via webpage button

2006-03-08 Thread Ravi Teja
http://wwwsearch.sourceforge.net/ClientForm/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic Python FTP Question

2006-03-08 Thread Ravi Teja
Have you seen Python's ftplib? http://effbot.org/librarybook/ftplib.htm http://docs.python.org/lib/module-ftplib.html -- http://mail.python.org/mailman/listinfo/python-list

cgi problem

2006-03-08 Thread Paul Rubin
I'm trying to write a simple cgi that reads a post from the user's browser, does some stuff with the form data, and redirects the browser back to the originating url, i.e. I want the cgi to send a 302 redirect. There's no obvious way in the cgi module to set the response code to anything but 200.

Re: Send email notification

2006-03-08 Thread Laurent Pointal
Ernesto a écrit : Is there a special module for mail ? I'd like to send an email [to 'n' unique email addresses] from a python script. If you want all adressee to be the only one visible in to: field, you must send n emails. For such a purpose, see iMailer module here:

Re: asynchat - operation could not complete w/ blocking

2006-03-08 Thread Andreas R.
Dennis Lee Bieber wrote: On Wed, 08 Mar 2006 08:57:53 +0100, Andreas R. [EMAIL PROTECTED] declaimed the following in comp.lang.python: The problem I was having with push, is that is does not always send complete packages. The solution to this was to use sendall() instead, but sendall()

class variables for subclasses tuple

2006-03-08 Thread alainpoint
Hello, I have got a problem that i can't readily solve. I want the following: I want to create a supertuple that behaves both as a tuple and as a class. It should do the following: Point=superTuple(x,y,z) # this is a class factory p=Point(4,7,9) assert p.x==p[0] assert p.y==p[1] assert p.z==p[2]

Re: New python.org website

2006-03-08 Thread Max M
projecktzero wrote: I think the new site is great. I really don't understand all the nit picking that's going on from the armchair web designers. It's a nice site. It is not ugly, and its easy to navigate. *much* better than the old site, -- hilsen/regards Max M, Denmark

Re: class variables for subclasses tuple

2006-03-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: Point.x=0 leads to having p.x==0 It seems not possible to have class variables and instance variable having the same name and yet different values. A quick check: class T(tuple): ... class __metaclass__(type): ... x = property(lambda cls: 0) ...

Re: New python.org website

2006-03-08 Thread Max M
Comparing: http://www.python.org/ http://www.perl.org/ http://www.java.org/ http://www.ruby-lang.org/en/ http://java.sun.com/ http://www.php.net/ It is pretty easy to see that http://www.python.org/ is both prettier than the rest, and has a far better structure. -- hilsen/regards Max M,

Simple questions on use of objects (probably faq)

2006-03-08 Thread Brian Elmegaard
Hi, I am struggling to understand how to really appreciate object orientation. I guess these are FAQ's but I have not been able to find the answers. Maybe my problem is that my style and understanding are influenced by matlab and fortran. I tried with the simple example below and ran into

Re: class variables for subclasses tuple

2006-03-08 Thread alainpoint
Peter Otten wrote: [EMAIL PROTECTED] wrote: Point.x=0 leads to having p.x==0 It seems not possible to have class variables and instance variable having the same name and yet different values. A quick check: class T(tuple): ... class __metaclass__(type): ... x =

Re: class variables for subclasses tuple

2006-03-08 Thread alainpoint
As an supplement to my previous post, please find hereunder a snippet for my unsuccessful attempt (commented out snippet does not work): def superTuple(*attribute_names): nargs = len(attribute_names) class T(tuple): def __new__(cls, *args):

Re: Learning different languages

2006-03-08 Thread Chris Smith
Rich == Rich [EMAIL PROTECTED] writes: Rich Hi, Rich (this is a probably a bit OT here, but comp.lang seems Rich rather desolated, so I'm not sure I would get an answer Rich there. And right now I'm in the middle of learning Python Rich anyway so...) Rich Anyway, my

Re: linux clipboard?

2006-03-08 Thread Chris Smith
Rene == Rene Pijlman [EMAIL PROTECTED] writes: Rene [EMAIL PROTECTED]: how can i copy text to the linux clipboard? Rene Linux is an operating system. It doesn't have a Rene clipboard. The clipboard is provided by desktop frameworks, Rene such as KDE or Gnome. Rene --

Re: class variables for subclasses tuple

2006-03-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: Peter Otten wrote: [EMAIL PROTECTED] wrote: Point.x=0 leads to having p.x==0 It seems not possible to have class variables and instance variable having the same name and yet different values. A quick check: class T(tuple): ... class

RAD tutorials and tools for GUI development with Python?

2006-03-08 Thread Arthur Pemberton
Hey guys, I would really like to code a few more widely useable apps, but coding the GUI just seems so boring and unnecessarily complex. Maybe I was spoilt by Borland's Delphi/Kylix. But is there any way to do as little coding of the GUI as possible, and worry about the logic? The best I've seen

Re: generators shared among threads

2006-03-08 Thread Kent Johnson
Paul Rubin wrote: Hmm (untested, like above): class Synchronized: def __init__(self, generator): self.gen = generator self.lock = threading.Lock() def next(self): self.lock.acquire() try: yield self.gen.next()

mail.python.org disruption

2006-03-08 Thread Thomas Wouters
[ Mailed to python-dev and python-list, as that should cover most of the users ;P ]There was a slight disruption on mail.python.org this morning. For about three and a half hours, it was rejecting most of its mail with the message: Client host [] blocked using singlehop.dsbl.org; Your mail has

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Matt Hammond
Hi, 3: Why canøt I say and get the maximum of instance attributes and a list of them? y_max=max(y[].x) and ys=[y[].x] y_max = max([e.x for e in y]) See List comprehensions in python docs: http://docs.python.org/tut/node7.html#SECTION00714 4: Can I avoid the dummy counter i

Re: cgi problem

2006-03-08 Thread Kent Johnson
Paul Rubin wrote: I'm trying to write a simple cgi that reads a post from the user's browser, does some stuff with the form data, and redirects the browser back to the originating url, i.e. I want the cgi to send a 302 redirect. There's no obvious way in the cgi module to set the response

Re: Any advantage in LISPs having simpler grammars than Python?

2006-03-08 Thread Simo Melenius
Grant Edwards [EMAIL PROTECTED] writes: Yes. Grammars like LISP's make it easy for programs to generate and read code. Grammars like Python's make it easy for humans to generate and read code. The above statement sounds too generalized to me. IMHO it's more of a matter of preference, your

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Steven D'Aprano
On Wed, 08 Mar 2006 11:04:41 +0100, Brian Elmegaard wrote: Hi, I am struggling to understand how to really appreciate object orientation. I guess these are FAQ's but I have not been able to find the answers. Maybe my problem is that my style and understanding are influenced by matlab and

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Steven D'Aprano
On Wed, 08 Mar 2006 11:00:09 +, Matt Hammond wrote: 4: Can I avoid the dummy counter i in the for loop and do something like: yz=[y[:-1].x-y[1:].x] yz = [e.x for e in y] yz.reverse() I don't think that's what the O.P. actually wants. He seems to have misused slicing syntax as some

[exec cmd for cmd in cmds]

2006-03-08 Thread Schüle Daniel
Hello all, p = z%i = complex(1-1e-%i, 1-1e-%i) lst = [p % (i,i,i) for i in range(10, 30)] for item in lst: ... exec item ... p = z%i = complex(1-1e-%i, 1-1e-%i) lst = [p % (i,i,i) for i in range(10, 30)] [exec item for item in lst] File stdin, line 1 [exec item for item

Re: [exec cmd for cmd in cmds]

2006-03-08 Thread Diez B. Roggisch
Schüle Daniel wrote: Hello all, p = z%i = complex(1-1e-%i, 1-1e-%i) lst = [p % (i,i,i) for i in range(10, 30)] for item in lst: ... exec item ... p = z%i = complex(1-1e-%i, 1-1e-%i) lst = [p % (i,i,i) for i in range(10, 30)] [exec item for item in lst] File

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Brian Elmegaard
Matt Hammond [EMAIL PROTECTED] writes: See List comprehensions in python docs: Great, thanks for the hint. -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html http://www.rugbyklubben-speed.dk -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Matt Hammond
On Wed, 08 Mar 2006 11:29:29 -, Steven D'Aprano [EMAIL PROTECTED] wrote: On Wed, 08 Mar 2006 11:00:09 +, Matt Hammond wrote: 4: Can I avoid the dummy counter i in the for loop and do something like: yz=[y[:-1].x-y[1:].x] yz = [e.x for e in y] yz.reverse() I don't think that's

Re: generators shared among threads

2006-03-08 Thread Just
In article [EMAIL PROTECTED], Kent Johnson [EMAIL PROTECTED] wrote: Paul Rubin wrote: Hmm (untested, like above): class Synchronized: def __init__(self, generator): self.gen = generator self.lock = threading.Lock() def next(self):

Re: generators shared among threads

2006-03-08 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: Now, x=ReentrantIterator(itertools.count()) should have all the properties we want, I think. The locking is thanks of Queue.Queue and its sweet implementation of the Template Method design pattern. That is very cool, and generally useful enough that

Re: [exec cmd for cmd in cmds]

2006-03-08 Thread Schüle Daniel
[...] If you think so :) Ususally people go for dictionaries in such cases. you are right, I didn't think about dictionaries p = complex(1-1e-%i, 1-1e-%i) d={} [d.update({i:eval(p % (i,i))}) for i in range(20,30)] [None, None, None, None, None, None, None, None, None, None] so now the

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Max M
Brian Elmegaard wrote: Hi, I am struggling to understand how to really appreciate object orientation. I guess these are FAQ's but I have not been able to find the answers. Maybe my problem is that my style and understanding are influenced by matlab and fortran. What I hoped I could do:

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Max M
Brian Elmegaard wrote: Matt Hammond [EMAIL PROTECTED] writes: y_max = max([e.x for e in y]) Would there be a way to refer back to the e with maximum x, or how could I find other attributes of it? In that case a common idiom is to decorate decorated = [(obj.x, obj) for obj in

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Brian Elmegaard
Steven D'Aprano [EMAIL PROTECTED] writes: Thanks for the answers. They are very useful. self.args = (x, y, z) # save a copy of the arguments As always python makes it easy. max(obj.lister()) 4 Actually I wanted to get the maximum of attributes of several instances. List

Re: asynchat - operation could not complete w/ blocking

2006-03-08 Thread Fredrik Lundh
(possible duplicate; reposted due to mail server problems) Andreas R. `wrote: what sendall method ? to get proper output buffering with asynchat, use Search for sendall here: http://svn.gna.org/viewcvs/openrts/trunk/openrts/client/networksend.py?rev=67view=markup That's what I was told to

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Brian Elmegaard
Matt Hammond [EMAIL PROTECTED] writes: Hmmm, rereading, I think you're right ... and I think I'm confused too :-) You both are. Attempt #2: yz = [ (y1.x - y2.x) for (y1,y2) in zip(y[:-1], y[1:]) ] Frankly, a for loop with an index would probably be easier to read :) Me too, would

wxPython GenericDirCtrl events

2006-03-08 Thread Iain King
I can't get these to work, and I can't work out what I'm doing wrong. I added the following lines to the GenericDirCtrl.py demo in the wxython demos folder: at the end TestPanel.__init__ I added: self.Bind(wx.EVT_TREE_SEL_CHANGED, self.test, dir1) and also added a test def to the class: def

Re: asynchat - operation could not complete w/ blocking

2006-03-08 Thread Fredrik Lundh
Andreas R. wrote: I'm using Python's asynchat module for networking. When calling the sendall() method of asynchat, I sometimes get the error message the operation could not complete without blocking. what sendall method ? to get proper output buffering with asynchat, use push (or

Re: Learning different languages

2006-03-08 Thread Bo Yang
Rich said : Hi, (this is a probably a bit OT here, but comp.lang seems rather desolated, so I'm not sure I would get an answer there. And right now I'm in the middle of learning Python anyway so...) Anyway, my question is: what experience you people have with working with different

wxPython cross platform taskbar

2006-03-08 Thread dirvine
Hi All Does anyone have any peice of wxPython code thats cross platform and allows an app to be minimised in the system tray. I am hoping for windows/kde/gnome/darwin if possible. I have been playing about and have a couple of systems that nearly get there but not quite. I would llike to create

Re: wxPython GenericDirCtrl events

2006-03-08 Thread Franz Steinhaeusler
On 8 Mar 2006 04:25:38 -0800, Iain King [EMAIL PROTECTED] wrote: at the end TestPanel.__init__ I added: self.Bind(wx.EVT_TREE_SEL_CHANGED, self.test, dir1) {...] Try this instead: t = dir1.GetTreeCtrl() t.Bind(wx.EVT_TREE_SEL_CHANGED, self.test) -- Franz Steinhaeusler --

Re: New python.org website

2006-03-08 Thread Fredrik Lundh
Kay Schluehr wrote: The new website is to blah. It's so light colored across the whole thing that it kind of just melts away in my mind. Maybe giving a little color in the menu bar on the right would help. My experience is that white is a bad background color when over used. I agree. The

Re: os.execve(pth,args,env) and os.chroot(pth) = problems

2006-03-08 Thread [EMAIL PROTECTED]
Thanks for the reply Donn, It seems logical enough to me that finding #!/usr/bin/env python in the script file with the chroot I have used, is the problem. Once again thank you for the help. Regards, Gavin -- http://mail.python.org/mailman/listinfo/python-list

Re: New python.org website

2006-03-08 Thread Roy Smith
The first two links on the News and Announcements are dead -- they get you a 404 File Not Found. I've opened a critical ticket on this in the bug tracker. I see there's another ticket open already on a similar issue. My recommendation would be that if these can't be resolved in very short

Re: asynchat - operation could not complete w/ blocking

2006-03-08 Thread Fredrik Lundh
Andreas R. wrote: sendall may be sending everything, but it does so by blocking until the other end acknowledges enough packets have been received to ensure that no data is lost. Yes, this is how I understood sendall. But why does it sometimes report the error: (10035, 'The socket

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread bruno at modulix
Brian Elmegaard wrote: Hi, I am struggling to understand how to really appreciate object orientation. I guess these are FAQ's but I have not been able to find the answers. Maybe my problem is that my style and understanding are influenced by matlab and fortran. I tried with the simple

Re: wxPython GenericDirCtrl events

2006-03-08 Thread Iain King
Franz Steinhaeusler wrote: On 8 Mar 2006 04:25:38 -0800, Iain King [EMAIL PROTECTED] wrote: at the end TestPanel.__init__ I added: self.Bind(wx.EVT_TREE_SEL_CHANGED, self.test, dir1) {...] Try this instead: t = dir1.GetTreeCtrl() t.Bind(wx.EVT_TREE_SEL_CHANGED, self.test) --

Re: class variables for subclasses tuple

2006-03-08 Thread alainpoint
Thank you Peter, this does the job. In passing, I have another question: where can I read up more on metaclasses? Alain -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning different languages

2006-03-08 Thread Magnus Lycka
Rich wrote: Anyway, my question is: what experience you people have with working with different languages at the same time? I typically use Python, C++ and SQL. When there's been lots of Python and little C++, I tend to forget to terminate C++ statements with semicolon... Otherwise I seem to

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Brian Elmegaard
Matt Hammond [EMAIL PROTECTED] writes: y_max = max([e.x for e in y]) Would there be a way to refer back to the e with maximum x, or how could I find other attributes of it? -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html http://www.rugbyklubben-speed.dk --

PyCon2006 - will the content be available for download?

2006-03-08 Thread abcd
Anyone know if (and when) the talks from PyCon2006 will be available for download. I am particularly interested in the tutorials (as they did not have them at PyCono2005). Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyCon2006 - will the content be available for download?

2006-03-08 Thread Max M
abcd wrote: Anyone know if (and when) the talks from PyCon2006 will be available for download. I am particularly interested in the tutorials (as they did not have them at PyCono2005). Thanks. http://www.python.org/community/pycon/ leads to

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Brian Elmegaard
bruno at modulix [EMAIL PROTECTED] writes: Now how you could do it the OO way (QD, not really tested): Something goes wrong in my 2.3 when I change the syntax to _add_instance=classmethod(_add_instance). If I understand this correctly the class is keeping track of the instances of itself. The

Re: class variables for subclasses tuple

2006-03-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: In passing, I have another question: where can I read up more on metaclasses? Well, in Python in a Nutshell Alex Martelli manages to pack the practical information that lets you work with metaclasses into just four pages, including a two-page example. You may have seen

Re: New python.org website

2006-03-08 Thread Tim Parkin
Roy Smith wrote: The first two links on the News and Announcements are dead -- they get you a 404 File Not Found. I've opened a critical ticket on this in the bug tracker. I see there's another ticket open already on a similar issue. My recommendation would be that if these can't be resolved

Re: RAD tutorials and tools for GUI development with Python?

2006-03-08 Thread Peter Decker
On 3/8/06, Arthur Pemberton [EMAIL PROTECTED] wrote: Hey guys, I would really like to code a few more widely useable apps, but coding the GUI just seems so boring and unnecessarily complex. Maybe I was spoilt by Borland's Delphi/Kylix. But is there any way to do as little coding of the GUI

Re: ODBC module and strange date reference ...

2006-03-08 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: I'm all for using for the latest version of Python. I'm just now learning about Python classes, and it seems like there were some significant changes at 2.2. I don't remember exactly what appeared when, but nothing you learn with 2.1 will stop working in 2.2 (I

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread msoulier
It's actually something that has been being considered for Python 3.0 for a long time. I will never understand why we can't just leave a good language alone, and instead keep trying to make it everything for all people. If I want strong typing, I'll use Java or C++. And don't tell me to just

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread msoulier
It's also important to note that while Guido did spend a lot of time thinking about optional type markups (and this caused a LOT of hand wringing in the Python community, the general consensus in the end was that there was no real benefit from it. (I got the impression that a lot of the push

recycling internationalized garbage

2006-03-08 Thread aaronwmail-usenet
Hi folks, Please help me with international string issues: I put together an AJAX discography search engine http://www.xfeedme.com/discs/discography.html using data from the FreeDB music database http://www.freedb.org/ Unfortunately FreeDB has a lot of junk in it, including randomly mixed

Having to print before method invocation?

2006-03-08 Thread Jeremy L. Moles
I have an object (written as part C extension, part pure Python) called foo that I've been using without much fuss for a few months now. However, in my latest project (a rather large one involving multi-threading, pygtk, etc.), I'm seeing some really strange behavior with a particular instance of

Re: New python.org website

2006-03-08 Thread Ted
Hear hear! I like it. It's not perfect but is much better than the old one in all ways. A huge improvement. Thanks to the website team. -- http://mail.python.org/mailman/listinfo/python-list

Re: recycling internationalized garbage

2006-03-08 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Question: what is a good strategy for taking an 8bit string of unknown encoding and recovering the largest amount of reasonable information from it (translated to utf8 if needed)? The string might be in any of the myriad encodings that predate unicode. Has anyone

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread Tom Bradford
Really what we're talking about here is weak typing in the form of optional type hinting performed on a function by function basis. As an option, what it would do is allow an author to semantically 'hint' to the interpreter that a function is expecting a certain type, and perform any implicit

Re: linux clipboard?

2006-03-08 Thread Grant Edwards
On 2006-03-08, Chris Smith [EMAIL PROTECTED] wrote: how can i copy text to the linux clipboard? Rene Linux is an operating system. It doesn't have a Rene clipboard. The clipboard is provided by desktop frameworks, Rene such as KDE or Gnome. Rene -- René Pijlman Actually, Linux is

Re: Send email notification

2006-03-08 Thread Grant Edwards
On 2006-03-08, Steve Holden [EMAIL PROTECTED] wrote: Hang around here long and you'll see a bunch of people waiting on replies to questions Google could have given them far quicker. If we weren't paid thousands of dollars a week to answer questions on this list we'd probably get snarky more

Re: Basic Python FTP Question

2006-03-08 Thread Bob Piton
On Wed, 08 Mar 2006 00:09:34 -0800, Ravi Teja wrote: Have you seen Python's ftplib? http://effbot.org/librarybook/ftplib.htm http://docs.python.org/lib/module-ftplib.html No I hadn't. Thanks for the references; it looks like that method will do anything I need to do with ftp. --

Re: Pyserial again

2006-03-08 Thread Grant Edwards
On 2006-03-08, luca72 [EMAIL PROTECTED] wrote: Belive me for a person of my age and my background ( i'm a physics, but at my time no computer was allowed) all that for you is simple, Believe me, it wasn't simple for us. We had to guess what you were doing wrong since you wouldn't show us

Re: Having to print before method invocation?

2006-03-08 Thread Fredrik Lundh
Jeremy L. Moles wrote: I have an object (written as part C extension, part pure Python) called foo that I've been using without much fuss for a few months now. However, in my latest project (a rather large one involving multi-threading, pygtk, etc.), I'm seeing some really strange behavior

Re: New python.org website

2006-03-08 Thread Thomas G. Willis
I don't necessarily like it, but I think the true test is whether a pointy haired manager type can be convinced that python can be taken seriously as a welcome addition to the programming arsenal. I think the site re-design will aid in that area more so than the previous one. I'm not feeling the

Re: Having to print before method invocation?

2006-03-08 Thread Jeremy L. Moles
Hey Fredrik, thanks for responding. :) Your posts are always helpful and informative! On Wed, 2006-03-08 at 15:41 +0100, Fredrik Lundh wrote: Jeremy L. Moles wrote: I have an object (written as part C extension, part pure Python) called foo that I've been using without much fuss for a few

Re: New python.org website

2006-03-08 Thread Ant
I like it personally. Nice clean look and feel, and the logo is much better than the old cheesy green python. Has a more professional feel to it, which can be important if you want to use the language outside of your free time... -- http://mail.python.org/mailman/listinfo/python-list

Re: recycling internationalized garbage

2006-03-08 Thread garabik-news-2005-05
Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Question: what is a good strategy for taking an 8bit string of unknown encoding and recovering the largest amount of reasonable information from it (translated to utf8 if needed)? The string might be in any of the myriad

Re: [exec cmd for cmd in cmds]

2006-03-08 Thread Scott David Daniels
Schüle Daniel wrote: you are right, I didn't think about dictionaries p = complex(1-1e-%i, 1-1e-%i) d={} [d.update({i:eval(p % (i,i))}) for i in range(20,30)] [None, None, None, None, None, None, None, None, None, None] so now the work is complete :) Regards Really, isn't this

why no block comments in Python?

2006-03-08 Thread John Salerno
I'm still tyring to figure out what Pythonic means, and I have a feeling the answer to my question may fall into that category. Are block comments somehow unpythonic? -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading binary from a file...

2006-03-08 Thread Bryan Olson
KraftDiner wrote: [...] In python I'm able to read in binary data from a file. [...] However the data is 16bits per sample and python is storing the data in a string. How do I convert that 8bit data into a list of 16 bit integers? On the vast majority of systems, files hold sequences of

Interfacing with the command line

2006-03-08 Thread Byte
I know its possible to acsess Python via the command line, but can I do the opposite and acsess the command line via Python? For example, can I write a script that will enter $ firefox on the command line, opening Firefox for me? Thanks in advance, -- /usr/bin/byte --

Re: why no block comments in Python?

2006-03-08 Thread Fredrik Lundh
John Salerno wrote: I'm still tyring to figure out what Pythonic means, and I have a feeling the answer to my question may fall into that category. Are block comments somehow unpythonic? only in the sense that python don't have them. but they're pretty pointless, if you have a modern editor.

Extending embedded Python: Adding single methods

2006-03-08 Thread Torsten Bronger
Hallöchen! I'd like to script C++ funtions by an embedded Python interpreter. So far, my C++ main() function contains: Py_Initialize(); Py_InitModule(pp3, PythonMethods); PyRun_SimpleString(from pp3 import *); PyRun_AnyFile(stdin, NULL); Py_Finalize(); PythonMethods is the vector of

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread Scott David Daniels
Tom Bradford wrote: Really what we're talking about here is weak typing in the form of optional type hinting performed on a function by function basis Not what most of the world calls weak typing. It is my feeling that this doesn't represent a sea-change in the way Python does things, and

Re: cgi problem

2006-03-08 Thread Thomas Guettler
Am Wed, 08 Mar 2006 00:19:55 -0800 schrieb Paul Rubin: I'm trying to write a simple cgi that reads a post from the user's browser, does some stuff with the form data, and redirects the browser back to the originating url, i.e. I want the cgi to send a 302 redirect. Hi, I have this setup for

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread Jay Parlar
On Mar 8, 2006, at 7:20 AM, Tom Bradford wrote: Really what we're talking about here is weak typing in the form of optional type hinting performed on a function by function basis. As an option, what it would do is allow an author to semantically 'hint' to the interpreter that a function is

Re: PyCon2006 - will the content be available for download?

2006-03-08 Thread abcd
Max M wrote: http://us.pycon.org/AudioVideoRecording/HomePage Thanks, after going to the URL, I clicked talks and got to http://us.pycon.org/talks ...this page lets u pick which talks you want to access. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: New python.org website

2006-03-08 Thread Michael Tobis
No one of the complainers and negativists do claim that they could do it much better. Indeed, I do not have to be able to write a particular program to notice it has bugs. On the other hand, (since I think the design, while not brilliant, is good) fixing the logo is something that can be

Re: Interfacing with the command line

2006-03-08 Thread petrov
http://effbot.org/librarybook/os.htm scroll down about half a page to example 8. is that what you're looking for? PV -- http://mail.python.org/mailman/listinfo/python-list

Re: Interfacing with the command line

2006-03-08 Thread Byte
Exactly what I want. Thanks a mill! -- /usr/bin/byte -- http://mail.python.org/mailman/listinfo/python-list

Re: New python.org website

2006-03-08 Thread Robert Boyd
On 8 Mar 2006 07:47:15 -0800, Michael Tobis [EMAIL PROTECTED] wrote: No one of the complainers and negativists do claim that they could do it much better. Indeed, I do not have to be able to write a particular program to notice it has bugs. On the other hand, (since I think the design,

Testing

2006-03-08 Thread trixie
This is a test -- http://mail.python.org/mailman/listinfo/python-list

help with loops

2006-03-08 Thread Catalina Scott A Contr AFCA/EVEO
Paul, I will check out difflib thanks. Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: New python.org website

2006-03-08 Thread Thomas G. Willis
On 3/8/06, Robert Boyd [EMAIL PROTECTED] wrote: On 8 Mar 2006 07:47:15 -0800, Michael Tobis [EMAIL PROTECTED] wrote: No one of the complainers and negativists do claim that they could do it much better. Indeed, I do not have to be able to write a particular program to notice it has bugs. On

Re: Extending embedded Python: Adding single methods

2006-03-08 Thread Thomas Heller
Torsten Bronger wrote: Hallöchen! I'd like to script C++ funtions by an embedded Python interpreter. So far, my C++ main() function contains: Py_Initialize(); Py_InitModule(pp3, PythonMethods); PyRun_SimpleString(from pp3 import *); PyRun_AnyFile(stdin, NULL); Py_Finalize();

Re: New python.org website

2006-03-08 Thread Fredrik Lundh
Michael Tobis wrote: No one of the complainers and negativists do claim that they could do it much better. Indeed, I do not have to be able to write a particular program to notice it has bugs. just wait until you mention that rottened egg you found yesterday, and all the chickens in

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread Tom Bradford
This type of hinting would only break type ducking in-so-much as a function that leveraged that hinting would be looking specifically for an instance of a particular type, which would be absolutely no different than a developer performing the type check manually and throwing it out if the type

Re: generators shared among threads

2006-03-08 Thread Bryan Olson
[EMAIL PROTECTED] wrote: Paul wrote: def f(): lock = threading.Lock() i = 0 while True: lock.acquire() yield i i += 1 lock.release() but it's easy to make mistakes when implementing things like that (I'm not even totally

Bidirectional communication over unix socket (named pipe)

2006-03-08 Thread J Rice
Hi, I feel like I should apologize in advance because I must be missing something fairly basic and fundamental here. I don't have a book on Python network programming (yet) and I haven't been able to find an answer on the net so far. I am trying to create a pair of programs, one (the client)

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread Diez B. Roggisch
Tom Bradford wrote: This type of hinting would only break type ducking in-so-much as a function that leveraged that hinting would be looking specifically for an instance of a particular type, which would be absolutely no different than a developer performing the type check manually and

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread Jay Parlar
On Mar 8, 2006, at 8:43 AM, Tom Bradford wrote: This type of hinting would only break type ducking in-so-much as a function that leveraged that hinting would be looking specifically for an instance of a particular type, which would be absolutely no different than a developer performing the

  1   2   3   >