Re: merge two png pic

2009-07-30 Thread Peter Otten
cocobear wrote: > On Jul 29, 9:20 am, cocobear wrote: >> Thistwopngfile has their own palette >> >> >>> im1.mode >> 'P' >> >>> im.mode >> 'P' >> >>> im.getpalette == im1.getpalette >> >> False >> >> I can use this code tomergetwopngpictogether: >> >> Map = Image.new("RGB", (x,y)) >> Map.paste(im,

Re: merge two png pic

2009-07-30 Thread Terry Reedy
cocobear wrote: On Jul 29, 9:20 am, cocobear wrote: Thistwopngfile has their own palette im1.mode 'P' im.mode 'P' im.getpalette == im1.getpalette False I can use this code tomergetwopngpictogether: Map = Image.new("RGB", (x,y)) Map.paste(im, box) Map.paste(im1,box) Map = Map.convert("

Test for Pythonwin?

2009-07-30 Thread steve
Is there a good way to check if a script is running inside Pythonwin? Perhaps a property or method that is exposed by that environment? or, alternatively, is there a better place to ask :-) Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-30 Thread Emmanuel Surleau
On Friday 31 July 2009 01:06:31 Robert Kern wrote: > On 2009-07-30 16:44, r wrote: > > On Jul 30, 4:29 pm, Emmanuel Surleau > > > > wrote: > >>> 1.) No need to use "()" to call a function with no arguments. > >>> Python --> "obj.m2().m3()" --ugly > >>>Ruby --> "obj.m1.m2.m3" -- sweeet! > >>>

Re: Confessions of a Python fanboy

2009-07-30 Thread I V
On Thu, 30 Jul 2009 17:57:48 -0400, Luis Zarrabeitia wrote: > As I understood the question, it was "was wrong in 'for var in > container' in comparison with ruby's container.each?" > > What's the (semantic) difference between > > for localVar in container: > block > > and > > container.each

Re: merge two png pic

2009-07-30 Thread cocobear
On Jul 29, 9:20 am, cocobear wrote: > Thistwopngfile has their own palette > > >>> im1.mode > 'P' > >>> im.mode > 'P' > >>> im.getpalette == im1.getpalette > > False > > I can use this code tomergetwopngpictogether: > > Map = Image.new("RGB", (x,y)) > Map.paste(im, box) > Map.paste(im1,box) > > Ma

Re: Printing with colors in a portable way

