Hi list,
I have some binary data files which contain embedded LZO compressed
payloads mixed with normal C-struct like headers.
I would like to have the ability to LZO decompress these payloads using a
python 2.5.x script.
I was hoping that there was an up-to-date plug-and-play LZO library
availa
sajuptpm wrote:
> i want to find the loaded machine based on cpu and mem and desk
> utilization by changing this order.
>
> I created a UI using that i can change the order of item in the tuple.
> But the problem is asc and desc sorting
How about only changing the order in which the elements are
Detailed Description
-
l1 = []
l2 = [
((3,8),(1,2)),
((1,3),(1,7)),
((7,0),(1,8)),
((4,2),(1,2)),
((2,9),(9,1))
]
I need to take each item from l2 and insert into l1 with first
element(column)(3,1,7,4,2) sorted in ascending order and second
element(column)(8,3,0,2,9) so
On Tue, Sep 7, 2010 at 9:35 PM, Phlip wrote:
> Exceptions are very dangerous by themselves, because if you don't trap
> them just right they can cause side-effects.
And returning None on failure is dangerous, because if the programmer
does not take care to handle that case, the program may attemp
Got it fixed. It was a very silly mistake. mssg variable had each line with
indent. Removed the indent and it worked.
Regards,
Kurian Thayil.
On Tue, Sep 7, 2010 at 9:57 AM, Kurian Thayil wrote:
> Hi All,
>
> I am a newbie in python. Just 2-3 days old wanting to learn this amazing
> programming
On 9/7/2010 9:56 PM, Ned Deily wrote:
In article<4c87013f$0$1625$742ec...@news.sonic.net>,
John Nagle wrote:
On 9/7/2010 5:43 PM, Terry Reedy wrote:
On 9/7/2010 3:02 PM, John Nagle wrote:
There's a bug in Python 2.6's "urllib.urlencode". If you pass
in a Unicode character outside the ASCII
On Tue, 7 Sep 2010 12:46:36 -0700 (PDT), Baba
wrote:
>level: beginner
>
>word= 'even'
>dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
>
>i want to know if word is entirely composed of letters in dict2
>
>my approach:
>step 1 : convert word to dictionary(dict1)
>
>step2:
>for k in dict1.keys():
In article <4c87013f$0$1625$742ec...@news.sonic.net>,
John Nagle wrote:
> On 9/7/2010 5:43 PM, Terry Reedy wrote:
> > On 9/7/2010 3:02 PM, John Nagle wrote:
> >> There's a bug in Python 2.6's "urllib.urlencode". If you pass
> >> in a Unicode character outside the ASCII range, instead of it
> >> b
>
>
> I'm trying to rewrite a c program in python & encountered several problems.
> I have some data structures in my c program like below:
>
> typedef struct
> {
> unsigned short size;
>
> unsigned short reserved:8;
> unsigned short var_a1:2;
> unsigned short var_a2:2;
> unsign
BartC, 08.09.2010 03:45:
Getting back to the OP's code again (trivial and pointless as it might
seem), I got these results:
C (gcc 3.4.5 -O3) 0.8 secs
C (DMC-o) 2.3 secs
C (lccwin32 -O) 2.9 secs
[...]
I've seen LuaJIT in action. It's timing for this test is 1.5 secs:
forget being only 10x slower
Phlip writes:
> On Sep 7, 4:38 pm, Benjamin Kaplan wrote:
>
> > When you're using a language, you should use the style that the
> > language emphasizes.
>
> You mean like this?
>
> uri = reverse('my_uri_name', kwargs=dict(pk=record.pk))
Do you think that style is emphasised by Python? What gi
On Sep 7, 4:38 pm, Benjamin Kaplan wrote:
> When you're using a language, you should use the style that the
> language emphasizes.
You mean like this?
uri = reverse('my_uri_name', kwargs=dict(pk=record.pk))
That 'kwargs' there is ... a lapse of judgement. It is exposing a
technical detail (t
On Sep 7, 5:51 pm, Terry Reedy wrote:
> On 9/7/2010 2:53 PM, Phlip wrote:
>
> > They are for situations which the caller should care not to handle.
>
> Python is simply not designed that way. Exception raising and catching
> is a common flow-control method in Python. If you cannot stand that,
> Py
Lawrence D'Oliveiro wrote:
But alone of all of these, garbage collection still remains just as costly
to implement as ever. That should tell you something about how poorly it
matches the characteristics of modern computing hardware.
So maybe we need to redesign the hardware.
Perhaps referenc
On Sep 7, 6:23 pm, Lawrence D'Oliveiro wrote:
> Does catching the exception not defeat the “Samurai Principle”?
Read my comic:
http://c2.com/cgi/wiki?SamuraiPrinciple
Exceptions are very dangerous by themselves, because if you don't trap
them just right they can cause side-effects. They are
Lawrence D'Oliveiro wrote:
Does catching the exception not defeat the “Samurai Principle”?
Not if it lets you turn defeat into victory. Or
redefine victory so that it includes defeat.
Or something.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On 9/7/2010 5:43 PM, Terry Reedy wrote:
On 9/7/2010 3:02 PM, John Nagle wrote:
There's a bug in Python 2.6's "urllib.urlencode". If you pass
in a Unicode character outside the ASCII range, instead of it
being encoded properly, an exception is raised.
File "C:\python26\lib\urllib.py", line 1267,
On 08/09/2010 02:45, BartC wrote:
"David Cournapeau" wrote in message
news:mailman.546.1283897932.29448.python-l...@python.org...
On Sun, Sep 5, 2010 at 8:28 PM, BartC wrote:
One order of magnitude (say 10-20x slower) wouldn't be so bad. That's
what
you might expect for a dynamically type
"David Cournapeau" wrote in message
news:mailman.546.1283897932.29448.python-l...@python.org...
On Sun, Sep 5, 2010 at 8:28 PM, BartC wrote:
One order of magnitude (say 10-20x slower) wouldn't be so bad. That's
what
you might expect for a dynamically typed, interpreted language.
10/20x s
Thomas Jollans wrote:
Hmm. Modifying an object while iterating over it isn't a great idea, ever:
I wouldn't say never. Algorithms that calculate some kind of
transitive closure can be expressed rather neatly by appending
items to a list being iterated over.
You can accommodate that kind of th
In message
<74587da9-8861-4400-bbd7-1ea4f8182...@l38g2000pro.googlegroups.com>, Phlip
wrote:
> Pythonistas:
>
> The "Samurai Principle" says to return victorious, or not at all. This
> is why django.db wisely throws an exception, instead of simply
> returning None, if it encounters a "record not
On 9/7/2010 2:53 PM, Phlip wrote:
They are for situations which the caller should care not to handle.
Python is simply not designed that way. Exception raising and catching
is a common flow-control method in Python. If you cannot stand that,
Python is not for you.
--
Terry Jan Reedy
--
h
On 9/7/2010 3:02 PM, John Nagle wrote:
There's a bug in Python 2.6's "urllib.urlencode". If you pass
in a Unicode character outside the ASCII range, instead of it
being encoded properly, an exception is raised.
File "C:\python26\lib\urllib.py", line 1267, in urlencode
v = quote_plus(str(v))
U
On 9/7/2010 6:00 AM, BartC wrote:
Why should it? But if you want it, you can do it:
xrange = range
There, that wasn't hard, was it?
I think I just learned more about Python than from months of reading this
group.
So 'range' is just a class like any other. And that a class is something
you
c
Baba writes:
> However the following Wiki excerpt seems to go in my direction:
No, it doesn't. It advises that people show kindness; as I've been
arguing, that's exactly what you were shown. You haven't shown how the
information being imparted could have been fully imparted in a way
that's kinde
Will this webcast/webinar perform on Linux?
Jason
On Tue, 2010-09-07 at 14:08 -0700, Kendra Penrose wrote:
> Connecting the Dots: US SEC, ABS Mandates, Financial Modeling and Python
>
> Date: Wednesday September 22, 2010python-announce-l...@python.org,
> Time: 10:00am PST/1:00pm EST/ 17:00 UTC
>
Thanks all for your response i will try out this week, you have give
me sufficient hint.
Thanks again.
Bussiere
On Mon, Sep 6, 2010 at 9:50 AM, Niklasro(.appspot) wrote:
> On Sep 5, 10:57 pm, bussiere bussiere wrote:
>> i've got a python.txt that contain python and it must stay as it (python.txt
On Tue, Sep 7, 2010 at 6:20 PM, Phlip wrote:
> On Sep 7, 1:06 pm, Bruno Desthuilliers
> wrote:
>
>> try:
>> return Model.objects.get(pk=42)
>> except Model.DoesNotExist:
>> return sentinel
>
> Visual Basic Classic had a Collection Class, which worked essentially
> like a real language's Has
Paul Rubin wrote:
Now extrapolate that error rate from 30 lines to a program the size of
Firefox (something like 5 MLOC), and you should see how fraught with
danger that style of programming is.
But you don't write 5 MLOC of code using that programming style.
You use it to write a small core s
On 07/09/2010 22:36, Baba wrote:
On 7 sep, 22:37, MRAB wrote:
On 07/09/2010 21:06, Paul Rubin wrote:
Babawrites:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
set(word)<= set(dict2.keys())
Do the numb
On 09/07/2010 01:26 PM, Baba wrote:
On 7 sep, 22:08, Gary Herron wrote:
On 09/07/2010 12:46 PM, Baba wrote:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
Just go through each letter of word checking for its existence in
dict2. Return False if one misses, an
Bob (roberto.pagli...@gmail.com) wrote:
> Hi All,
> I have another question about formatted input. Suppose I am reading a
> text file, and that I want it to be something like this
>
> word11 = num11, word12 = num12, word13 = num13 etc...
> word21 = num21, word22 = num12, word23 = num23 etc...
> et
On Sep 7, 1:06 pm, Bruno Desthuilliers
wrote:
> try:
> return Model.objects.get(pk=42)
> except Model.DoesNotExist:
> return sentinel
Visual Basic Classic had a Collection Class, which worked essentially
like a real language's Hash, Map, or Dict.
Except - it had no operation to test membe
On Sun, Sep 5, 2010 at 8:28 PM, BartC wrote:
>
> One order of magnitude (say 10-20x slower) wouldn't be so bad. That's what
> you might expect for a dynamically typed, interpreted language.
10/20x slower than C is only reached by extremely well optimized
dynamic languages. It would be a tremendo
Phlip a écrit :
> On Sep 7, 10:36 am, Ian Kelly wrote:
>> On Tue, Sep 7, 2010 at 10:02 AM, Phlip wrote:
>>> Back to the topic, I tend to do this:
>>> for record in Model.objects.filter(pk=42):
>>> return record
>>> return sentinel
>> How is that any better than just catching the exception?
Phlip a écrit :
> On Sep 7, 10:12 am, Bruno Desthuilliers 42.desthuilli...@websiteburo.invalid> wrote:
>> Phlip a écrit :
>>
>>> Back to the topic, I tend to do this:
>>> for record in Model.objects.filter(pk=42):
>>> return record
>>> return sentinel
>> WTF alert here...
>
> I don't see
Bob writes:
> Hi All,
> I have another question about formatted input. Suppose I am reading a
> text file, and that I want it to be something like this
>
> word11 = num11, word12 = num12, word13 = num13 etc...
> word21 = num21, word22 = num12, word23 = num23 etc...
> etc...
>
> where wordx1 belon
Baba writes:
> for k in word.keys():
> if k not in hand:
> return False
> elif k in hand:
> if word[k] > hand[k]:
> return False
> return True
Untested:
all(word[k] <= hand.get(k,0) for k in word)
--
http://
Hi Rami, Stefan, Bruno.
First a big thanks for your replies.
On 07/09/2010 20:54, Rami Chowdhury wrote:
Hi Ian,
I think I see where you're going wrong -- this bit me too when I was
learning Python, having come from PHP. Unlike PHP, when you import a
module in Python it does *not* inherit th
On 7 sep, 22:37, MRAB wrote:
> On 07/09/2010 21:06, Paul Rubin wrote:
>
> > Baba writes:
> >> word= 'even'
> >> dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
>
> >> i want to know if word is entirely composed of letters in dict2
>
> > set(word)<= set(dict2.keys())
>
> Do the numbers in dict2 r
Hi All,
I have another question about formatted input. Suppose I am reading a
text file, and that I want it to be something like this
word11 = num11, word12 = num12, word13 = num13 etc...
word21 = num21, word22 = num12, word23 = num23 etc...
etc...
where wordx1 belongs to a certain dictionary of
Baba wrote:
> On 7 sep, 22:08, Gary Herron wrote:
>> On 09/07/2010 12:46 PM, Baba wrote:
>>
>> > word= 'even'
>> > dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
>>
>> Just go through each letter of word checking for its existence in
>> dict2. Return False if one misses, and True if you get th
On Wed, Sep 8, 2010 at 1:56 AM, Baba wrote:
> On 7 sep, 22:08, Gary Herron wrote:
> > On 09/07/2010 12:46 PM, Baba wrote:
> >
> > > word= 'even'
> > > dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
> >
> > Just go through each letter of word checking for its existence in
> > dict2. Return Fal
On 07/09/2010 21:06, Paul Rubin wrote:
Baba writes:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
set(word)<= set(dict2.keys())
Do the numbers in dict2 represent the maximum number of times that the
letter can
In article
,
Bob wrote:
>[...]
> The error I get is this
>
> python email.py
> Traceback (most recent call last):
> File "email.py", line 2, in
> import smtplib
> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/smtplib.py", line 46, in
> import emai
On Sep 7, 10:27 pm, Chris Rebert wrote:
> On Tue, Sep 7, 2010 at 1:12 PM, Bob wrote:
> > Hello.
> > I'm trying to send email using python 2.6.1 under snow leopard, but I
> > can't get it to work. I'm trying one of the many examples I found on
> > the web
>
> > The error I get is this
>
> > pytho
On 7 sep, 22:08, Gary Herron wrote:
> On 09/07/2010 12:46 PM, Baba wrote:
>
> > word= 'even'
> > dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
>
> Just go through each letter of word checking for its existence in
> dict2. Return False if one misses, and True if you get through the
> whole word
On Tue, Sep 7, 2010 at 1:12 PM, Bob wrote:
> Hello.
> I'm trying to send email using python 2.6.1 under snow leopard, but I
> can't get it to work. I'm trying one of the many examples I found on
> the web
> The error I get is this
>
> python email.py
> Traceback (most recent call last):
> File "
On 09/07/2010 12:46 PM, Baba wrote:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
Just go through each letter of word checking for its existence in
dict2. Return False if one misses, and True if you get through the
whole word:
def ...():
for c in word:
if c not in
Hello.
I'm trying to send email using python 2.6.1 under snow leopard, but I
can't get it to work. I'm trying one of the many examples I found on
the web
EXAMPLE 1
import smtplib
fromaddr = 'fromu...@gmail.com'
toaddrs = 'tou...@gmail.com'
msg = 'There was a terrible error that occured and I wan
Baba writes:
> word= 'even'
> dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
>
> i want to know if word is entirely composed of letters in dict2
set(word) <= set(dict2.keys())
--
http://mail.python.org/mailman/listinfo/python-list
Hi Ian,
On 2010-09-07 12:18, Ian Hobson wrote:
> f = open('d:\logfile.txt','a')
Just a note: Using a backslash in a non-raw string will get
you in trouble as soon as the backslash is followed by a
character which makes a special character sequence, like "\n".
For example,
f = open('d:\nice_
Hi Ian,
On Tue, Sep 7, 2010 at 20:00, Ian wrote:
> On 07/09/2010 11:50, Bruno Desthuilliers wrote:
>
> note the order of the above - log is defined before the import.
>
> And ? Do you think it will affect the imported module in any way ? Like,
> say, magically "inject" your log function in the
level: beginner
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
my approach:
step 1 : convert word to dictionary(dict1)
step2:
for k in dict1.keys():
if k in dict2:
if dict1[k] != dict2[k]:
On 09/07/10 13:53, Phlip wrote:
On Sep 7, 11:36 am, Tim Chase wrote:
And no it's not "much clearer". Exceptions are for catastrophic errors
that the caller should care not to handle. A "record not found" is not
a catastrophe.
Exceptions are not limited to catastrophic errors, simply
exceptio
Lawrence D'Oliveiro writes:
> But you’ll notice that Free Software comes with no such
> restrictions. In fact, it is contrary to commonly-accepted Free
> Software guidelines to impose any sort of restrictions on areas of use.
Free software comes with an explicit disclaimer of liability (you get
w
In article <4c868c2d$0$1581$742ec...@news.sonic.net>,
John Nagle wrote:
> Is it worth reporting 2.x bugs any more? Or are we in the
> version suckage period, where version N is abandonware and
> version N+1 isn't deployable yet.
Yes!! 2.7 is being actively maintained for bug fixes. (2.6 o
On 9/6/2010 11:55 PM, Stefan Behnel wrote:
Kwan Lai Cheng, 07.09.2010 06:06:
I'm trying to rewrite a c program in python& encountered several
problems. I have some data structures in my c program like below:
def __init__(self, size=0)
Any equivalent for c data structures& bit fields in pytho
There's a bug in Python 2.6's "urllib.urlencode". If you pass
in a Unicode character outside the ASCII range, instead of it
being encoded properly, an exception is raised.
File "C:\python26\lib\urllib.py", line 1267, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec
On Sep 7, 11:36 am, Tim Chase wrote:
> > And no it's not "much clearer". Exceptions are for catastrophic errors
> > that the caller should care not to handle. A "record not found" is not
> > a catastrophe.
>
> Exceptions are not limited to catastrophic errors, simply
> exceptional (not the common
On 09/07/10 12:52, Phlip wrote:
try:
return Model.objects.get(pk=42)
except Model.DoesNotExist:
return sentinel
The flow of control is much clearer this way.
It reminds me of Visual Basic.
And no it's not "much clearer". Exceptions are for catastrophic errors
that the caller should
On 9/7/2010 12:06 AM, Kwan Lai Cheng wrote:
Hi,
I'm trying to rewrite a c program in python & encountered several
problems. I have some data structures in my c program like below:
typedef struct
{
unsigned short size;
unsigned short reserved:8;
unsigned short var_a1:2;
unsigned short var_a2:2;
un
On Tue, Sep 7, 2010 at 11:52 AM, Phlip wrote:
> And no it's not "much clearer".
It's clearer because it does exactly what it says it does, unlike your
approach that masquerades as a loop.
> Exceptions are for catastrophic errors
No, they're for flagging "exceptional" states. /Errors/ are for
c
On 9/7/2010 9:24 AM, sajuptpm wrote:
I have a list of tuples.
l = [((30,50),(70)), ((50,20),(20))]
for i in range(10):
k = ((i+30,i+50),(i+70))
The (i+70) parens do nothing, as already explained to (20)
Your set of test data are not very good as they do not test all the
insertion po
On Sep 7, 11:01 am, Brian D wrote:
> In an HTML page that I'm scraping using urllib2, a \xc2\xa0
> bytestring appears.
>
> The page's charset = utf-8, and the Chrome browser I'm using displays
> the characters as a space.
>
> The page requires authentication:https://www.nolaready.info/myalertlog.
On Sep 7, 10:36 am, Ian Kelly wrote:
> On Tue, Sep 7, 2010 at 10:02 AM, Phlip wrote:
> > Back to the topic, I tend to do this:
>
> > for record in Model.objects.filter(pk=42):
> > return record
>
> > return sentinel
>
> How is that any better than just catching the exception?
>
> try:
>
On 7 sep, 16:50, Grant Edwards wrote:
> On 2010-09-07, Baba wrote:
>
> > Sloppy wording, I apologise. This should say: If you find the
> > question you're reading too easy then just don't answer. Noone is the
> > owner of a democratic forum where freedom to ask the question one
> > likes is param
On Tue, Sep 7, 2010 at 10:02 AM, Phlip wrote:
> Back to the topic, I tend to do this:
>
> for record in Model.objects.filter(pk=42):
> return record
>
> return sentinel
How is that any better than just catching the exception?
try:
return Model.objects.get(pk=42)
except Model.DoesNotExi
In article ,
Roy Smith wrote:
>
>Imagine that you're looking at some code which was written years ago, by
>people who are no longer around to answer questions. In one place, you
>see:
>
>for i in range(n):
> blah
>
>and in another, you see:
>
>for j in xrange(n):
> blah
>
>If you are truly
Hello
Learning python datetime somewhat similar to SQL type timestamp my
attempt creating a 24 h 2 months ago is
str(datetime.now () - timedelta (days = 60)) +' cron '+
str(datetime.now () - timedelta (days = 59))
Do you agree? Can I improve this declaration?
Regards
Niklas Rosencrantz
--
http:/
On Sep 7, 10:12 am, Bruno Desthuilliers wrote:
> Phlip a écrit :
>
> > Back to the topic, I tend to do this:
>
> > for record in Model.objects.filter(pk=42):
> > return record
>
> > return sentinel
>
> WTF alert here...
I don't see how anyone could WTF that. Are you pretending to be a ne
Brian D writes:
> In an HTML page that I'm scraping using urllib2, a \xc2\xa0
> bytestring appears.
>
> The page's charset = utf-8, and the Chrome browser I'm using displays
> the characters as a space.
>
> The page requires authentication:
> https://www.nolaready.info/myalertlog.php
>
> When I
Phlip a écrit :
Back to the topic, I tend to do this:
for record in Model.objects.filter(pk=42):
return record
return sentinel
WTF alert here...
Having lots of short methods helps, because return provides both
control-flow and a result value. But it abuses 'for' to mean 'if'. I
fee
In an HTML page that I'm scraping using urllib2, a \xc2\xa0
bytestring appears.
The page's charset = utf-8, and the Chrome browser I'm using displays
the characters as a space.
The page requires authentication:
https://www.nolaready.info/myalertlog.php
When I try to concatenate strings containi
On Tue, Sep 7, 2010 at 4:39 AM, Baba wrote:
> On 7 sep, 02:18, Ben Finney wrote:
>> Ben Finney writes:
>> > We value respect for people here, and that's what you've been shown
>> > consistently. But respect for opinions, or for delicacy about
>> > learning, is not welcome here.
>>
>> Sloppy word
Back to the topic, I tend to do this:
for record in Model.objects.filter(pk=42):
return record
return sentinel
Having lots of short methods helps, because return provides both
control-flow and a result value. But it abuses 'for' to mean 'if'. I
feel _rally_ guilty about that!
But I
Does anyone know of a Python module for *moderate* "time-stretching"[1]
an MP3 (or AIFF) file?
FWIW, the audio I want to time-stretch is human speech.
TIA!
~K
[1] By "moderate time stretching" I mean, for example, taking an
audio that would normally play in 5 seconds, and stretch it so that
i
On Sep 6, 10:31 pm, Steven D'Aprano wrote:
> On Tue, 07 Sep 2010 11:00:45 +1000, Ben Finney wrote:
> > If you're going to use the list of float objects, you can convert them
> > all with a list comprehension.
> [...]
> > >>> numbers_as_float = [float(x) for x in numbers_as_str]
>
> That's awfu
On 2010-09-07, Baba wrote:
> Sloppy wording, I apologise. This should say: If you find the
> question you're reading too easy then just don't answer. Noone is the
> owner of a democratic forum where freedom to ask the question one
> likes is paramount (as long of course as it is related to the
>
Hi everyone,
My name is Prashant Kumar and I wish to contribute to the Python
development process by helping convert certain existing python over to
python3k.
Is there anyway I could obtain a list of libraries which need to be
ported over to python3k, sorted by importance(by importance i mean
pac
bussiere bussiere a écrit :
i've got toto.py :
import titi
def niwhom():
pass
and titi.py :
def nipang():
pass
how can i know in titi.py that's it's toto.py that is calling titi.py
and the path of toto ?
You'd have to inspect the call stack. Not for the faint at heart...
And
w
de...@web.de writes:
> Objects can be mutable or immutable. For example, in Python, integers,
> strings, floats and tuples are immutable. That means that you can't
> change their value.
Yes. Importantly, wherever you see code that you *think* is changing the
value of an immutable object, you're t
In article ,
BartC wrote:
>"Steven D'Aprano" wrote in message
>news:4c85adfe$0$5$c3e8...@news.astraweb.com...
>>
>> xrange = range
>>
>> There, that wasn't hard, was it?
>
>I think I just learned more about Python than from months of reading this
>group.
>
>So 'range' is just a class like an
Baba writes:
> to say "Please do us a favour and at least try to figure things out on
> your own" is in my view inappropriate.
That's what the person wanted you to see. How would you prefer that
exact information to be imparted to you? How could it have been
communicated so that it was not misun
Hi Bruno,
Thanks for your quick response. I still do not understand.
On 07/09/2010 11:50, Bruno Desthuilliers wrote:
Ian Hobson a écrit :
Hi all you experts,
This has me beat. Has anyone any ideas about what might be going wrong?
This is code from within a windows service (hence no print s
sajuptpm wrote:
> On Sep 7, 7:03 pm, Peter Otten <__pete...@web.de> wrote:
>> sajuptpm wrote:
>> > i need to implement l.sort(key=lambda x:(x[0][0], -x[1][0])) in
>> > another way .I want to know what the modification needed in the 'if'
>> > check to sort this list of tuples in k[0][0] ascending
i've got toto.py :
import titi
def niwhom():
pass
and titi.py :
def nipang():
pass
how can i know in titi.py that's it's toto.py that is calling titi.py
and the path of toto ?
And
why :
bidule.py :
class bidetmusique:
pass
truc.py :
X = __import__("bidule")
why exec("X
On Sep 7, 7:03 pm, Peter Otten <__pete...@web.de> wrote:
> sajuptpm wrote:
> > i need to implement l.sort(key=lambda x:(x[0][0], -x[1][0])) in
> > another way .I want to know what the modification needed in the 'if'
> > check to sort this list of tuples in k[0][0] ascending and k[0][1]
> > descend
On Tue, Sep 7, 2010 at 6:56 AM, Bruno Desthuilliers
wrote:
> Phlip a écrit :
>>>
>>> How does that compare to, say, the "Kamikaze Principle"? ;)
>>
>> Return victorious AND not at all!
>>
>> (All return values are packed up and thrown...;)
>
> ... and then it raises a SystemError !-)
general prot
Baba writes:
> Hi
>
> I am working on an exercise which requires me to write a funtion that
> will check if a given word can be found in a given dictionary (the
> hand).
>
> def is_valid_word(word, hand, word_list):
> """
> Returns True if word is in the word_list and is entirely
> co
sajuptpm wrote:
> i need to implement l.sort(key=lambda x:(x[0][0], -x[1][0])) in
> another way .I want to know what the modification needed in the 'if'
> check to sort this list of tuples in k[0][0] ascending and k[0][1]
> descending.
It seems you are not getting any closer to your goal. Perhap
Ian Hobson a écrit :
(snip)
you may also want to read the recent "using modules" thread...
--
http://mail.python.org/mailman/listinfo/python-list
Phlip a écrit :
How does that compare to, say, the "Kamikaze Principle"? ;)
Return victorious AND not at all!
(All return values are packed up and thrown...;)
... and then it raises a SystemError !-)
--
http://mail.python.org/mailman/listinfo/python-list
Baba a écrit :
Hi
I am working on an exercise which requires me to write a funtion that
will check if a given word can be found in a given dictionary (the
hand).
def is_valid_word(word, hand, word_list):
"""
Returns True if word is in the word_list and is entirely
composed of letter
Baba a écrit :
(snip)
If i had
received a friendly response from Benjamin (as opposed to "Please do
us a favor and at least try to figure things out on your own")
According to usenet standards and given your initial question, this is a
_very_ friendly answer.
--
http://mail.python.org/mailman
> How does that compare to, say, the "Kamikaze Principle"? ;)
Return victorious AND not at all!
(All return values are packed up and thrown...;)
--
http://mail.python.org/mailman/listinfo/python-list
I have a list of tuples.
l = [((30,50),(70)), ((50,20),(20))]
for i in range(10):
k = ((i+30,i+50),(i+70))#suppose creating new tuple in each iteration
using some random value and in sert it into list.
flag=True
for i, v in enumerate(l):
if v >= k:
On 7 September 2010 22:05, Baba wrote:
>
> It would be great if someone could give me a brief explanantion of the
> mutation concept.
>
In this case, to mutate is to change. If you must not mutate the list, you
must not change it.
In another words, reading from the list is fine. Writing to it i
Hi All,
Pydev 1.6.2 has been released
Details on Pydev: http://pydev.org
Details on its development: http://pydev.blogspot.com
Release Highlights:
---
* Pydev is now also distributed with Aptana Studio 3, so it can be
gotten in a version that doesn't require installi
In article ,
"BartC" wrote:
> (BTW why doesn't Python 3 just accept 'xrange' as a
> synonym for 'range'?)
If you've ever tried to maintain a legacy code base, you'll understand
why "there's only one way to do it" is A Good Thing.
Imagine that you're looking at some code which was written yea
1 - 100 of 118 matches
Mail list logo