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-
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
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!
> >>
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
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 -->
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
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
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
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
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
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,
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
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.
--
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
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
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
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
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
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
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')
>
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
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
>>> import math
>>> getattr(math, 'hypot')(3,4)
5.0
--
http://mail.python.org/mailman/listinfo/python-list
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)
>
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
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
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
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)
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.
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: ,
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
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
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
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
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
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')
> 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
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
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
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
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 -
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
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
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)()
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
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
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
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
> 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
--
дамјан (
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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
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
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!
> >>>
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
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("
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,
101 - 169 of 169 matches
Mail list logo