2009-07-30 Thread Grant Edwards
On 2009-07-30, Robert Dailey wrote: > Anyone know of a way to print text in Python 3.1 with colors in a > portable way? In other words, I should be able to do something like > this: > > print_color( "This is my text", COLOR_BLUE ) > > And this should be portable (i.e. it should work on Linux, Mac,

Generators through the C API

2009-07-30 Thread Lucas P Melo
Hello, I'm a total noob about the C API. Is there any way to create a generator function using the C API? I couldn't find anything like the 'yield' keyword in it. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-blocking read with popen subprocess

2009-07-30 Thread Jonathan Gardner
On Jul 30, 5:24 pm, Dhanesh wrote: > > how can I we have a non blocking read ? See http://docs.python.org/library/popen2.html#flow-control-issues Note well: In the non-blocking world, you have to use select() or poll () to get your job done. You may want to look at "communicate" (http://docs.py

Re: httplib headers

2009-07-30 Thread MRAB
David Brochu wrote: Using the following code I am trying to pass a header to my POST request. (Note: urls masked) file = sys.argv[0] url = sys.argv[1] conn = httplib.HTTPConnection("XX.XXX.XX.XXX",) headers = {'content-type':'application/xml'} conn.request("POST",url,file,headers) response

Re: Run pyc file without specifying python path ?

2009-07-30 Thread Aahz
In article , Chris Rebert wrote: > >No, with the shebang line (and assuming execute permissions on the >file), it would look like: > >./wrapper.py There's no reason to name it ".py"; you can have a perfectly useful "shell script" that just happens to list python on the shebang line instead of th

httplib headers

2009-07-30 Thread David Brochu
Using the following code I am trying to pass a header to my POST request. (Note: urls masked) file = sys.argv[0] url = sys.argv[1] conn = httplib.HTTPConnection("XX.XXX.XX.XXX",) headers = {'content-type':'application/xml'} conn.request("POST",url,file,headers) response = conn.getresponse() he

Re: Confessions of a Python fanboy

2009-07-30 Thread Terry Reedy
r wrote: On Jul 30, 3:55 pm, Terry Reedy wrote: superpollo wrote: r wrote: how to reverse a string in python? must i usa a temp? like: [snip] Terry Jan Reedy No "r" never wrote anything like that. reversing a string is RTFM material, this is basic stuff here! Stop quoting me as saying thin

Confused About Python Loggin

2009-07-30 Thread Jannik Sundø
Dear all, I am quite confused about the Python logging. I have read and re-read the Python documentation for the Python logging module and googled, but to no avail. I simply want one logger to log to a file and another logger to log to the console. Neither should log the other's messages. T

Non-blocking read with popen subprocess

2009-07-30 Thread Dhanesh
Hi , I am trying to use subprocess popen on a windows command line executable with spits messages on STDOUT as well as STDIN. Code snippet is as below :- ## sOut="" sErr="" javaLoaderPath = os.path.join("c:\\","Program

Re: Confessions of a Python fanboy

2009-07-30 Thread Tim Rowe
2009/7/30 superpollo : > Tim Rowe wrote: >> Any language that gets any sort of real use has to have. For instance, >> I love Ada's numeric types (you can specify either the minimum number >> of significant figures or the maximum delta for a real type, and it >> will give you a type that satisfies

Re: Run pyc file without specifying python path ?

2009-07-30 Thread Gabriel Genellina
En Thu, 30 Jul 2009 12:16:46 -0300, Unknown escribió: On 2009-07-30, Barak, Ron wrote: On second thoughts, I may have a problem implementing the wrapper solution, because my actual test_pyc.pyc, needs to parse its command line. Namely, the actual call to test_pyc.pyc looks something like th

Re: Printing with colors in a portable way

2009-07-30 Thread Jan Kaliszewski
31-07-2009 o 01:29:50 Rhodri James wrote: On Thu, 30 Jul 2009 23:40:37 +0100, Robert Dailey wrote: Anyone know of a way to print text in Python 3.1 with colors in a portable way? In other words, I should be able to do something like this: print_color( "This is my text", COLOR_BLUE ) And

Re: Printing with colors in a portable way

2009-07-30 Thread Rhodri James
On Thu, 30 Jul 2009 23:40:37 +0100, Robert Dailey wrote: Anyone know of a way to print text in Python 3.1 with colors in a portable way? In other words, I should be able to do something like this: print_color( "This is my text", COLOR_BLUE ) And this should be portable (i.e. it should work

Re: Confessions of a Python fanboy

2009-07-30 Thread Robert Kern
On 2009-07-30 16:44, r wrote: On Jul 30, 4:29 pm, Emmanuel Surleau wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much cleaner. It ha

Re: [ANN] pyKook 0.0.2 - a simple build tool similar to Make or Ant

2009-07-30 Thread Дамјан Георгиевски
> I have released pyKook 0.0.2. > http://pypi.python.org/pypi/Kook/0.0.2 > http://www.kuwata-lab.com/kook/ > http://www.kuwata-lab.com/kook/pykook-users-guide.html How does it compare to http://code.google.com/p/fabricate/ and why is this problem (solution) reoccurring all the time -- дамјан (

Re: No PyPI search for 3.x compatible packages

2009-07-30 Thread Neil Hodgson
Francesco Bochicchio : > Are you sure? I note that for example pygtk has as language tags both > C and python. So maybe a C extension > for python3 would have both C and python 3 as language tags. > > I suspect that the 109 packages you found are the only ones obf the > 4829 which works with pyth

Printing with colors in a portable way

2009-07-30 Thread Robert Dailey
Anyone know of a way to print text in Python 3.1 with colors in a portable way? In other words, I should be able to do something like this: print_color( "This is my text", COLOR_BLUE ) And this should be portable (i.e. it should work on Linux, Mac, Windows). -- http://mail.python.org/mailman/lis

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 4:57 pm, Luis Zarrabeitia wrote: [snip] > I'd like to ask, what "container.each" is, exactly? It looks like a function > call (as I've learned a few posts ago), but, what are its arguments? How the > looping "works"? Does it receive a "code" object that it has to execute? > Is .each som

Re: New implementation of re module

2009-07-30 Thread MRAB
Piet van Oostrum wrote: MRAB (M) wrote: M> Hi all, M> I've been working on a new implementation of the re module. The details M> are at http://bugs.python.org/issue2636, specifically from M> http://bugs.python.org/issue2636#msg90954. I've included a .pyd file for M> Python 2.6 on Windows if y

Re: calling obect method

2009-07-30 Thread Benjamin Kaplan
On Thu, Jul 30, 2009 at 3:04 PM, srinivasan srinivas < sri_anna...@yahoo.co.in> wrote: > Hi, > I would like to know if i have an object and one of its methods as a > string. How to call the method using this string? > For ex > If object is x and string y has one of its method names. > x.value(y)()

Re: Confessions of a Python fanboy

2009-07-30 Thread Luis Zarrabeitia
On Thursday 30 July 2009 04:41:57 pm Masklinn wrote: > On 30 Jul 2009, at 22:23 , Jan Kaliszewski wrote: > > 30-07-2009 o 13:36:49 Masklinn wrote: > > > > I don't see any real limitation. What's wrong in: > > > > for localVar in container: > >block > > Well what's wrong with using that rather

Re: Confessions of a Python fanboy

2009-07-30 Thread Jan Kaliszewski
Dnia 30-07-2009 o 22:41:57 Masklinn napisał(a): On 30 Jul 2009, at 22:23 , Jan Kaliszewski wrote: 30-07-2009 o 13:36:49 Masklinn wrote: On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 2.) the .each method container.each{|localVar| block} This method can really clean

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 4:29 pm, Emmanuel Surleau wrote: > > 1.) No need to use "()" to call a function with no arguments. > > Python --> "obj.m2().m3()" --ugly > >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > > Man, i must admit i really like this, and your code will look so much > > cleaner. > > It has benefits -

