Op 2005-03-31, [EMAIL PROTECTED] schreef <[EMAIL PROTECTED]>:
> Cool Code!
>
> One possible sticking point is that I think select only works on
> network sockets on windows. This would make the code not crossplatforn.
As far as I understand, what I did with pipes, can be done just as
fine with ne
We want to thank you for your interest in joining the Google team. We received
your email inquiry and look forward to the opportunity to review your background
and experience. Unfortunately, we are unable to give a personal reply to every
applicant. However, please know that we do review all resume
"Tertius Cronje" <[EMAIL PROTECTED]> wrote:
>
>How do I get a hexvalued string to a format recognized for binary
>calculation?
You're going to be embarrassed.
>import binascii
>s1 = '1C46BE3D9F6AA820'
>s2 = '8667B5236D89CD46'
>
>i1 = binascii.unhexlify(s1)
>i2 = binascii.unhexlify(s2)
>x = i1 ^i2
Rakesh wrote:
Hi,
For a particular problem of mine, I want to sort pairs
by its value.
Eg:
Input:
A, 4
B, 5
C, 1
D, 2
E, 3
I would like the output to be:
C
D
E
A
B
the following code does that:
>>> d1 = {'a':4,'b':5,'c':1,'d':2,'e':3}
>>> i1 = [ (d1[i], i) for i in d1.keys() ]
>>> i1.sort()
>>
Larry Hastings wrote:
> Also, how much would I be
> able to trim away if I recompiled it myself? Is a lot of it native
> implementations of Python libraries that I might not care about
> including, or is it all fundamental VM stuff that couldn't possibly
be
> removed?
In Pythons config.c file Yo
Andreas Beyer wrote:
> I loved to use
> >>> string.join(list_of_str, sep)
> instead of
> >>> sep.join(list_of_str)
>
> I think the former is much more telling what is happening than the
> latter. However, I will get used to it.
No need to get used to it. Just reverse the order of the arguments
On Fri, 01 Apr 2005 02:06:07 -0500, Steve Holden <[EMAIL PROTECTED]> wrote:
>Trent Mick wrote:
>> [Baza wrote]
>>
>>>Am I right in thinking that >>>print "\a" should sound the system, 'bell'?
>>
>>
>> It works on the shell on Windows for me (WinXP).
>>
>> Trent
>>
>Interesting. From a Cygwin
Timothy Wu <[EMAIL PROTECTED]> wrote:
>
>I'm trying to fill the form on page
>http://www.cbs.dtu.dk/services/TMHMM/ using urllib.
>
>There are two peculiarities. First of all, I am filling in incorrect
>key/value pairs in the parameters on purpose because that's the only
>way I can get it to work..
I want to know if iter(iterator) returns always its argument (when
argument is an iterator)
So :
>>> iterable = range(10)
>>> it = iter(iterable)
>>> that = iter(it)
>>> that is it
True# Good!
>>> that is it is not it
False # What ?
>>>
>>> Python = map(bool, it)
>>> logic = True
>>> logic i
On 31 Mar 2005 22:40:53 -0800, "Rakesh" <[EMAIL PROTECTED]>
wrote:
>Hi,
> For a particular problem of mine, I want to sort pairs
>by its value.
>
>Eg:
>
>Input:
>
>A, 4
>B, 5
>C, 1
>D, 2
>E, 3
>
>I would like the output to be:
>
>C
>D
>E
>A
>B
>
>i.e. I would like to get the keys in the sorted o
> I can't use 'break' or 'continue' in a class method, nor can I return a
> boolean value from __init__() to check for errors within the for-loop.
> How would I be able to stop the current iteration and continue with the
> next after reporting an error?
maybe i don't fully understand your qn but w
Robin Becker wrote:
> eg for
> >>> e = enumerate([0,1,2,3,4,5])
> >>> for i,a in e:
> ... if a==3: break
> ...
> >>> for i,a in e:
> ... print i,a
> ...
> 4 4
> 5 5
> >>>
>
> I think the second loop needs to start at 3 ie the split needs to be
> start, limit semantics
>
> It woul
You could use
condition and consequent or alternative
I use it
Sean
On Apr 1, 2005 5:24 PM, praba kar <[EMAIL PROTECTED]> wrote:
> Dear All,
> I am new to Python. I want to know how to
> work with ternary operator in Python. I cannot
> find any ternary operator in Python. So Kindly
> cle
Greg Ewing wrote:
Steven Bethard wrote:
py> def defaultdict(*args, **kwargs):
... defaultfactory, args = args[0], args[1:]
which can be written more succinctly as
def defaultdict(defaultfactory, *args, **kwargs):
...
Not if you want to allow the defaultfactory to be called with a keyword
Hello,
I asked this question some time ago, but as I got no answer, so I just
try it a second
time.
I am working on a C extension module that implements a bunch of
classes. Everything
works fine so far, but I cannot find any way to implement class
attributes or inner
classes. Consider you have
On Fri, 01 Apr 2005 07:46:41 GMT, Joal Heagney <[EMAIL PROTECTED]> wrote:
>Oh goddammmni. I seem to be doing this a lot today. Look below for
>the extra addition to the code I posted.
>
>Joal Heagney wrote:
>>
>> Here's my contribution anycase:
>>
>> count = 0
>> # Get first input
>> name =
praba kar wrote:
Dear All,
I am new to Python. I want to know how to
work with ternary operator in Python. I cannot
find any ternary operator in Python.
http://www.python.org/peps/pep-0308.html
--
http://mail.python.org/mailman/listinfo/python-list
To confuse a newbies and old hands alike, Bengt Richter wrote:
> Need something more straightforward, e.g., a wrapped one-liner:
>
> >>> def guess(n=3): print ("You're right!", 'No more tries for
> >>> you!!!')[n-1 in
> ...(x for x in xrange(n) for t in [raw_input('Guess my name:
> ')=='B
Sean Kemplay wrote:
You could use
condition and consequent or alternative
I use it
You should do so cautiously, since if consequent is false, it will not
behave as suspected. Not to mention that it's quite unreadable.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San
Hello,
I just posted this question with a wrong subject... So here again with
a better one.
I am working on a C extension module that implements a bunch of
classes. Everything
works fine so far, but I cannot find any way to implement class
attributes or inner
classes. Consider you have the foll
Does anyone here use ClientForm to handle a HTML form on client side?
I got a form, within which there is a image control, it direct me to
another page if i use mouse click on it. the code of the form as
below:
...
...
So write below code to 'click' the image button,
forms = ParseR
I need a dict (well, it would be optimal anyway) class that stores the
keys as strings without coercing the case to upper or lower, but still
provides fast lookup (i.e. uses hash table).
>> d = CiDict([('Hi', 12),('hoho',13)])
>> d['hi']
12
>> d.keys()
['Hi','hoho']
Note that 'Hi' preserved t
On Apr 1, 2005 8:10 PM, Erik Max Francis <[EMAIL PROTECTED]> wrote:
> Sean Kemplay wrote:
>
> > You could use
> >
> > condition and consequent or alternative
> >
> > I use it
>
> You should do so cautiously, since if consequent is false, it will not
> behave as suspected. Not to mention that it'
Ville Vainio wrote:
I need a dict (well, it would be optimal anyway) class that stores the
keys as strings without coercing the case to upper or lower, but still
provides fast lookup (i.e. uses hash table).
Store the original key together with the value and use a lowercase key
for lookup.
only a
When using try... except... errors don't show up. Is there a way to
force stderr despite using try...except?
thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Nigel Rowe>Have you seen Grig Gheorghiu's 3 part comparison of
unittest, and py.test?<
Very interesting articles, thank you. Testing seems something still in
quick development.
For small functions the doctests are useful, but py.test has some
advantages. Probably something even better that py.tes
I have the following:
num1 = ['1', '4', '5']
How can I combine the elements in num1 to produce an integer 145?
thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Exactly the answer I was looking for! 12 hours of straight programming
tends to fog ones mind. Thanks for making it clear!
Jay
--
http://mail.python.org/mailman/listinfo/python-list
Harlin Seritt wrote:
> I have the following:
>
> num1 = ['1', '4', '5']
>
> How can I combine the elements in num1 to produce an integer 145?
int(''.join(num1))
--
http://mail.python.org/mailman/listinfo/python-list
If anyone has time, would you mind explaining the code that Dan Bishop
was so kind as to point out to me:
int(''.join(num1))
This worked perfectly for me, however, I'm not sure that I understand
it very well.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Suggesting method names based on a wrong method name can be useful, but
I think the "smart help" can be improved: it can also be useful to have
a suggestion for method names on the basis on a short description (or
keywords) about what I want to do to/with the object. Maybe some people
here can give
Daniel Silva wrote:
We think dropping FILTER and MAP is pretty uncontroversial; (filter P
S) is almost always written clearer as a DO loop (plus the LAMBDA is
slower than the loop). Even more so for (map F S). In all cases,
writing the equivalent imperative program is clearly beneficial.
How abou
Harlin Seritt wrote:
> If anyone has time, would you mind explaining the code that Dan
Bishop
> was so kind as to point out to me:
>
> int(''.join(num1))
>
> This worked perfectly for me, however, I'm not sure that I understand
> it very well.
>
> Thanks,
>
> Harlin Seritt
''.join(list of strings
Harlin Seritt wrote:
> If anyone has time, would you mind explaining the code that Dan
Bishop
> was so kind as to point out to me:
>
> int(''.join(num1))
>
> This worked perfectly for me, however, I'm not sure that I understand
> it very well.
join(...)
S.join(sequence) -> string
Return a
H!
I thought I was ready with my own spider...
But then there was a bug, or in other words a missing part in my code.
I forget that people do this in website html:
http://www.nic.nl/monkey.html";>is oke
error
error
So now i'm trying to fix my spider but it fails and it fails.
I tryed something l
"Andrew Koenig" <[EMAIL PROTECTED]> writes:
> "Lonnie Princehouse" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > If you try this sort of inheritance, I'd recommend writing down the
> > formal grammar before you start writing classes. Don't try to define
> > the grammar thr
praba kar <[EMAIL PROTECTED]> wrote:
> Dear All,
> I am new to Python. I want to know how to
> work with ternary operator in Python. I cannot
> find any ternary operator in Python.
You answered your own question; there is no ternary operator in Python.
There was a major debate on this new
> "Daniel" == Daniel Dittmar <[EMAIL PROTECTED]> writes:
Daniel> Ville Vainio wrote:
>> I need a dict (well, it would be optimal anyway) class that
>> stores the keys as strings without coercing the case to upper
>> or lower, but still provides fast lookup (i.e. uses hash
I think you want urllib.basejoin().
>>> urllib.basejoin("http://www.example.com/test/page.html";, "otherpage.html")
'http://www.example.com/test/otherpage.html'
pgpSOZBAEHiWi.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
Another alternative:
d1 = {'a':4,'b':5,'c':1,'d':2,'e':3}
il=[(v,k) for k,v in d1.items()]
il.sort()
--
http://mail.python.org/mailman/listinfo/python-list
HallÃchen!
Daniel Silva <[EMAIL PROTECTED]> writes:
> Shriram Krishnamurthi has just announced the following elsewhere; it might
> be of interest to c.l.s, c.l.f, and c.l.p:
> http://list.cs.brown.edu/pipermail/plt-scheme/2005-April/008382.html
>
>
> The Fate Of LAMBDA in PLT Sche
Nigel Rowe <[EMAIL PROTECTED]> wrote:
> Have you seen Grig Gheorghiu's 3 part comparison of unittest, and py.test?
>
> http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-1-unittest.html
> http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-2-doctest.html
> http://agil
urllib.basejoin() that's what I need :)
haha what a stupid code did I made.
Thanks
GC-Martijn
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> BigDecimal is a Python class that supports decimal arithmetic on very large
> integers. BigDecimal was inspired by the posting of BigDec to c.l.py by Tim
> Peters. BigDecimal implements all the commonly used integer methods. (It
> doesn't implement any of the binary/sh
The free wikipedia is adopting a standard pseudocode:
http://en.wikipedia.org/wiki/Wikipedia_talk:Wikicode/Specification
MShonle says something nice:
I support the idea of wikicode. Basically I think we should present
code in a Python-like language that doesn't carry so much baggage. For
example,
"praba kar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Dear All,
I am new to Python. I want to know how to
work with ternary operator in Python. I cannot
find any ternary operator in Python. So Kindly
clear my doubt regarding this
There isn't one, and there won't be one unle
martijn> I thought I was ready with my own spider... But then there was
martijn> a bug, or in other words a missing part in my code.
martijn> I forget that people do this in website html:
martijn> http://www.nic.nl/monkey.html";>is oke
martijn> error
martijn> error
pydoc
Ville Vainio wrote:
"Daniel" == Daniel Dittmar <[EMAIL PROTECTED]> writes:
Daniel> Ville Vainio wrote:
>> I need a dict (well, it would be optimal anyway) class that
>> stores the keys as strings without coercing the case to upper
>> or lower, but still provides fast lookup (i.e. u
"Harlin Seritt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
When using try... except... errors don't show up. Is there a way to
force stderr despite using try...except?
If you're looking for stack traces, look at the inspect and
traceback modules. They contain the tools to do just
praba kar wrote:
> Dear All,
> I am new to Python. I want to know how to
> work with ternary operator in Python. I cannot
> find any ternary operator in Python. So Kindly
> clear my doubt regarding this
There is no ternary operator in python. There are several idioms that can be
used to em
There are just three weeks to go to Python-UK!
The UK Python conference is once again taking place at the
Randolph Hotel in the centre of historic Oxford, as part of
the ACCU conference, on 21-23 April.
http://www.accu.org/conference/python.html
On Tuesday 19th there's also a full day tutorial f
The new xsdbXML_cs_java_py_01 release adds a
"not applicable" attribute restriction and
completes the same/ifknown/otherwise implementations
as well as some bugfixes including a fix for
a performance bug in the java implementation.
The xsdb framework provides a flexible and well defined
infrastruc
The Fate Of LAMBDA in PLT Scheme v300
or
Lambda the Ultimate Design Flaw
Why drop LAMBDA?
Why not? Isn't all code eventually anonymous and relocatable?
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten wrote:
To confuse a newbies and old hands alike, Bengt Richter wrote:
got me for one:)
To make it a bit clearer, a StopIteration raised in a generator expression
silently terminates that generator:
*any* exception raised from a generator, terminates the generator
jfj
--
http://mail.pyt
Bengt Richter wrote:
On Fri, 01 Apr 2005 07:46:41 GMT, Joal Heagney <[EMAIL PROTECTED]> wrote:
Oh goddammmni. I seem to be doing this a lot today. Look below for
the extra addition to the code I posted.
Joal Heagney wrote:
Here's my contribution anycase:
count = 0
# Get first input
name = ra
Hello-
I am trying to read a file from a zip archive. I have read the
documentation on zipfile and can read the names of the files in the
archive and the length of each file, but do not see how to get to the
actual data from any given file. This is probably so simple that it
hurts, so take it
On Apr 1, 2005 8:14 PM, Greg Lindstrom <[EMAIL PROTECTED]> wrote:
> How do I read the data from a file in a zip archive?
http://www.devshed.com/c/a/Python/Python-UnZipped
Regards,
--
Swaroop C H
Blog: http://www.swaroopch.info
Book: http://www.byteofpython.info
--
http://mail.python.org/mailman
Hi.
pyvm is a program that can run python 2.4 bytecode and most
of the times produce the expected output. See
http://students.ceid.upatras.gr/~sxanth/
I'm collecting small testlets to benchmark it, discover bottlenecks
and improve it. They should be small and not use any crazy modules.
On
Use something like:
import zipfile
zfile=zipfile.ZipFile(zipfilename,'r')
contents=zfile.read(filenametoread)
Stripped out of a working program, but not tested.
-Larry Bates
Greg Lindstrom wrote:
> Hello-
> I am trying to read a file from a zip archive. I have read the
> documentation on zipf
On Thu, 31 Mar 2005 23:30:42 -0800, Erik Max Francis wrote:
> Daniel Silva wrote:
>
>> Shriram Krishnamurthi has just announced the following elsewhere; it might
>> be of interest to c.l.s, c.l.f, and c.l.p:
>> http://list.cs.brown.edu/pipermail/plt-scheme/2005-April/008382.html
>
> April Fool's
Peter Otten wrote:
> To confuse a newbies and old hands alike, Bengt Richter wrote:
>
> > Need something more straightforward, e.g., a wrapped one-liner:
> >
> > >>> def guess(n=3): print ("You're right!", 'No more tries for
> > >>> you!!!')[n-1 in
> > ...(x for x in xrange(n) for t in [raw_
I am working on a C extension module that implements a bunch of
classes. Everything
works fine so far, but I cannot find any way to implement class
attributes or inner
classes. Consider you have the following lines of Python :
class Foo :
class Bar :
pass
spam = "foo
In my mind, practicing TDD is what matters most. Which framework you
choose is a function of your actual needs. The fact that there are 3 of
them doesn't really bother me. I think it's better to have a choice
from a small number of frameworks rather than have no choice or have a
single choice that
John Roth wrote:
"praba kar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Dear All,
I am new to Python. I want to know how to
work with ternary operator in Python. I cannot
find any ternary operator in Python. So Kindly
clear my doubt regarding this
There isn't one, and ther
"harold fellermann" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I asked this question some time ago, but as I got no answer, so I just
> try it a second time.
This did get out, but I can't answer except to suggest looking at code for
other C extension modules. Nested (inner)
[Peter Otten]
> a StopIteration raised in a generator expression
> silently terminates that generator:
>
> >>> def stop(): raise StopIteration
> ...
> >>> list(i for i in range(10) if i < 5 or stop())
> [0, 1, 2, 3, 4]
>
> In a list comprehension, on the other hand, it is propagated:
>
> >>> [i for
[Roy Smith <[EMAIL PROTECTED]>]
> One thing that worries me a little is that all three seem to have
> advantages and disadvantages, yet none is so obviously better than the
> others that it stands out as the only reasonable way to do it. This means
> some groups will adopt one, some will adopt an
Vikram wrote:
I can't use 'break' or 'continue' in a class method, nor can I return a
boolean value from __init__() to check for errors within the for-loop.
How would I be able to stop the current iteration and continue with the
next after reporting an error?
maybe i don't fully understand your qn
On 1 Apr 2005 03:21:12 -0800, Harlin Seritt <[EMAIL PROTECTED]> wrote:
> num1 = ['1', '4', '5']
>
> How can I combine the elements in num1 to produce an integer 145?
>>> num1 = ['1', '4', '5']
>>> int(''.join(num1))
145
.Facundo
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.pyt
Can anyone help with this error message when using Shelve : Python 2.4.
Traceback (most recent call last):
File "C:\Python24\CollectB\dataparser.py", line 743, in -toplevel-
base.create()
File "C:\Python24\CollectB\dataparser.py", line 252, in create
self.dataStore[i] = v
File "C:\Py
Laszlo Zsolt Nagy <[EMAIL PROTECTED]> wrote in message news:<[EMAIL
PROTECTED]>...
> My problem is about properties and the virtuality of the methods. I
> would like to create a property whose get and set methods
> are virtual. I had the same problems in Delphi before and the solution
> was the
OK, you won. I read in an (regretably old) guidline for improving
Python's performance that you should prefer map() compared to list
comprehensions. Apparently the performance of list comprehensions has
improved a lot, which is great. (Or the overhead of calling map() got
too big, but I hope th
M.-A. Lemburg wrote:
> [EMAIL PROTECTED] wrote:
> > BigDecimal is a Python class that supports decimal arithmetic on
very large integers. BigDecimal was inspired by the posting of BigDec
to c.l.py by Tim Peters. BigDecimal implements all the commonly used
integer methods. (It doesn't implement any
On Fri, 01 Apr 2005 16:42:30 +, Raymond Hettinger wrote:
> FWIW, the evolution of py.test is to also work seemlessly with existing tests
> from the unittest module.
Is this true now, or is this planned?
I read(/skimmed) the docs for py.test when you linked to the project, but
I don't recall
[Sunnan]
> [...] for Pythons ideal of having one canonical, explicit way to
> program.
No doubt it once was true, but I guess this ideal has been abandoned a
few years ago.
My honest feeling is that it would be a mis-representation of Python,
assertng today that this is still one of the Python's
>From what I know, the PyPy guys already have a unittest-to-py.test
translator working, but they didn't check in the code yet. You can send
an email to py-dev at codespeak.net and let them know you're interested
in this functionality.
Grig
--
http://mail.python.org/mailman/listinfo/python-list
On 01 Apr 2005 15:55:58 +0300, Ville Vainio <[EMAIL PROTECTED]>
wrote:
>> "Daniel" == Daniel Dittmar <[EMAIL PROTECTED]> writes:
>
>Daniel> Ville Vainio wrote:
>
>>> I need a dict (well, it would be optimal anyway) class that
>>> stores the keys as strings without coercing the case
Hello,
What's the problem with this code? I get the following error message:
File "test.py", line 26, in test
print tbl[wi][bi]
IndexError: index must be either an int or a sequence
---code snippet
from Numeric import *
tbl = zeros((32, 16))
def test():
val = testme()
wi = crc
Hi Stelios,
Newbie here ("new" to the language and scripting in general).
I'm trying to figure out what you mean by bytecode. Do you mean
a virtual python environment that can be hosted by any anonymous
operating system? For example, you want to run Python programs on
BEOS so you crank up its ve
Harlin Seritt wrote:
When using try... except... errors don't show up. Is there a way to
force stderr despite using try...except?
"force", no. The "stderr" stuff is done by an "unhandled
exception" handler that is at the very top level, so
if you catch the exception, it will never see it to
print
[EMAIL PROTECTED] wrote:
(Further, Python has the baggage that there are no block-terminators:
i.e., no "}" or "end"s or "fi"s or "repeat"s. By adding such
terminators, we can make it a lot less ambiguous to all readers.) In
otherwords, we're basically right on track: removing the quirks of
Python,
On Fri, 1 Apr 2005 08:24:42 +0100 (BST), praba kar
<[EMAIL PROTECTED]> wrote:
>Dear All,
>I am new to Python. I want to know how to
>work with ternary operator in Python. I cannot
>find any ternary operator in Python. So Kindly
>clear my doubt regarding this
>
>
>
>__
Jeremy Bowers <[EMAIL PROTECTED]> writes:
> On Thu, 31 Mar 2005 23:30:42 -0800, Erik Max Francis wrote:
>
>> Daniel Silva wrote:
>>
>>> Shriram Krishnamurthi has just announced the following elsewhere; it might
>>> be of interest to c.l.s, c.l.f, and c.l.p:
>>> http://list.cs.brown.edu/pipermail/
"Rakesh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This gets a list sorted by the keys.
That is all you *can* get (with the list keys being the dict values).
> How would I get a revised dictionary sorted by its values.
You can't. A dictionary is not sorted. The print orde
In function test(),
Read wi and bi as:
wi = val >> 4
bi = val & 0xFL
-SB
--
http://mail.python.org/mailman/listinfo/python-list
I don't know much here...but is there an assumption you're making about
the machine word size to be greather than 24 bits?
Also, more to the point, does the function zeros() instantiate a
two-dimensional table? If so, does it populate the table with any
values? The error looks like tbl[ ][ ] doesn
Jeremy Bowers wrote:
Yes and no. In the Python community, we're taking all of that pretty
seriously. The scheme community may not seriously be thinking of getting
rid of those things, but it's hardly impossible that some people think it
might be better off without it.
Lambda is a primitive in Schem
The table initializes to a 2 dimensional with zeros.
-SB
--
http://mail.python.org/mailman/listinfo/python-list
harold fellermann <[EMAIL PROTECTED]> writes:
>> I am working on a C extension module that implements a bunch of
>> classes. Everything
>> works fine so far, but I cannot find any way to implement class
>> attributes or inner
>> classes. Consider you have the following lines of Python :
>>
>> clas
[EMAIL PROTECTED] wrote:
Hello,
What's the problem with this code? I get the following error message:
File "test.py", line 26, in test
print tbl[wi][bi]
IndexError: index must be either an int or a sequence
---code snippet
from Numeric import *
tbl = zeros((32, 16))
def test():
val = t
"praba kar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear All,
>I am new to Python. I want to know how to
> work with ternary operator in Python. I cannot
> find any ternary operator in Python. So Kindly
> clear my doubt regarding this
A unary operator has one operand
I'm trying to figure out how to test function arguments by adding a
decorator.
@decorate
def func( x):
# do something
return x
This allows me to wrap and replace the arguments with my own, but not
get the arguments that the original function received.
To do that I would need
Thanks Steve.
There's a problem with Numeric array. I tried with numarray and it
works fine.
-SB
--
http://mail.python.org/mailman/listinfo/python-list
"F. Petitjean" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I want to know if iter(iterator) returns always its argument (when
> argument is an iterator)
By the strict definition of iterator (versus iterable) that requires that
as a condition to be an iterator, then yes. If you
I think you could as well, after PyType_Ready() is called, set it
yourself with
PyObject_SetAttrString(FooType, "Bar", FooBarType);
You *may* have to cast the FooType and FooBarType to (PyObject *), to
avoid compiler warnings.
I tried this. Its shorter and and works fine, too. thanks for the
pro
I cannot import "numarray" and I cannot import "numeric" using python
2.3.3
Where would I find an equivalent definition for zeros()?
Anyway, is there supposed to be something that sets the value of
elements of tbl to values other than zero? Not that the question has
anything to do with Shama's p
Hello list,
gzip documentation states that calling the .close() method on a GzipFile
doesn't really close it. If I'm really through with it, what's the best
way to close it? I'm using Python2.2 (but the gzip module doesn't seem to
be any different from 2.4).
Here's my code snippet, if it's r
On Fri, 01 Apr 2005 18:30:56 +, Ron_Adam wrote:
> I'm trying to figure out how to test function arguments by adding a
> decorator.
The rest of your message then goes on to vividly demonstrate why
decorators make for a poor test technique.
Is this an April Fools gag? If so, it's not a very goo
[Ville Vainio]
> I need a dict (well, it would be optimal anyway) class that stores the
> keys as strings without coercing the case to upper or lower, but still
> provides fast lookup (i.e. uses hash table).
>>> class S(str):
def __hash__(self):
return hash(self.lower())
def __eq_
Hi Mark,
I was a bit surprised to find the very slow Farey approximation by
means of the class in the mxNumber package. If the goal
was to reconstruct a rational from a float it is not a good choice and
should be replaced by a continued fractions approximation. Some time
ago I implemented it by m
1 - 100 of 215 matches
Mail list logo