Edward Elliott wrote:
> Michele Simionato wrote:
> >> >>> A = [] # let's declare a "constant" here
> >> >>> b = A # and let's assign the constant here
> >> >>> b.append('1') # OOPS!
> >
> > But it makes no sense to use a mutable object for a constant!
> > The user should use a tuple,
>
> Sure.
Carl Banks wrote:
>>> q = 0
> >>> r = 0
> >>> s = 0
> >>> id(q)
> 134536636
> >>> id(r)
> 134536636
> >>> id(s)
> 134536636
>
> It is okay with constant object, really.
No:
>>> r=11
>>> s=11
>>> t=11
>>> id(r)
135620508
>>> id(s)
135620532
>>> id(t)
135104688
It worked with the num
Hello,
I am trying to run compiled Python files (*.pyc and *.pyo) using Python C
API.
I am using the method PyRun_FileFlags() for this purpose.
The code snippet is as follows:-
PyCompilerFlags myFlags;
myFlags.cf_flags=1; // I tried all values 0, 1 and 2
PyRun_FileFlags(script, file, Py_file_in
We have a vacancy for a python programmer for a 6 months assignement.
If interested, please visit www.bucodi.com
And don't worry we speak english :)
R_
--
---
Rony Steelandt
BuCodi
rony dot steelandt (at) bucodi dot com
Visit the python blog at http://360.yahoo.com/bucodi
--
http://mail.py
Wow, so, to see if I understand correctly:
>>> r = 0
>>> s = 0
>>> t = 11
>>> u = 11
>>> r == s
True
>>> t == u
True
>>> r is s
True
>>> t is u
False
>>> ... ?
what the...?
does anybody else get mighty uncomfortable about this?
s.
--
http://mail.python.org/mailman/listinfo/python-list
vdrab wrote:
> what the...?
> does anybody else get mighty uncomfortable about this?
No. Why should you ever care about whether two integers representing
values are the same object? Your tests should be with `==`, not `is`.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com
> Now, why you couldn't do "dbg.DBG = ..."? Very simple... "from
> module import *" doesn't give you a dbg /module/, it only gives you
> references to each piece inside the module.
really the reason why I wanted that should probably be solved in other
ways. I just wanted to split my dbg
Le 05-05-2006, Rony <[EMAIL PROTECTED]> nous disait:
> We have a vacancy for a python programmer for a 6 months assignement.
Hi Rony,
You may find interested people on fr.comp.lang.python and on the
python-fr mailing list (python at aful dot org), if you post your
announce (in French) on these fo
On Thu, May 04, 2006 at 12:02:52PM -0400, A.M wrote:
> Is there any efficient online resource or book that help experienced Perl
> programmers to Python?
I've been using Perl for a decade and had a hard start into Python. Mainly
because I used those "phrasebooks" and tried to convert my Perl synt
Shankar wrote:
> Hello,
>
> I am trying to run compiled Python files (*.pyc and *.pyo) using Python C
> API.
>
> I am using the method PyRun_FileFlags() for this purpose.
>
> The code snippet is as follows:-
>
> PyCompilerFlags myFlags;
> myFlags.cf_flags=1; // I tried all values 0, 1 and 2
> PyRun
vdrab wrote:
> Wow, so, to see if I understand correctly:
>
r = 0
s = 0
t = 11
u = 11
r == s
> True
t == u
> True
r is s
> True
t is u
> False
... ?
>
> what the...?
> does anybody else get mighty uncomfortable about this?
#include
int main
A.M wrote:
> Hi,
>
> Is there any efficient online resource or book that help experienced Perl
> programmers to Python?
>
My fellow coworker - experimented Perl coder - confirms that the
official tutorial and diveintopython should be enough to get you
started. Also, the Python Cookbook and read
Tim Chase wrote:
> Just as a pedantic exercise to try and understand Python a bit better, I
> decided to try to make a generator or class that would allow me to
> unpack an arbitrary number of calculatible values. In this case, just
> zeros (though I just to prove whatever ends up working, havi
> No. Why should you ever care about whether two integers representing
> values are the same object? Your tests should be with `==`, not `is`.
Given this though, what other such beauties are lurking in the
interpreter, under the name of 'implementation accidents'? One of the
things that drew me
Edward Elliott wrote:
> bruno at modulix wrote:
>
>>Edward Elliott wrote:
>>
>>>Ah, well then, there's no need for a full-blown parser. It should
>>>suffice to recognize a class definition and modify the parameter list of
>>>every def indented one level further than that.
>>
>>won't do :
>>
>>cla
Hi Diez,
No this occurs when the client is executed. Basically it runs as you
see above then terminates. It should be noted that the errors involving
the /xmpp libraries seem to change each time. I have no doubt it is
connected to that, but the error does not happen at all when I run the
client th
> beasts. It can get even worse: I can define an object (in C++ as well as in
> python) that is not even equal to itself. Not that I felt the need for that
> so far
hehe... now you've picked my curiosity... how?
ps.
def __eq__(self, other): return False
does not count !
--
http://mail.pytho
Christophe wrote:
> I think you've made a mistake in your example.
>>> constant A = []
>>> def foo(var):
... var.append('1')
... print var
...
>>> b = A
>>> foo(b)
>>> foo(b)
> > and this ?
> >
> > >>> constant A = []
> > >>> print A is A
>
vdrab wrote:
>> beasts. It can get even worse: I can define an object (in C++ as well as
>> in python) that is not even equal to itself. Not that I felt the need for
>> that so far
>
> hehe... now you've picked my curiosity... how?
>
> ps.
> def __eq__(self, other): return False
> does not c
"vdrab" wrote:
> Given this though, what other such beauties are lurking in the
> interpreter, under the name of 'implementation accidents'? One of the
> things that drew me to python is the claimed consistency and
> orthogonality of both language and implementation, not sacrificing
> clarity for
Hi.
I have tried this script:
from ctypes import cdll, c_int
from signal import SIGTERM, SIGINT
from time import sleep
msvcrt = cdll.LoadLibrary("MSVCR71") # is this the lib to use?
sig = c_int(SIGTERM)
raise_ = getattr(msvcrt, "raise")
raise_(sig)
sleep(10)
The problem is that SIGTERM causes
vdrab wrote:
>> No. Why should you ever care about whether two integers representing
>> values are the same object? Your tests should be with `==`, not `is`.
>
> Given this though, what other such beauties are lurking in the
> interpreter, under the name of 'implementation accidents'? One of th
REGISTER NOW FOR PATTERN RECOGNITION EVENTS THIS SUMMER, 2006
___
4TH INTERNATIONAL SUMMER SCHOOL ON PATTERN RECOGNITION (ISSPR, 2006)
23-28 JULY, UK
http://www.PatternRecognitionSchool.com
NEW...EXTENDED Early Bird Deadline for Registration.
New Deadline 25th May 2006! and
Rick
Thanks for your reply .. didnt quite get your point in loggin into
password protected site.
Will try to seach this group for more ..
Still looking for tab browsing and logging in password protected site
..
can i use ctype or something like that .. some modute that will
introduce key strokes
> so anything you don't understand, and cannot be bothered to look up in
> the documentation, just has to be an inconsistent ad-hoc weird-gotcha
> design ?
Does the documentation mention that "x is y" returns True when they are
both 0 but not when they are 11 ? If so, I stand corrected. *plonk
> > Given this though, what other such beauties are lurking in the
> > interpreter, under the name of 'implementation accidents'? One of the
> > things that drew me to python is the claimed consistency and
> > orthogonality of both language and implementation, not sacrificing
> > clarity for perfor
Le 05-05-2006, Diez <[EMAIL PROTECTED]> nous disait:
> The thing you observe as accident is that sometimes "0 is 0" is true just
> because of an optimization of number objects allocation. Such things happen
> in the "real" world - other examples are string-interning in e.g. the JVM
> (and I bet th
"vdrab" wrote:
> Does the documentation mention that "x is y" returns True when they are
> both 0 but not when they are 11 ?
language reference, comparisions (is operator):
The operators is and is not test for object identity: x is y is true if and
only if x and y are the same object
>
> I was just at a point when I thought I learned something but got
> confused again after trying the following and unfortunately didn't
> find an answer in the docs.
>
a = 10
b = 10
id(a)
> 134536516
id(b)
> 134536516
>
> So the two memory addesses are the same, but
>
> > I was just at a point when I thought I learned something but got
> > confused again after trying the following and unfortunately didn't
> > find an answer in the docs.
> >
> a = 10
> b = 10
> id(a)
> > 134536516
> id(b)
> > 134536516
> >
> > So the two memory addesses are th
>
language reference, objects:
"Even the importance of object identity is affected in some sense:
for
immutable types, operations that compute new values may actually
return a reference to any existing object with the same type and
value,
while for mutable objects this is not allow
That's great, thanks !
To put it short, when I create a Stimulus object, it first seek
__new__() method. But if I don't define it, it looks for the one
defined in Vector. This raises a problem because the parameters passed
to Stimulus(params) aren't fitting with Vector parameters, raising an
excep
Hi!
I need some input on my use of metaclasses since I'm not sure I'm using them in
a pythonic and graceful manner. I'm very grateful for any tips, pointers and
RTFMs I can get from you guys.
Below, you'll find some background info and an executable code example.
In the code example I have two
...I wrote something to do this once, but didn't do as good a job as I
might have done and wondered if anybody else has done it properly.
I know about nose, but it seems just a little too magical for my
tastes, and includes stuff I don't really need.
John
--
http://mail.python.org/mailman/list
vdrab wrote:
> That, I knew. What I did not know, nor get from this explanation, is
> that this behaviour "may" differ
> not only within the same implementation, but with instances of the same
> class or type (in this case, 'int').
"""
E.g., after "a = 1;
b = 1",
a and b may or may not refer
Daniel Nogradi wrote:
a = 10
b = 10
id(a)
> 134536516
id(b)
> 134536516
>
> So the two memory addesses are the same, but
>
a = 1
b = 1
id(a)
> 134604216
id(b)
> 134604252
>
> and they are not the same (I restarted the interpreter between the two
>
> """
> E.g., after "a = 1;
> b = 1",
> a and b may or may not refer to the same object with the value one,
> depending on the implementation,
> """
But when in a specific implementation this property _does_ hold for
ints having value 1, I expect the
same behaviour for ints with other valu
[EMAIL PROTECTED] wrote:
> Does anyone know where I can get python code to perform a CRC
> calculation on an IP packet?
>
Check out http://crcmod.sourceforge.net/
--
http://mail.python.org/mailman/listinfo/python-list
TG wrote:
> That's great, thanks !
>
> To put it short, when I create a Stimulus object, it first seek
> __new__() method. But if I don't define it, it looks for the one
> defined in Vector. This raises a problem because the parameters passed
> to Stimulus(params) aren't fitting with Vector parame
On Thu, 4 May 2006 13:08:52 +0200,
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> who's this, and why does he think that sampling some random comments by
> some random bloggers should mean anything to anyone ? (and why do you
> seem to think that this matters, btw ?)
Michal Wallace, the orig
Crunchy Frog is a "desktop web application" that transforms a
traditional Python web-based tutorial into an interactive session
within a browser. At present it is limited to tutorials (html files)
that are contained within a single directory on the computer where it
is run.
You can download from
Tim Chase wrote:
>
> I was hoping that there was just some __foo__ property I was
> missing that would have been called in the process of tuple
> unpacking that would allow for a more elegant solution such
> as a generator (or generator method on some object) rather
> than stooping to disassembling
I am doing a Natural Language processing project for academic use,
I think google's rich retrieval information and query-segment might be
of help, I downloaded google api, but there is query limit(1000/day),
How can I write python code to simulate the browser-like-activity to
submit more than 10k
vdrab wrote:
>> """
>> E.g., after "a = 1;
>> b = 1",
>> a and b may or may not refer to the same object with the value one,
>> depending on the implementation,
>> """
>
> But when in a specific implementation this property _does_ hold for
> ints having value 1, I expect the
> same behavio
Am Freitag 05 Mai 2006 13:37 schrieb Per:
> I think google's rich retrieval information and query-segment might be
> of help, I downloaded google api, but there is query limit(1000/day),
> How can I write python code to simulate the browser-like-activity to
> submit more than 10k queries in one day
On May 5, 2006, at 6:35 AM, John J. Lee wrote:
> ...I wrote something to do this once, but didn't do as good a job as I
> might have done and wondered if anybody else has done it properly.
>
> I know about nose, but it seems just a little too magical for my
> tastes, and includes stuff I don't re
Heiko Wundram wrote:
> Am Freitag 05 Mai 2006 13:37 schrieb Per:
>> I think google's rich retrieval information and query-segment might
>> be of help, I downloaded google api, but there is query
>> limit(1000/day), How can I write python code to simulate the
>> browser-like-activity to submit more
Yeah, Thanks Am,
I can be considered as an advanced google user, presumably.. But I am
not a advanced programmer yet.
If everyone can generate unlimited number of queries, soon the
user-query-data, which I believe is google's most advantage, will be in
chaos. Can they simply ignore some queries f
san wrote:
> Hi
>
> I am using windows xp and have installed python and win32. I am
> familiar with basic Python. I wanted to control some of the
> applications via python script.
>
> I would like to write a python script to say:
> 1. Open firefox and log on to gmail
> 2. Another firefox window to
that will break horribly in windows, remenber it install all it's crap
in c:\Program Files
--
http://mail.python.org/mailman/listinfo/python-list
> Are you telling us that you *had* read that doc,
> and tripped because it says "depending on the implementation",
> when it should say "at the choice of the implementation" ?
no.
let's see, where to start ... ?
let's say there's a certain property P, for the sake of this lng
discussion, some
I want a class method to take action depending on the type of the
arguement passed to it.
ie:
getBook(id) # get the book by ID
getBook(name) # get the book by name
...
Other languages use the term function/method overloading to cope with
this. And when I googled about it seems that GvR is testing
vdrab wrote:
>> """
>> E.g., after "a = 1;
>> b = 1",
>> a and b may or may not refer to the same object with the value one,
>> depending on the implementation,
>> """
>
> But when in a specific implementation this property _does_ hold for
> ints having value 1, I expect the
> same behavi
Paul Rubin wrote:
> bruno at modulix <[EMAIL PROTECTED]> writes:
>
>>What's wrong with:
>>
>>assert foo and bar and i > 10, \
>> "if foo and bar i must not be greater than 10"
>
>
> It doesn't necessarily do anything. With optimization enable, assert
> is a no-op.
quoting the OP (emphasis is
Am Thu, 04 May 2006 12:02:52 -0400 schrieb A.M:
> Hi,
>
>
>
> Is there any efficient online resource or book that help experienced Perl
> programmers to Python?
You can try the examples of pleac:
http://pleac.sourceforge.net/pleac_python/index.html
This is the Per Cookbook translated into s
Is it possible to have Python authenticate with Active Directory?
Specifically what I'd like to do is have a user enter a
username/password, then have Python check the credentials with AD - if
what they entered is valid, for example, it returns a 1, otherwise a
0.. Thanks!
--
http://mail.python.
Bob wrote:
> Dears,
>
> I am trying to search and replace strings with regex.
>
> The string is identified by a keyword :
>
> IDImage("1M234567");
> DescriptionImage("Desc of the Image 1");
>
> I want to exctract the IDImage (1M234567 ) and the Description.
>
> The ID are characters and number
Panos Laganakos wrote:
> I want a class method to take action depending on the type of the
> arguement passed to it.
>
> ie:
> getBook(id) # get the book by ID
> getBook(name) # get the book by name
> ...
>
> Other languages use the term function/method overloading to cope with
> this. And when
Rony Steelandt wrote:
> http://www.newscientisttech.com/article/dn9066
>
> To nice to be true ?
its early technology. It's difficult to install and it definitely need
some extra horsepower because the two people developing it are also
disabled (like me). The only thing I've done to support th
On Thu, 4 May 2006 13:19:46 -0400, "Tim Peters" <[EMAIL PROTECTED]>
wrote:
>[David C.Ullrich]
>> Would there be issues (registry settings, environment
>> variables, whatever) if a person tried to install
>> versions 1.x and 2.x simultaneously on one Windows
>> system? Windows 98, if it matters.
>>
Panos Laganakos wrote:
> I want a class method to take action depending on the type of the
> arguement passed to it.
>
> ie:
> getBook(id) # get the book by ID
> getBook(name) # get the book by name
> ...
>
> Other languages use the term function/method overloading to cope with
> this. And when
Panos Laganakos wrote:
> I want a class method to take action depending on the type of the
> arguement passed to it.
>
> ie:
> getBook(id) # get the book by ID
> getBook(name) # get the book by name
> ...
>
> Other languages use the term function/method overloading to cope with
> this. And when I
I recently got access to one of those new GooglePages and decided to
play around with it a little. I figured it would be a nice *easy* way
to get a website going. I may eventually do something more
professional, but hey, this was free in both money and time. :)
I had been thinking of releasing som
Careful of using the wrong tool for the job. Don't use Python for the sake of it unless its as a learning experience.All of the things you ask for can be done by simply using the Windows start menu to launch a shortcut with various command line options. Voila - problem solved.
On 5 May 2006 05:15
On Fri, May 05, 2006 at 05:39:08AM -0700, D wrote:
> Is it possible to have Python authenticate with Active Directory?
> Specifically what I'd like to do is have a user enter a
> username/password, then have Python check the credentials with AD - if
> what they entered is valid, for example, it ret
Is there a way that using Tkinter I can pre-render the canvas then draw
it on the screen?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 05 May 2006 05:39:08 -0700, D wrote:
> Is it possible to have Python authenticate with Active Directory?
> Specifically what I'd like to do is have a user enter a
> username/password, then have Python check the credentials with AD - if
> what they entered is valid, for example, it returns
Hi Ravi,
Do you have any idea how to perform such triigers ?
Every help is appreciated.
Ravi Teja wrote:
> No! That's not the way things work. Such code needs to run locally (in
> this case, Windows). You can run this program as a daemon on Windows
> with some nice simple remote interface (Eg: x
> I want a class method to take action depending on the type of the
> arguement passed to it.
>
> ie:
> getBook(id) # get the book by ID
> getBook(name) # get the book by name
Keyword arguments are going to be the best solution, but you'll still
have to do checks like in this example which uses
I want to remove about 5 elements from a list,which has 10
elements.
sample code like below:
>>> a=range(10)
>>> b=range(4)
>>> for x in b:
... a.remove(x)
...
>>> a
[4, 5, 6, 7, 8, 9]
when a and b is small size, it will finished quickly, but when a and b
have many elements.
such as:
Colored Code Blocks
Pudge generated documentation can contain colored code blocks, using
the rst directive
"..code-block:: Python" (an other languages supported by SilverCity).
http://pudge.lesscode.org/trac/ticket/21
http://pudge.lesscode.org/trac/changeset/126
-
Mailing List
The Pudge Maili
Hi,
This code works, but is it "appropriate" ?
l_init = False
if True == l_init and 1234 = l_value:
print 'l_value is initialized'
I know I can do this with a try but ...
Philippe
--
http://mail.python.org/mailman/listinfo/python-list
Colored Code Blocks
Pudge generated documentation can contain colored code blocks, using
the rst directive
"..code-block:: Python" (an other languages supported by SilverCity).
http://pudge.lesscode.org/trac/ticket/21
http://pudge.lesscode.org/trac/changeset/126
-
Mailing List
The Pudge Maili
[EMAIL PROTECTED] wrote:
> Is there a way that using Tkinter I can pre-render the canvas then draw
> it on the screen?
not really; the canvas is double-buffered, but it regenerates (portions of) the
buffer when necessary.
if you want to draw in a separate buffer, and use that when updating the w
I went to this webpage
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/360649
Isn't it supposed to run on the network and close the connected
machine.
Every help is appreciate,
Dennis Lee Bieber wrote:
> On 4 May 2006 09:57:15 -0700, [EMAIL PROTECTED] declaimed the
> following in comp.
Ju Hui wrote:
> I want to remove about 5 elements from a list,which has 10
> elements.
> sample code like below:
>
a=range(10)
b=range(4)
for x in b:
> ... a.remove(x)
> ...
a
> [4, 5, 6, 7, 8, 9]
>
> when a and b is small size, it will finished quickly, but when
vdrab <[EMAIL PROTECTED]> wrote:
>let's say there's a certain property P, for the sake of this lng
>discussion, something
>more or less like a class or type's property of "having immutable
>values, such that any instance with value X has a single, unique
>representation in memory and any two in
Try to use set objects:
>>> a=set(range(10))
>>> b=set(range(5))
>>> a = a - b
--
http://mail.python.org/mailman/listinfo/python-list
> but when a and b have many elements. such as:
>
a=range(10)
b=range(5)
for x in b:
>
> ... a.remove(x)
> ...
> it will very slowly.
Well, your problem is rather ambiguous. In your examples,
you're removing contiguous ranges. Thus, you should be able
to do something
On May 5, 2006, at 9:36 AM, Ju Hui wrote:
>>> a=range(10)
>>> b=range(5)
>>> for x in b:
> ... a.remove(x)
> ...
> it will very slowly. Shall I change to another data structure and
choos
> a better arithmetic?
> any suggestion is welcome.
If removal is an O(n) operation, then re
you don't have to say:
if True == l_init
it is suggested you simply say:
if l_init:
Remember the and operator requires expressions on both sides to be true
to continue. If you notice, your expression on the right side of the
'and' is an assignment and so this is forbidden (SyntaxError).
assignm
John J. Lee <[EMAIL PROTECTED]> wrote:
> "A.M" <[EMAIL PROTECTED]> writes:
>
> > Is there any efficient online resource or book that help experienced Perl
> > programmers to Python?
>
> Worry instead about how you're going to keep maintaining your Perl
> code after you've developed an allergic r
Ju Hui wrote:
> I want to remove about 5 elements from a list,which has 10
> elements.
> sample code like below:
>
a=range(10)
b=range(4)
for x in b:
> ... a.remove(x)
> ...
a
> [4, 5, 6, 7, 8, 9]
>
> when a and b is small size, it will finished quickly, but when a
> How about a listcomprehension?
>
>
> new_list = [e for e in old_list if predicate(e)]
> # Possibly you need this, too:
> old_list[:] = new_list
forgot the predicate. And you should use a set of objects to remove, as then
you'd have O(1) behavior for the in-operator
So:
to_remove = set(b)
ne
I'm sorry (typo):
l_init = False
if True == l_init and 1234 == l_value:
print 'l_value is initialized'
Note that 1234 == l_value does not get evaluated.
Philippe
vbgunz wrote:
> you don't have to say:
>
> if True == l_init
>
> it is suggested you simply say:
>
> if l_init:
>
> Reme
Philippe Martin wrote:
> Hi,
>
> This code works, but is it "appropriate" ?
>
> l_init = False
>
> if True == l_init and 1234 = l_value:
> print 'l_value is initialized'
>
> I know I can do this with a try but ...
>
> Philippe
>
>
1) You have a syntax error 1234 == l_value (note ==)
2) This
oh wow... it gets better...
>>> x = "test!"
>>> y = "test!"
>>> x is y
False
>>> x = "test"
>>> y = "test"
>>> x is y
True
>>>
... I had no clue.
I guess the take-away lesson is to steer clear from any reliance on
object identity checks, if at all possible. Are there any other such
"optimization
[EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
> I went to this webpage
>
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/360649
>
> Isn't it supposed to run on the network and close the connected
> machine.
That code uses the windows libraries on the machine it is run on to
gen
On 5 May 2006 05:23:24 -0700 in comp.lang.python, "vdrab"
<[EMAIL PROTECTED]> wrote:
>> Are you telling us that you *had* read that doc,
>> and tripped because it says "depending on the implementation",
>> when it should say "at the choice of the implementation" ?
>
>no.
>let's see, where to start
Larry Bates wrote:
> Philippe Martin wrote:
>> Hi,
>>
>> This code works, but is it "appropriate" ?
>>
>> l_init = False
>>
>> if True == l_init and 1234 = l_value:
>> print 'l_value is initialized'
>>
>> I know I can do this with a try but ...
>>
>> Philippe
>>
>>
> 1) You have a syntax
"vdrab" wrote:
> I guess the take-away lesson is to steer clear from any reliance on
> object identity checks, if at all possible. Are there any other such
> "optimizations" one should like to know about?
so in your little world, an optimization that speeds things up and saves
memory isn't reall
Philippe Martin wrote:
> Hi,
>
> This code works, but is it "appropriate" ?
appropriate for what ?-)
> l_init = False
> # corrected typo, cf other post in this thread
> if True == l_init and 1234 == l_value:
> print 'l_value is initialized'
Do this in production code, and have one of the first
> ... I had no clue.
We figured that
> I guess the take-away lesson is to steer clear from any reliance on
> object identity checks, if at all possible.
You've been told that quite a few times before that "is" is not intended for
what you used it.
Some people actually listen to what others
Tim Chase <[EMAIL PROTECTED]> wrote:
>Another attempt might be to try
>
> >>> a = [x for x in a if x not in b]
>
>However, this is still doing A*B checks, and will likely
>degrade with as their sizes increase.
Combine this with the use of sets others have suggested if the
order of a matters, ie:
Philippe Martin wrote:
(snip)
>
> l_init really is a boolean parameter and l_value a value that _might_ exist
> in a shelve.
>
> So I just want to have a parameter to a method so if the first value tested
> is false (l_init) then the second (l_value) does not get tested ... because
> it is the se
Philippe Martin wrote:
> l_init really is a boolean parameter and l_value a value that _might_ exist
> in a shelve.
>
> So I just want to have a parameter to a method so if the first value tested
> is false (l_init) then the second (l_value) does not get tested ... because
> it is the second in th
Can we have some program in Linux which shuts down the windows computer
remotely.
Every help is appreciated.
Max Erickson wrote:
> [EMAIL PROTECTED] wrote in
> news:[EMAIL PROTECTED]:
>
> > I went to this webpage
> >
> > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/360649
> >
> > Isn'
John Salerno wrote:
> Thanks. So the ftp:// is something different than actually using ftplib
> to connect to an FTP server, right? I've used both urllib and ftplib, so
> I know what they do, I just was a little unclear about whether they can
> sometimes do each other's work as well.
urllib uses
"Philippe Martin" schrieb
> Hi,
>
> This code works, but is it "appropriate" ?
>
> l_init = False
>
> if True == l_init and 1234 = l_value:
> print 'l_value is initialized'
>
> I know I can do this with a try but ...
>
I am a Python newbie, but I think working with
l_value = None
would be t
bruno at modulix wrote:
> Philippe Martin wrote:
> (snip)
>>
>> l_init really is a boolean parameter and l_value a value that _might_
>> exist in a shelve.
>>
>> So I just want to have a parameter to a method so if the first value
>> tested is false (l_init) then the second (l_value) does not ge
1 - 100 of 208 matches
Mail list logo