Re: os.path.exists() and Samba shares

2009-07-30 Thread Loïc Domaigné
Hi, > Hello. I have written a Python 3.1 script running on Windows that uses > os.path.exists() to connect to network shares. If the various network > shares require different user account and password combos than the > account the script is running under the routine returns false. I need > someth

Re: New implementation of re module

2009-07-30 Thread MRAB
Wolfgang Rohdewald wrote: On Thursday 30 July 2009, Wolfgang Rohdewald wrote: so I did the conversion mentioned there. This works: I actually do not know if it works - but it compiles. Yes, it works. I've updated my code accordingly and it'll be in the next release. -- http://mail.python.org

Re: Regexp problem

2009-07-30 Thread MRAB
Ethan Furman wrote: Marcus Wanner wrote: On 7/30/2009 9:32 AM, Beldar wrote: On 30 jul, 15:07, MRAB wrote: Beldar wrote: Hi there! I have a problem and i'm not very good at regular expressions. I have a text like "lalala lalala tiruri beldar-is-listening tiruri lalala" I need a regexp to

Re: Confessions of a Python fanboy

2009-07-30 Thread Emmanuel Surleau
> 1.) No need to use "()" to call a function with no arguments. > Python --> "obj.m2().m3()" --ugly > Ruby --> "obj.m1.m2.m3" -- sweeet! > Man, i must admit i really like this, and your code will look so much > cleaner. It has benefits - code does look better. It has also significant cons - it

Re: Help with Regex for domain names

2009-07-30 Thread MRAB
Nobody wrote: On Thu, 30 Jul 2009 10:29:09 -0700, rurpy wrote: regex = re.compile(r'[\w\-\.]+\.(?:us|au|de)') You might also want to consider that some country codes such as "co" for Columbia might match more than you want, for example: re.match(r'[\w\-\.]+\.(?:us|au|de|co)', 'foo.boo.com')

Re: Regexp problem

2009-07-30 Thread Ethan Furman
Marcus Wanner wrote: On 7/30/2009 9:32 AM, Beldar wrote: On 30 jul, 15:07, MRAB wrote: Beldar wrote: Hi there! I have a problem and i'm not very good at regular expressions. I have a text like "lalala lalala tiruri beldar-is-listening tiruri lalala" I need a regexp to get the 'beldar' part

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 3:55 pm, Terry Reedy wrote: > superpollo wrote: > > r wrote: > > how to reverse a string in python? must i usa a temp? like: [snip] > Terry Jan Reedy No "r" never wrote anything like that. reversing a string is RTFM material, this is basic stuff here! Stop quoting me as saying things i

Re: Sorting dict by value w/ operator.itemgetter- using key name?

2009-07-30 Thread Terry Reedy
Wells Oliver wrote: Bit of code: print sorted(results.items(), key=operator.itemgetter(1)) Would rather use 'H9', which is the name of the key in position 1 like: print sorted(results.items(), key=operator.itemgetter('H9')) Obviously that ain't work else I wouldn't be sending this email. Any

Re: Confessions of a Python fanboy

2009-07-30 Thread Terry Reedy
superpollo wrote: r wrote: how to reverse a string in python? must i usa a temp? like: >>> s = "ciccio" >>> l = list(s) >>> l.reverse() >>> s = "".join(l) >>> s 'oiccic' >>> ??? No. >>> ''.join(list(reversed('abc'))) 'cba' >>> 'abc'[2::-1] 'cba' >>> 'abc'[10::-1] 'cba' Any i

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 22:23 , Jan Kaliszewski wrote: 30-07-2009 o 13:36:49 Masklinn wrote: On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 2.) the .each method container.each{|localVar| block} This method can really cleanup some ugly for loops, although i really like t

Re: Confessions of a Python fanboy

2009-07-30 Thread Jan Kaliszewski
30-07-2009 o 13:36:49 Masklinn wrote: On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 2.) the .each method container.each{|localVar| block} This method can really cleanup some ugly for loops, although i really like the readability of for loops. map(lambda localVar: ,

Re: socket send

2009-07-30 Thread Jan Kaliszewski
30-07-2009 o 12:29:24 Francesco Bochicchio wrote: On Jul 30, 5:52 am, NighterNet wrote: I am trying to figure out how to send text or byte in python 3.1. I am trying to send data to flash socket to get there. I am not sure how to work it. buff= 'id=' , self.id , ':balive=False\n' clientSock.

Re: class or thread id count

2009-07-30 Thread NighterNet
On Jul 30, 12:14 pm, r wrote: > On Jul 30, 1:13 pm, NighterNet wrote: > > > Need some help on doing some bit simple id count. It like every time > > it create a class orthreadthere is id++. Python 3.1 > > > example: > > class ClientThread (threading.Thread): > >    def __init__(self,clientSocket)

Re: No PyPI search for 3.x compatible packages

2009-07-30 Thread Martin v. Löwis
Neil Hodgson wrote: >There appears to be no way to search PyPI for packages that are > compatible with Python 3.x. There are classifiers for 'Programming > Language' including 'Programming Language :: Python :: 3' but that seems > to be for implementation language since there are so many packag

os.path.exists() and Samba shares

2009-07-30 Thread BDZ
Hello. I have written a Python 3.1 script running on Windows that uses os.path.exists() to connect to network shares. If the various network shares require different user account and password combos than the account the script is running under the routine returns false. I need something like os.sam

Re: socket send

2009-07-30 Thread Jan Kaliszewski
30-07-2009 o 05:52:06 NighterNet wrote: I am trying to figure out how to send text or byte in python 3.1. I am trying to send data to flash socket to get there. I am not sure how to work it. buff= 'id=' , self.id , ':balive=False\n' clientSock.send(buff); And what is the problem? *j -- Jan

Re: class or thread id count

2009-07-30 Thread r
On Jul 30, 1:13 pm, NighterNet wrote: > Need some help on doing some bit simple id count. It like every time > it create a class or thread there is id++. Python 3.1 > > example: > class ClientThread (threading.Thread): >    def __init__(self,clientSocket): >       threading.Thread.__init__(self) >

Re: calling obect method

2009-07-30 Thread r
>>> import math >>> getattr(math, 'hypot')(3,4) 5.0 -- http://mail.python.org/mailman/listinfo/python-list

Re: New implementation of re module

2009-07-30 Thread Hrvoje Niksic
MRAB writes: > So it complains about: > > ++(RE_CHAR*)context->text_ptr > > but not about: > > ++info->repeat.count > > Does this mean that the gcc compiler thinks that the cast makes it an > rvalue? The cast operator does return an rvalue, treating it otherwise used to be an extension t

calling obect method

2009-07-30 Thread srinivasan srinivas
Hi, I would like to know if i have an object and one of its methods as a string. How to call the method using this string? For ex If object is x and string y has one of its method names. x.value(y)() ---. Is there a way to do this? Thanks, Srini See the Web's breaking stories, chosen by

Re: Help with Regex for domain names

2009-07-30 Thread Nobody
On Thu, 30 Jul 2009 10:29:09 -0700, rurpy wrote: >> regex = re.compile(r'[\w\-\.]+\.(?:us|au|de)') > > You might also want to consider that some country > codes such as "co" for Columbia might match more than > you want, for example: > > re.match(r'[\w\-\.]+\.(?:us|au|de|co)', 'foo.boo.com') >

Sorting dict by value w/ operator.itemgetter- using key name?

2009-07-30 Thread Wells Oliver
Bit of code: print sorted(results.items(), key=operator.itemgetter(1)) Would rather use 'H9', which is the name of the key in position 1 like: print sorted(results.items(), key=operator.itemgetter('H9')) Obviously that ain't work else I wouldn't be sending this email. Any tips? -- Wells Olive

Re: Confessions of a Python fanboy

2009-07-30 Thread superpollo
MRAB wrote: superpollo wrote: ... how to reverse a string in python? must i usa a temp? like: >>> s = "ciccio" >>> l = list(s) >>> l.reverse() >>> s = "".join(l) >>> s 'oiccic' >>> ??? Use slicing with a step of -1: >>> s = "ciccio" >>> s[::-1] 'oiccic' lol bye -- http://mail.py

Re: Confessions of a Python fanboy

2009-07-30 Thread Dave Angel
superpollo wrote: how to reverse a string in python? must i usa a temp? like: >>> s = "ciccio" >>> l = list(s) >>> l.reverse() >>> s = "".join(l) >>> s 'oiccic' >>> ??? bye simply s = s[::-1] DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 20:06 , Falcolas wrote: On Jul 30, 11:56 am, Masklinn wrote: On 30 Jul 2009, at 19:37 , Jean-Michel Pichavant wrote: r wrote: How do I know if foo.value is an attribute or if it is a method that returns the foo value ? It cannot be an attribute. Ruby doesn't give acces

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 20:05 , superpollo wrote: r wrote: On Jul 30, 12:15 pm, Masklinn wrote: [snip] Furthermore Ruby has a pretty nice convention (sadly not used enough I think) taken from Scheme where it's possible to postfix a method name with "!" (note: the "!" is part of the name, the

Re: Confessions of a Python fanboy

2009-07-30 Thread MRAB
superpollo wrote: r wrote: On Jul 30, 12:15 pm, Masklinn wrote: [snip] Furthermore Ruby has a pretty nice convention (sadly not used enough I think) taken from Scheme where it's possible to postfix a method name with "!" (note: the "!" is part of the name, there's no magic) to indicate t

class or thread id count

2009-07-30 Thread NighterNet
Need some help on doing some bit simple id count. It like every time it create a class or thread there is id++. Python 3.1 example: class ClientThread (threading.Thread): def __init__(self,clientSocket): threading.Thread.__init__(self) self.id += 1; Not sure it how it works. --

Re: Does python have the capability for driver development ?

2009-07-30 Thread Ethan Furman
Ben Finney wrote: "Martin P. Hellwig" writes: Machine Code: Whatever the machine executes, it could be that the CPU uses an abstraction of microcode to do this but from the perspective of the user, this is all done in the same 'black box' This requires, of course, defining what is the mach

Re: Confessions of a Python fanboy

2009-07-30 Thread superpollo
Tim Rowe wrote: 2009/7/30 r : Like your first lay, your first programing language can leave an indelible mark on you That's true. FOCAL scarred me for life. but i now realize Ruby has some good things going for it. Any language that gets any sort of real use has to have. For instance,

Re: Confessions of a Python fanboy

2009-07-30 Thread Falcolas
On Jul 30, 11:56 am, Masklinn wrote: > On 30 Jul 2009, at 19:37 , Jean-Michel Pichavant wrote: > > > r wrote: > > How do I know if foo.value is an attribute or if it is a method that   > > returns the foo value ? > > It cannot be an attribute. Ruby doesn't give access to attributes,   > they're a

Re: Confessions of a Python fanboy

2009-07-30 Thread superpollo
r wrote: On Jul 30, 12:15 pm, Masklinn wrote: [snip] Furthermore Ruby has a pretty nice convention (sadly not used enough I think) taken from Scheme where it's possible to postfix a method name with "!" (note: the "!" is part of the name, there's no magic) to indicate that this method mod

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 19:42 , Carsten Haese wrote: r wrote: Of course in python you would do... vector.reverse --> in-place vector.reversed --> in-place You do know that only one of those works in-place, right? Well mostly because the other one doesn't exist (as python has `lst.reverse()` bu

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 19:37 , Jean-Michel Pichavant wrote: r wrote: On Jul 30, 11:31 am, Falcolas wrote: On Jul 29, 9:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i reall

Re: Confessions of a Python fanboy

2009-07-30 Thread Tim Rowe
2009/7/30 r : > > Like your > first lay, your first programing language can leave an indelible mark > on you That's true. FOCAL scarred me for life. > but i now realize Ruby has some good > things going for it. Any language that gets any sort of real use has to have. For instance, I love Ada's n

Re: Confessions of a Python fanboy

2009-07-30 Thread Carsten Haese
r wrote: > Of course in python you would do... > vector.reverse --> in-place > vector.reversed --> in-place You do know that only one of those works in-place, right? > The above example works pretty good, but this doesn't always "sound" > good. Take for example this... > point3d.offset -->

Re: Bug in IEHtmlWindow?

2009-07-30 Thread Mike Driscoll
On Jul 30, 2:54 am, Massi wrote: > Hi everyone, I'm trying to use IEHtmlWindow in my application (python > 2.5, wxpython 2.8 on win xp). Everything is ok, but I encountered a > problem which also affects the demo. If I make a research on google a > strange message appears, saying (I'll try to tran

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 12:37 pm, Jean-Michel Pichavant wrote: > r wrote: > > On Jul 30, 11:31 am, Falcolas wrote: > > >> On Jul 29, 9:06 pm, r wrote: > > >>> 1.) No need to use "()" to call a function with no arguments. > >>> Python --> "obj.m2().m3()" --ugly > >>>   Ruby --> "obj.m1.m2.m3"  -- sweeet! > >>

Re: Confessions of a Python fanboy

2009-07-30 Thread Jean-Michel Pichavant
r wrote: On Jul 30, 11:31 am, Falcolas wrote: On Jul 29, 9:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much clean

Re: Confessions of a Python fanboy

2009-07-30 Thread r
Traceback (most recent post last): File "", lines (13,14), in vector.reverse --> in-place vector.reversed --> in-place DumbMistakeError: Of course in python you would do... vector.reverse --> in-place vector.reversed --> new vector -- http://mail.python.org/mailman/listinfo/python-

Re: Does python have the capability for driver development ?

2009-07-30 Thread Michael Torrie
MalC0de wrote: > please introduce me some resource for system programming, I know that > python is very well at system programming level. > thanks Although it is possible (as others have said) to embed Python the interpreter into a driver, no one has done that that I know of. You'd have to write

Re: Help with Regex for domain names

2009-07-30 Thread rurpy
On Jul 30, 9:56 am, MRAB wrote: > Feyo wrote: > > I'm trying to figure out how to write efficiently write a regex for > > domain names with a particular top level domain. Let's say, I want to > > grab all domain names with country codes .us, .au, and .de. > > > I could create three different regex

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 12:15 pm, Masklinn wrote: [snip] > Furthermore Ruby has a pretty nice convention (sadly not used enough I   > think) taken from Scheme where it's possible to postfix a method name   > with "!" (note: the "!" is part of the name, there's no magic) to   > indicate that this method modifie

Re: Help with Regex for domain names

2009-07-30 Thread Feyo
On Jul 30, 11:56 am, MRAB wrote: > Feyo wrote: > > I'm trying to figure out how to write efficiently write a regex for > > domain names with a particular top level domain. Let's say, I want to > > grab all domain names with country codes .us, .au, and .de. > > > I could create three different rege

Re: Pyplot

2009-07-30 Thread Robert Kern
On 2009-07-30 04:02, Kaan AKŞİT wrote: I am a newbee in Python. I have some problem with usage of Pyplot. I have a loop that creates plot in every end of it. Problem starts here: The first plot is fine but the second one is plotted onto the first plot. I use: plt.cla() plt.draw() plt.hold(False)

NASA using Python / Django for NEBULA (cloud comp.)

2009-07-30 Thread Mehdi H
Hello Python devs! I'm supporting NASA on their NEBULA project and they're looking for Python / Django experts to join their team here in Mountain View, CA. If you're interested, let me know and we can talk more on how they're using Django in their environment! Thanks, Mehdi -- http://mail.p

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 19:01 , Inky 788 wrote: On Jul 30, 12:04 am, alex23 wrote: On Jul 30, 1:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 18:31 , Falcolas wrote: On Jul 29, 9:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much cleaner. I perso

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 11:31 am, Falcolas wrote: > On Jul 29, 9:06 pm, r wrote: > > > 1.) No need to use "()" to call a function with no arguments. > > Python --> "obj.m2().m3()" --ugly > >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > > Man, i must admit i really like this, and your code will look so much > > cle

Re: Run pyc file without specifying python path ?

2009-07-30 Thread Dave Angel
Barak, Ron wrote: Hi Dave, On second thoughts, I may have a problem implementing the wrapper solution, because my actual test_pyc.pyc, needs to parse its command line. Namely, the actual call to test_pyc.pyc looks something like this: $ python test_pyc.py -U dave -PpasswoRD -C CreateMcGroupOn

Re: socket send

2009-07-30 Thread Francesco Bochicchio
On 30 Lug, 18:06, NighterNet wrote: > On Jul 30, 6:56 am, "Mark Tolonen" wrote: > > > > > > > "NighterNet" wrote in message > > >news:55aba832-df6d-455f-bf34-04d37eb06...@i4g2000prm.googlegroups.com... > > > >I am trying to figure out how to send text or byte in python3.1. I am > > > trying to s

Re: Confessions of a Python fanboy

2009-07-30 Thread Inky 788
On Jul 30, 12:04 am, alex23 wrote: > On Jul 30, 1:06 pm, r wrote: > > > 1.) No need to use "()" to call a function with no arguments. > > Python --> "obj.m2().m3()" --ugly > >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > > Man, i must admit i really like this, and your code will look so much > > clean

ANN: Leo 4.6.1 final released

2009-07-30 Thread Edward K Ream
Leo 4.6.1 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html Leo 4.6.1 fixes several minor bugs in Leo 4.6. The highlight

Re: Use existing IE cookie

2009-07-30 Thread KB
On Jul 30, 9:23 am, "Diez B. Roggisch" wrote: > KB wrote: > > >> What does you full example look like, including the > >> cookie-acquisition-stuff? > > >> Diez > > > I ran them seperately, hoping for a clue as to what my "cookiejar" > > was. > > > The cookie-acquisition stuff returns "screener.ash

Re: Confessions of a Python fanboy

2009-07-30 Thread Falcolas
On Jul 29, 9:06 pm, r wrote: > 1.) No need to use "()" to call a function with no arguments. > Python --> "obj.m2().m3()" --ugly >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > Man, i must admit i really like this, and your code will look so much > cleaner. I personally would not prefer this, and woul

Re: Use existing IE cookie

2009-07-30 Thread Diez B. Roggisch
KB wrote: > >> What does you full example look like, including the >> cookie-acquisition-stuff? >> >> Diez > > I ran them seperately, hoping for a clue as to what my "cookiejar" > was. > > The cookie-acquisition stuff returns "screener.ashx?v=151" when I > search with my domain I am interested

Re: Confessions of a Python fanboy

2009-07-30 Thread Colin J. Williams
Some have treated this as a troll. I don't. r wrote: [snip] 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much cleaner. +1 2.) the .each me

Re: socket send

2009-07-30 Thread NighterNet
On Jul 30, 6:56 am, "Mark Tolonen" wrote: > "NighterNet" wrote in message > > news:55aba832-df6d-455f-bf34-04d37eb06...@i4g2000prm.googlegroups.com... > > >I am trying to figure out how to send text or byte in python3.1. I am > > trying to send data to flashsocketto get there. I am not sure how t

Re: Use existing IE cookie

2009-07-30 Thread KB
> What does you full example look like, including the > cookie-acquisition-stuff? > > Diez I ran them seperately, hoping for a clue as to what my "cookiejar" was. The cookie-acquisition stuff returns "screener.ashx?v=151" when I search with my domain I am interested in. I have tried urllib2.HTTP

Re: Help with Regex for domain names

2009-07-30 Thread MRAB
Feyo wrote: I'm trying to figure out how to write efficiently write a regex for domain names with a particular top level domain. Let's say, I want to grab all domain names with country codes .us, .au, and .de. I could create three different regexs that would work: regex = re.compile(r'[\w\-\.]+\

Re: Help with Regex for domain names

2009-07-30 Thread Tim Daneliuk
Feyo wrote: > I'm trying to figure out how to write efficiently write a regex for > domain names with a particular top level domain. Let's say, I want to > grab all domain names with country codes .us, .au, and .de. > > I could create three different regexs that would work: > regex = re.compile(r'

Re: Does python have the capability for driver development ?

2009-07-30 Thread MRAB
Ben Finney wrote: "Martin P. Hellwig" writes: Machine Code: Whatever the machine executes, it could be that the CPU uses an abstraction of microcode to do this but from the perspective of the user, this is all done in the same 'black box' This requires, of course, defining what is the machin

Re: Does python have the capability for driver development ?

2009-07-30 Thread MRAB
Dave Angel wrote: [snip] As far as I know, nobody has yet built a microcode implementation of a Python VM (Virtual Machine). Nor have I seen one for the Java VM. However, in the early 80's there was a microcode implementation of the P-system VM. It was never a commercial success, but it exis

Re: Use existing IE cookie

2009-07-30 Thread Diez B. Roggisch
KB wrote: > >> > Using:http://code.activestate.com/recipes/80443/ >> > > Thanks for the prompt reply, Diez! Using the above I have found the > name of the cookie (I did google how to use IE cookies in python and > that was the best match) but it only tells me the name of the cookie, > not how to

Re: Does python have the capability for driver development ?

2009-07-30 Thread Martin P. Hellwig
Ben Finney wrote: "Martin P. Hellwig" writes: Machine Code: Whatever the machine executes, it could be that the CPU uses an abstraction of microcode to do this but from the perspective of the user, this is all done in the same 'black box' This requires, of course, defining what is the machin

Help with Regex for domain names

2009-07-30 Thread Feyo
I'm trying to figure out how to write efficiently write a regex for domain names with a particular top level domain. Let's say, I want to grab all domain names with country codes .us, .au, and .de. I could create three different regexs that would work: regex = re.compile(r'[\w\-\.]+\.us) regex = r

Re: Use existing IE cookie

2009-07-30 Thread KB
> > Using:http://code.activestate.com/recipes/80443/ > Thanks for the prompt reply, Diez! Using the above I have found the name of the cookie (I did google how to use IE cookies in python and that was the best match) but it only tells me the name of the cookie, not how to use it. Any clues? TIA

Re: Run pyc file without specifying python path ?

2009-07-30 Thread Grant Edwards
On 2009-07-30, Barak, Ron wrote: > Hi Dave, > > On second thoughts, I may have a problem implementing the > wrapper solution, because my actual test_pyc.pyc, needs to > parse its command line. Namely, the actual call to > test_pyc.pyc looks something like this: > > $ python test_pyc.py -U dave -P

Re: Use existing IE cookie

2009-07-30 Thread Diez B. Roggisch
KB wrote: > Hi there, > > Relevant versions: Python 2.5, Vista Home, IE7 > > I am trying to scrape a website I have browsed manually in the past, > and also manually selected my options, and now want python to use my > existing cookie from the manual browse when downloading data. > > Using: htt

RE: Run pyc file without specifying python path ?

2009-07-30 Thread Barak, Ron
Hi Dave, On second thoughts, I may have a problem implementing the wrapper solution, because my actual test_pyc.pyc, needs to parse its command line. Namely, the actual call to test_pyc.pyc looks something like this: $ python test_pyc.py -U dave -PpasswoRD -C CreateMcGroupOnVolume --SVMs_IPs '

Use existing IE cookie

2009-07-30 Thread KB
Hi there, Relevant versions: Python 2.5, Vista Home, IE7 I am trying to scrape a website I have browsed manually in the past, and also manually selected my options, and now want python to use my existing cookie from the manual browse when downloading data. Using: http://code.activestate.com/reci

  1   2   >