comp.lang.python - 24 new messages in 14 topics - digest
comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en
comp.lang.python@googlegroups.com
Today's topics:
* xml.sax parsing elements with the same name - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/6afb5c844891caeb?hl=en
* Python 3: Plist as OrderedDict - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/07b43686e015995c?hl=en
* காதல் _ வள்ளுவன் கூற்று ( Love _ Accordig to thiruvalluvar) - 1 messages, 1
author
http://groups.google.com/group/comp.lang.python/t/6142f6ccde5d26bf?hl=en
* Modifying Class Object - 5 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/fd36962c4970ac48?hl=en
* equivalent of Ruby's Pathname? - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/f580fb3763208425?hl=en
* Call for Paper The International Journal of Computer Science (IJCS) - 1
messages, 1 author
http://groups.google.com/group/comp.lang.python/t/55cb3f5b4cbe9dd5?hl=en
* ctypes Structure serialization - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/bcf45281f1ca669a?hl=en
* use strings to call functions - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/87c34eb48790eda2?hl=en
* Simple question about Queue.Queue and threads - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/032256dd608c9c02?hl=en
* Python Logic Map/Logic Flow Chart. (Example Provided) - 2 messages, 2
authors
http://groups.google.com/group/comp.lang.python/t/3c3ef3cbc908b872?hl=en
* ANN: obfuscate - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/6374e775e474ee1a?hl=en
* New product collection - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/b43417240d6771d7?hl=en
* C/C++ Import - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/ca2e6428c406e538?hl=en
* Hurry Up,Free Check of $367 With Your Name. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/6f194dc05b407473?hl=en
==============================================================================
TOPIC: xml.sax parsing elements with the same name
http://groups.google.com/group/comp.lang.python/t/6afb5c844891caeb?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 8 2010 8:40 pm
From: dontcare
If you are using jython, then you might also want to consider VTD-XML,
which is
a lot easier to use and faster than SAX, native XPath support may be
useful too
http;//vtd-xml.sf.net
On Jan 12, 12:13 am, Stefan Behnel <stefan...@behnel.de> wrote:
> amadain, 11.01.2010 20:13:
>
>
>
>
>
> > I have an event log with 100s of thousands of entries with logs of the
> > form:
>
> > <event eventTimestamp="2009-12-18T08:22:49.035"
> > uniqueId="1261124569.35725_PFS_1_1340035961">
> > <result value="Blocked"/>
> > <filters>
> > <filter code="338" type="Filter_Name">
> > <diagnostic>
> > <result value="Triggered"/>
> > </diagnostic>
> > </filter>
> > <filter code="338" type="Filter_Name">
> > <diagnostic>
> > <result value="Blocked"/>
> > </diagnostic>
> > </filter>
> > </filters>
> > </event>
>
> > I am usingxml.saxto parse the event log.
>
> You should give ElementTree's iterparse() a try (xml.etree package).
> Instead of a stream of simple events, it will give you a stream of
> subtrees, which are a lot easier to work with. You can intercept the event
> stream on each 'event' tag, handle it completely in one obvious code step,
> and then delete any content you are done with to safe memory.
>
> It's also very fast, you will like not loose muchperformancecompared toxml.sax.
>
> Stefan- Hide quoted text -
>
> - Show quoted text -
==============================================================================
TOPIC: Python 3: Plist as OrderedDict
http://groups.google.com/group/comp.lang.python/t/07b43686e015995c?hl=en
==============================================================================
== 1 of 3 ==
Date: Mon, Feb 8 2010 8:47 pm
From: Terry Reedy
On 2/8/2010 11:02 PM, Gnarlodious wrote:
> I am trying to read a *.plist into Python 3's OrderedDict but can't
> figure it out. Saying something like this:
>
> from plistlib import readPlist
As a general note, include a link or something when discussing a
relatively obscure module that seems not to even be listed in pypi.
> dict=readPlist('/path/file.plist')
Redefining a basic builtin name like 'dict' is usually a bad idea.
> --> arbitrarily ordered dictionary compared to the XML file
>
> from collections import OrderedDict
> OrderedDict(readPlist('/path/file.plist'))
> --> essentially does the same thing as the previous
> readPlist seems to do the scrambling, is this a non-implementation in
> Python 3.1?
>
> I "upgraded" to Py3 to have OrderedDict, so please don't say it is
> impossible...
I agree with Benjamin -- check the source. Is plistlib 3.x ready?
Terry Jan Reedy
== 2 of 3 ==
Date: Mon, Feb 8 2010 10:47 pm
From: Ned Deily
In article <hkqpci$f7l$1@ger.gmane.org>, Terry Reedy <tjreedy@udel.edu>
wrote:
> On 2/8/2010 11:02 PM, Gnarlodious wrote:
> > I am trying to read a *.plist into Python 3's OrderedDict but can't
> > figure it out. Saying something like this:
> > from plistlib import readPlist
> As a general note, include a link or something when discussing a
> relatively obscure module that seems not to even be listed in pypi.
http://docs.python.org/library/plistlib.html
--
Ned Deily,
nad@acm.org
== 3 of 3 ==
Date: Mon, Feb 8 2010 11:15 pm
From: Raymond Hettinger
On Feb 8, 8:02 pm, Gnarlodious <gnarlodi...@gmail.com> wrote:
> I am trying to read a *.plist into Python 3's OrderedDict but can't
> figure it out. Saying something like this:
...
> I "upgraded" to Py3 to have OrderedDict, so please don't say it is
> impossible...
You may be able to monkey patch an OrderedDict into the PlistParser.
Here's an untested stab at it:
from collections import OrderedDict
import plistlib
plistlib._InteralDict = OrderedDict
Raymond
==============================================================================
TOPIC: காதல் _ வள்ளுவன் கூற்று ( Love _ Accordig to thiruvalluvar)
http://groups.google.com/group/comp.lang.python/t/6142f6ccde5d26bf?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 8 2010 8:54 pm
From: friend a
1தான்விரும்பும் காதலர் தன்னை விரும்பும் பேறுபெற்றவர் காதலின் விதையற்ற
கனியைப் பெற்றவர் ஆவார்.
2 காதலர் செலுத்துகின்ற அன்பு எதைப் போன்றது?
வாழ்வார்க்கு வானம் பயந்தற்றால் வீழ்வார்க்கு வீழ்வார் அளிக்கும்
அளி. 1192
தன்னை விரும்புபவர்க்கு காதலர் செலுத்துமன்பு உயிர் வாழ்கின்றவர்க்கு
மேகம் மழைபொழிந்து காப்பது போன்றதாகும். Meet your lover go to
http://123maza.com/50/kavi46/ (free to sing up)
==============================================================================
TOPIC: Modifying Class Object
http://groups.google.com/group/comp.lang.python/t/fd36962c4970ac48?hl=en
==============================================================================
== 1 of 5 ==
Date: Mon, Feb 8 2010 9:12 pm
From: "Alf P. Steinbach"
* Terry Reedy:
> On 2/8/2010 2:10 PM, Alf P. Steinbach wrote:
>
>> I apologize for assuming that "pointer" is a known word to [c.l.p.]
>> denizens.
>
> It is irrelevant.
>
> Python calls Python functions by associating argument objects (or
> objects derived therefrom) with paramenter names, very much like
> assigment statements.
Well, part of the above is word-play. When a name refers to an object elsewhere
and that reference can be copied around, then it is a pointer to the object in
e.g. the Java sense, which I very purposefully referenced to be clear about it.
So you're saying that X is irrelevant in Python because Python uses Y, where Y
is a description of X...
But part of what you write puzzles me.
As far as the language spec is concerned the argument passing mechanism seems to
me to be identical to assignments, not just "very much like".
Your phrase "or objects derived therefrom" seems to imply that immutable objects
can be copied (an optimization that once was rejected), but as far as I can see
the language spec only talks about binding with no provision for binding to do
anything else than making a name refer directly to a specified object,
presumably with *the same id*.
Not talking about things built on top of argument passing like *, and not
talking about scopes or other (in this context) extraneous details: is there
something I've overlooked in the basic mechanism?
> If one understands Python objects, names, and assignment statements,
> which one must to understand Python, this completely explains the
> function calls, function execution, and its effect on passed objects.
Yes.
There are many ways to understand it though.
The simplest description, reality, that names refer to objects, where those
references can be copied, i.e. that they in e.g. the Java sense are pointers to
objects, seems to be simplest -- and is certainly shortest. :-)
> All Python expressions evaluate to an object. Call expressions evaluate
> to the object returned by the function.
>
> Different interpreters implement call and return differently. Certainly,
> most humans do not use C pointers when they mentally execute Python code.
The Java language spec reference for "pointer" was to avoid arguments about
irrelevant specialized meanings of the term, such as C pointers.
Cheers & hth.,
- Alf
== 2 of 5 ==
Date: Mon, Feb 8 2010 9:38 pm
From: Steven D'Aprano
On Tue, 09 Feb 2010 05:01:16 +0100, Alf P. Steinbach wrote:
> * Stephen Hansen -> Alf P. Steinbach:
>>
>> [snip]
>> To say, "pass by value" implies things to people. It describes a sort
>> of world where I'm a function about to do some work, and on my desk I
>> have a series of boxes with names on it. It describes an environment
>> where someone comes over and drops something into each of my boxes. The
>> contents of these boxes are mine alone!
>
> Then, when the imprecision makes people misunderstand, one should not
> say that.
>
> One should then be more precise.
>
> One should say /what/ is passed by value.
I don't see how that matters. Python's behaviour is EXACTLY the same, no
matter what you pass to the function.
You don't pass pointers in Python, because you, the Python author, have
no way of specifying a pointer in Python code. It is *always* an object
that you pass, by giving a literal, the name an object is bound to, or
some other expression that returns an object:
function( my_object )
function( 12345 )
function( ham(3) + spam(5) )
If you're talking to the person who writes Python code, then you should
discuss the sorts of things that exist in Python: objects and names and
expressions, but no pointers.
If you're talking about the Python virtual machine, instead of the high-
level Python code, then you should say so -- but there are still no
pointers in the VM. Look at the output of dis.dis and you will see
objects pushed onto a stack, but no pointers.
It's not until you get past the level of Python code, past the virtual
machine, and into the implementation of the virtual machine, that you
will finally find pointers.
But why stop there? If somebody asks you a question about Python, and you
choose to ignore them and answer a different question about one
particular implementation's internals instead, I don't see why you stop
there. Why not go down another layer and talk about copying bytes, or two
layers and answer that Python does call-by-bit-flipping, or a layer below
that and say it's all done by varying potential differences?
You shouldn't expect your listener to understand machine code to
understand Python's high-level behaviour, nor should you expect them to
be C coders. You don't need to understand pointers to understand a
language that doesn't support them.
[...]
> The terms apply very well to Java. And Java has the identical parameter
> passing mechanism for class type objects. Hence, the argument is bogus.
Everything I've said applies to Java as well, and the argument about call-
by-whatever is just as prevalent in Java circles as in Python.
Example #1:
Q: If Java uses the pass-by reference, why won't a swap
function work?
A: Your question demonstrates a common error made by Java
language newcomers. Indeed, even seasoned veterans find
it difficult to keep the terms straight.
Java does manipulate objects by reference, and all
object variables are references. However, Java doesn't
pass method arguments by reference; it passes them by
value.
http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html
Example #2:
Myth: "Objects are passed by reference, primitives are
passed by value"
Some proponents of this then say, "Ah, except for immutable
objects which are passed by value [etc]" which introduces
loads of rules without really tackling how Java works.
http://www.yoda.arachsys.com/java/passing.html
Example #3:
Java is Pass-by-Value, Dammit!
http://javadude.com/articles/passbyvalue.htm
Java programmers suffer for a bad mental model just as much as Python
programmers.
All this is because of two conceptual mistakes: (1) the Java community
has conflated the internals of what happens in the implementation of the
Java VM with high-level Java code; and (2) a refusal to accept that there
are calling strategies other than pass-by-value and pass-by-reference.
--
Steven
== 3 of 5 ==
Date: Mon, Feb 8 2010 10:28 pm
From: Dennis Lee Bieber
On Mon, 8 Feb 2010 19:17:48 -0800, Stephen Hansen
<apt.shansen@gmail.com> declaimed the following in
gmane.comp.python.general:
> On Mon, Feb 8, 2010 at 7:07 PM, MRAB <python@mrabarnett.plus.com> wrote:
> >> Bruce would be less confusing. :-)
>
> I've heard that, and can't fathom the claim. I've only ever met a single
> Bruce in my entire life, though I've seen a couple on the 'net. Maybe its
> geographical, and Bruce's just don't like California? I dunno.
>
Isn't Bruce a shark? http://www.imdb.com/character/ch0003722/ and
http://www.fishingfury.com/20090817/bruce-the-shark/
We seem to have a few sharks around at times...
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
== 4 of 5 ==
Date: Mon, Feb 8 2010 10:35 pm
From: "Alf P. Steinbach"
* Stephen Hansen:
> On Mon, Feb 8, 2010 at 8:01 PM, Alf P. Steinbach <alfps@start.no
> <mailto:alfps@start.no>> wrote:
>
> * Stephen Hansen -> Alf P. Steinbach:
>
>
> [snip]
>
> To say, "pass by value" implies things to people. It describes a
> sort of world where I'm a function about to do some work, and on
> my desk I have a series of boxes with names on it. It describes
> an environment where someone comes over and drops something into
> each of my boxes. The contents of these boxes are mine alone!
>
>
> Then, when the imprecision makes people misunderstand, one should
> not say that.
>
> One should then be more precise.
>
> One should say /what/ is passed by value.
>
>
> No.
>
> One should not use the phrase that is fundamentally imprecise.
>
> The phrase "pass by value" means something different then the phrase
> "pass by object" aka "pass by sharing". They are in many cases very
> similar. They are not the same.
Right.
"pass by value" is a lower level notion.
And as you show below, in the paragraph marked [1], it can be used to describe
call by sharing very succinctly and precisely, just as I did... ;-)
> Using it is simply wrong. There is
> really no legitimate argument you can make otherwise: even in languages
> where call-by-value IS the norm, the phrase is imprecise enough to
> confuse people, as the semantics of what call-by-value mean to a
> language vary. But those semantics do NOT apply to Python.
In a way that's right, but only at the level of abstraction of pass by sharing.
At that level it's wrong to say that pass by sharing is pass by value (as they
reportedly do over in Java-land), just as, at that level, it's wrong to say that
pass by reference is pass by value notwithstanding that some kind of value must
be copied in the internal implementation.
Describing pass by sharing in terms of pass by value is however very simple and
legitimate, involving a higher level described in terms of a lower level -- as
you illustrate right below: <g>
> [snip]
> I know you already know this, but the point is: you're -hurting-
> other peoples understanding by using terms like this that don't
> apply to Python's specific nature.
> The terms apply very well to Java. And Java has the identical
> parameter passing mechanism for class type objects. Hence, the
> argument is bogus.
>
>
> [1] Java uses silly terminology; and that it chooses to use silly
> terminology in no way impacts the validity of the argument. Java isn't
> an authority. Python's been around longer! And the specific behavior
> here, "call by value where the value is an object reference" was named
> "call by sharing" back in the 1970's by Liskov.
Yep.
As you write, "call by sharing" can be described as "call by value where the
value is an object reference".
Althuogh I'd rather use "where the value is an object pointer", because the word
"pointer" already denotes a copyable value so doesn't make the head spin...
> Java isn't call-by-value (for objects) either, even if that phrase is
> common in the Java community.
Right, and here the parenthesis (for objects) establishes which abstraction level.
> C is call-by-value. VB is, I believe,
> call-by-value -- though I may be wrong here, as I only sort of blinked
> at VB a long, long time ago.
Full VB supports both call by sharing and call by reference.
> Its distinct. Its different. Its neither call-by-value, nor
> call-by-reference. The /value/ of a thing is NOT its identity. Its the
> /state/ of that thing.
Talking about a reference value (a.k.a. pointer), as you do earlier above in
[1], does not mean that one is talking about a Python object value.
So essentially the paragraph immediately above seems to be a confusion based on
multiple meanings of "value", unless it's just a description of Python objects?
> By your argument, call-by-reference is call-by-value too! Because you're
> passing "a value" -- but you're -always- going to pass some piece of
> data, otherwise you're not actually passing anything.
No, whatever you think my argument is (no quote, so I'm left in the dark about
that assumption) here you're back to confusing levels of abstraction again.
Call by reference is necessarily, at some level, implemented in terms of call by
value.
That doesn't make call by reference the same as call by value, not more than the
human body is one giant molecule just because it consists of molecules.
> The /by value/ vs /by reference/ vs /by sharing/ is not about "is a
> value being passed", in all cases, "a value" is. By Value means a copy
> of the thing is made. By Reference means you're accessing the callers
> variable directly. By Sharing means you're both sharing the same object.
Yes, violent agreement.
> PS: I cannot see any of your postings on Usenet. So I just sort of
> grabbed this from GMane and posted to Usenet. Hopefully you'll see
> it back at the list. :-)
>
>
> I've heard that before, and have no idea why, nor any real interest in
> solving it: I don't want to read cpl via Usenet, and prefer to read it
> as a mailing list. Somewhere between Gmail->python.org->python.org
> <http://python.org>'s usenet server->the world, some people don't seem
> to get my posts. Yet it shows up on some news servers, not others.
>
> No idea. Nothing I know of can solve it.
Not sure, but perhaps it's possible to mail directly to gmane?
Cheers & hth.,
- Alf
== 5 of 5 ==
Date: Mon, Feb 8 2010 11:19 pm
From: "Alf P. Steinbach"
* Steven D'Aprano:
> On Tue, 09 Feb 2010 05:01:16 +0100, Alf P. Steinbach wrote:
>
>> * Stephen Hansen -> Alf P. Steinbach:
>>> [snip]
>>> To say, "pass by value" implies things to people. It describes a sort
>>> of world where I'm a function about to do some work, and on my desk I
>>> have a series of boxes with names on it. It describes an environment
>>> where someone comes over and drops something into each of my boxes. The
>>> contents of these boxes are mine alone!
>> Then, when the imprecision makes people misunderstand, one should not
>> say that.
>>
>> One should then be more precise.
>>
>> One should say /what/ is passed by value.
>
> I don't see how that matters. Python's behaviour is EXACTLY the same, no
> matter what you pass to the function.
>
> You don't pass pointers in Python, because you, the Python author, have
> no way of specifying a pointer in Python code. It is *always* an object
> that you pass, by giving a literal, the name an object is bound to, or
> some other expression that returns an object:
>
> function( my_object )
> function( 12345 )
> function( ham(3) + spam(5) )
Every name and literal above (and in Python generally) stands for a copyable
reference to an object, not for the object itself. You can copy the reference:
a = [123]
b = a
assert( a is b ) # Doesn't matter if mutable or immutable or what.
A copyable reference is a pointer. That is, a "pointer", in e.g. the Java sense,
and in the general language independent sense, means a copyable reference --
as illustrated e.g. in the Stanford computer science 101 course page I
referred you to earlier, with C versus Java pointers illustrated in the concrete.
Hence, since every name and literal above stands for a copyable reference, and
since a copyable reference is a pointer, every name and literal above stands for
a pointer -- that's /all/ that you handle directly in Python, namely pointers.
But if that terminology sounds bad or has too strong C-vibes or Java-vibes or
whatever, then we just need some other term for a Python "copyable reference".
> If you're talking to the person who writes Python code, then you should
> discuss the sorts of things that exist in Python: objects and names and
> expressions, but no pointers.
Well, given this terminology debate we may need some other term.
But IMHO the horse drawing the wagon needs to be mentioned to the potential
wagon driver, whatever that horse is called -- fourfooter, drawing-animal...
Anything else seems just senseless, meaningless abstraction, replacing one
simple single concept with a load of connections and special case rules.
> If you're talking about the Python virtual machine, instead of the high-
> level Python code, then you should say so -- but there are still no
> pointers in the VM. Look at the output of dis.dis and you will see
> objects pushed onto a stack, but no pointers.
I don't think you will see any Python objects pushed on the stack. But you will
see copyable object references pushed on the stack. That is, you will see
pointers pushed on the stack.
> It's not until you get past the level of Python code, past the virtual
> machine, and into the implementation of the virtual machine, that you
> will finally find pointers.
There too.
> But why stop there? If somebody asks you a question about Python, and you
> choose to ignore them and answer a different question about one
> particular implementation's internals instead, I don't see why you stop
> there. Why not go down another layer and talk about copying bytes, or two
> layers and answer that Python does call-by-bit-flipping, or a layer below
> that and say it's all done by varying potential differences?
I think a good professional programmer knows about all these levels.
Unfortunately, at least about 10 years ago students fresh out of college in
Norway did not know about "internal" things such as call stacks, which led them
to adopt many Unholy Programming Practices and to be Extremely Baffled by things
such as stack traces.
> You shouldn't expect your listener to understand machine code to
> understand Python's high-level behaviour, nor should you expect them to
> be C coders. You don't need to understand pointers to understand a
> language that doesn't support them.
From the above comments it seems you're thinking about C pointers. To prevent
that misconception I've defined the term "pointer" in every or most every
posting I've made in this thread, including this posting. I've also posted a
link to a Stanford University page with a simple-words explanation (they even
have an animated Bunny video, although I've not looked at it); it's CS 101.
You don't have anything /but/ pointers in Python.
So pointers are key -- by whatever name.
[snip]
> Java programmers suffer for a bad mental model just as much as Python
> programmers.
Yes. :-)
> All this is because of two conceptual mistakes: (1) the Java community
> has conflated the internals of what happens in the implementation of the
> Java VM with high-level Java code; and (2) a refusal to accept that there
> are calling strategies other than pass-by-value and pass-by-reference.
I'm not entirely sure about causes, but there is a tendency in general for
humans to go from one extreme to another that they regard as "opposite". Using
the term "call by value" for the Java (and Python) parameter passing is just
Wrong(TM), at least without a clear understanding of what can be passed. Using
"call by value" in a description of that model, mentioning very clearly what's
passed, is on the other hand very practical: it's short, succinct & correct.
Cheers & hth.,
- Alf
==============================================================================
TOPIC: equivalent of Ruby's Pathname?
http://groups.google.com/group/comp.lang.python/t/f580fb3763208425?hl=en
==============================================================================
== 1 of 2 ==
Date: Mon, Feb 8 2010 9:21 pm
From: Phlip
Carl Banks wrote:
> I don't know if it was the reason it was rejected, but a seriously
> divisive question is whether the path should be a subset of string.
OMG that's nothing but the OO "circle vs ellipse" non-question. Glad
to see the Committee derailed a perfectly good library over such
sophistry.
> Under ordinary circumstances it would be a poor choice for inheritance
> (only a few string methods would be useful fot a pathname), but some
> people were fiercely adamant that paths should be passable to open()
> as-in (without having to explicity convert to string).
That's just silly. To be object-based, you should say path.open('r').
fopen() and its ilk are too 1960s...
My 5th Grade science teacher, one Eunice Feight, once expressed
chagrin for submitting a proposal to Readers' Digest, and getting it
accepted. She sold them the following sloka:
Don't be clever don't be witty
Or you'll wind up BEING the Committee!
--
Phlip
http://penbird.tumblr.com/
== 2 of 2 ==
Date: Mon, Feb 8 2010 10:55 pm
From: Gregory Ewing
Carl Banks wrote:
> I don't remember if the idea of modifying open to accept path
> objects came up.
It wouldn't just be open() that people would want modified --
it would be every other function that takes a pathname as
well.
I seem to recall another point of contention was whether
path objects should have methods for accessing the file
system (opening files, renaming them, etc.) or whether it
should confine itself to representing and manipulating
pathnames.
In any case, introducing any kind of path object at this
late stage of the language's development would result in
More Than One Way to represent pathnames, with neither of
them being the obvious choice.
--
Greg
==============================================================================
TOPIC: Call for Paper The International Journal of Computer Science (IJCS)
http://groups.google.com/group/comp.lang.python/t/55cb3f5b4cbe9dd5?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 8 2010 9:35 pm
From: editor ijcs
Call for Paper
The International Journal of Computer Science (IJCS) publishes
original papers on all subjects relevant to computer science,
communication network, and information systems. The highest priority
will be given to those contributions concerned with a discussion of
the background of a practical problem, the establishment of an
appropriate model, the determination of a solution, approximate or
exact, analytical or numerical, and a discussion of the relevance of
the results when applied to the real-life problem. Paper submissions
are invited in the area of computer science, in particular the
technological advances and research results in the fields of
theoretical, experimental, applied electronics, computer science,
communication network and Information technology.
Topics of interest include but are not limited to the following:
Computer Science
* Parallel Processing and Distributed Computing
* Foundations of High-performance Computing
* Graph Theory and Analysis of Algorithms
* Artificial Intelligences and Pattern/Image Recognitions
* Neural Networks and Biomedical Simulations
* Virtual Visions and Virtual Simulations
* Data Mining, Web Image Mining and Applications
* Data Base Management & Information Retrievals Adaptive Systems
* Bifurcation, Biocybernetics & Bioinformatics
* Blind Systems, Neural Networks &Control Systems
* Cryptosystems &Data Compression
* Evolutional Computation &Fuzzy Systems
* Image Processing and Image Recognition, Modeling & Optimization
* Speech Processing, Speech Synthesis & Speech Recognition
* Video Signal Processing, Watermarking & Wavelet Transform
* All topics related Computer Science
Communication Network
* Quantum Computing & Coding
* Error Controls Agent Computing & Multi-Agents Systems
* Defining Spectrum Rights and Open Spectrum Solutions
* Quality of Services and Communication Protocols
* Satellite and Optical Communication Systems
* 3G/4G Network Evolutions & CDMA/GSM Communication Protocols
* Mobile Computing, Transmission/Switching/Distribution
technologies
* Communication Theory & Signal Processing for Communications
* Wireless Communications, Wireless & Mobile Networking
* Optical Networks and Systems &Next-Generation Networking and
Internet
* Communication QoS &Reliability and Modeling
* Ad-hoc, Sensor & Mesh Networking
* Multimedia Services, Communication Software & Services
* Communication and Information System Security
* System control and network/service management
* Network and Internet protocols and standards
* Client-server, distributed & Web-based communication systems
* Broadband and multimedia systems & applications
* Trials of advanced systems and services
* Any topics related Communication Network
Information and Systems
* Cryptography and Foundation of Computer Security
* Authentication/Authorization Issues
* IDS/Firewall, Anti-Spam mail & Anti-virus issues
* Biometric authentication & algorithms
* Fingerprint /Hand/Biometrics Recognitions and Technologies
* IC-card Security, OTP & Key Management Issues
* E-commerce, Ubiquitous & RFID Applications
* Metadata, Meta Modeling, XML & Data Management
* Knowledge Management, Web Security & Privacy
* Cyber Threats, Web Services & Web Engineering
* Web Intelligence, Protocols & Standards
* Proxies and Servers
* Multimedia Applications
* Ontology and the Semantic Web
* B2B, B2C and C2C
* E-Business System Design and Development, E-Payment
* Portal Strategies, Social Networks and Information Systems
* Social and Legal Issues and Digital Ecology
* E-Governance, E-Learning and Virtual Classrooms
* E-Entertainment, E-Journalism
* Any topics related Information systems
Electronics
* Circuits & Devices
* Communication Networks & Systems
* Communications & Information Processing
* Digital Signal Processing & Electrical Engineering
Communications
* Electromagnetics & Microwaves
* Instrumentation
* Measurement & Testing
* Nanoscience & Nanotechnology
* Optics & Optoelectronic Effects
* Devices, Systems &Semiconductors
* Systems & Control Engineering
* Telecommunications
* Any topics related Electronics
International Journal of Computer Science (IJCS)
ISSN: 1884-9083
Website: https://sites.google.com/site/ijcsorg/
Manuscript submission to: ijcsorgeditor@gmail.com
All submitted papers will be judged based on their quality by the
technical committee and reviewers. Papers that describe research and
experimentation are encouraged. All paper submissions will be handled
electronically and detailed instructions on submission procedure are
available on IJCS web pages. Researchers and authors are invited to
participate in the peer-review process of IJCS papers if your research
interest matches with the themes of Call for Papers. For other
information, please contact IJCS Managing Editor.
==============================================================================
TOPIC: ctypes Structure serialization
http://groups.google.com/group/comp.lang.python/t/bcf45281f1ca669a?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 8 2010 9:43 pm
From: Lawrence D'Oliveiro
In message <615b1271-a9b0-4558-8e45-
e4370698d96a@a16g2000pre.googlegroups.com>, rych wrote:
> I'm not quite familiar with python serialization but the picle module,
> at least, doesn't seem to be able to serialize a ctypes Structure with
> array-fields.
Remember that a ctypes structure is supposed to represent a lower-language-
level structure, which is just a block of bytes. Those bytes are the
serialization.
==============================================================================
TOPIC: use strings to call functions
http://groups.google.com/group/comp.lang.python/t/87c34eb48790eda2?hl=en
==============================================================================
== 1 of 3 ==
Date: Mon, Feb 8 2010 10:00 pm
From: OdarR
On 9 fév, 02:50, Jean-Michel Pichavant <jeanmic...@sequans.com> wrote:
> Aahz wrote:
> > In article <0efe23a6-b16d-4f92-8bc0-12d056bf5...@z26g2000yqm.googlegroups.com>,
> > OdarR <olivier.da...@gmail.com> wrote:
>
> >> and with eval(), did you try ?
>
> > WARNING: eval() is almost always the wrong answer to any question
>
> Some say that eval is evil !
>
> JM
go to hell ;-), it is part of the language, it seems to match the
aforementioned question.
I don't see it as a problem.
Let's wait Klaus opinion.
Olivier
== 2 of 3 ==
Date: Mon, Feb 8 2010 11:29 pm
From: Paul Rudin
Steven D'Aprano <steven@REMOVE.THIS.cybersource.com.au> writes:
> On Mon, 08 Feb 2010 14:43:46 -0800, Aahz wrote:
>
>>>> WARNING: eval() is almost always the wrong answer to any question
>>>
>>>warning : it works !
>>
>> Works for what?
>
> Code injection security bugs, of course.
>
> http://en.wikipedia.org/wiki/Code_injection
>
> It is surprisingly difficult to sanitize strings in Python to make them
> safe to pass to eval. Unless you are prepared to trust the input data
> explicitly, it's best to just avoid eval.
Despite the fact that it's used in the standard library...
== 3 of 3 ==
Date: Tues, Feb 9 2010 12:11 am
From: Steven D'Aprano
On Tue, 09 Feb 2010 07:29:33 +0000, Paul Rudin wrote:
>> It is surprisingly difficult to sanitize strings in Python to make them
>> safe to pass to eval. Unless you are prepared to trust the input data
>> explicitly, it's best to just avoid eval.
>
> Despite the fact that it's used in the standard library...
Wisely or not, the standard library implicitly trusts it's input.
That's one of the many reasons why it's so hard to have a restricted
subset of Python.
--
Steven
==============================================================================
TOPIC: Simple question about Queue.Queue and threads
http://groups.google.com/group/comp.lang.python/t/032256dd608c9c02?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 8 2010 10:45 pm
From: "Frank Millman"
On Feb 8, 4:51 pm, Steven <Steven.Rumbal...@fiserv.com> wrote:
>
> Queue objects have support for this signaling baked in with
> q.task_done and q.join.
>
> After the server process has put all tasks into the queue, it can join
> the queue itself, not the worker threads.
>
> q.join()
>
> This will block until all tasks have been gotten AND completed. The
> worker threads would simply do this:
> task_data = q.get()
> do_task(task_data)
> q.task_done()
>
> Using pairs of get and task_done you no longer need to send a signal.
> Just exit the server process and the worker threads will die (assuming
> of course, you set .setDaemon(True) before starting each worker
> thread).
>
Thanks, Steven.
This works perfectly in my scenario, and tidies up the code a bit.
Minor point - according to the 2.6 docs, .setDaemon(True) is the old API -
the current way of specifying this is .daemon = True.
Thanks for the tip.
Frank
==============================================================================
TOPIC: Python Logic Map/Logic Flow Chart. (Example Provided)
http://groups.google.com/group/comp.lang.python/t/3c3ef3cbc908b872?hl=en
==============================================================================
== 1 of 2 ==
Date: Mon, Feb 8 2010 10:47 pm
From: spike
On Feb 8, 1:35 pm, Gary Herron <gher...@islandtraining.com> wrote:
> spike wrote:
> > Has anyone been able to come across a Python logic map or Python logic
> > flow chart?
>
> > An example can be seen on the right under History:
> >http://en.wikipedia.org/wiki/Usenet#History
>
> > This would be very helpful for all users.
>
> Huh??? What aspect of Python were you thinking of mapping out?
>
> Your example us a bad ascii art graph of -- I've no clue what?
>
> Gary Herron
Do you know what "Logic" means? Guess not. Before you comedians quit
your day job some people are looking for information. If you have
nothing positive to say, go pester somewhere else.
Grow up.
== 2 of 2 ==
Date: Mon, Feb 8 2010 11:35 pm
From: Gary Herron
spike wrote:
> On Feb 8, 1:35 pm, Gary Herron <gher...@islandtraining.com> wrote:
>
>> spike wrote:
>>
>>> Has anyone been able to come across a Python logic map or Python logic
>>> flow chart?
>>>
>>> An example can be seen on the right under History:
>>> http://en.wikipedia.org/wiki/Usenet#History
>>>
>>> This would be very helpful for all users.
>>>
>> Huh??? What aspect of Python were you thinking of mapping out?
>>
>> Your example us a bad ascii art graph of -- I've no clue what?
>>
>> Gary Herron
>>
>
> Do you know what "Logic" means? Guess not. Before you comedians quit
> your day job some people are looking for information. If you have
> nothing positive to say, go pester somewhere else.
>
> Grow up.
>
Why the attitude? I wouldn't have asked for a clarification if I didn't
want to help. However, I seriously have *no* idea what the OP has asked
for when he says "Python logic map". Do you? If so, then answer the
poor guy's question instead of whining at me. (And I'll respectfully
read your answer, just to see how you interpret "Python logic map".)
And I still claim that the example he aimed us at does not help in
figuring out what he's asking. It's a (nearly) 30 year old ascii-art
drawing of the connectivity between (mostly university and government
research lab ) computers that comprised the UUCP/USENET and ARPANET --
the precursor to today's internet. BUT, that begs the question: What
does an old network connectivity chart have to do with a "Python logic map"?
If the OP is asking for a way to draw flow charts of Python programs,
then why is his example of something that is *not* a flow chart, and
drawn with 30 year old technology to boot.
If he is asking for a way to draw some kind of a connectivity graph,
then I have to ask: Connectivity of what?
--
Gary Herron, PhD.
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
==============================================================================
TOPIC: ANN: obfuscate
http://groups.google.com/group/comp.lang.python/t/6374e775e474ee1a?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 8 2010 10:58 pm
From: Gregory Ewing
Tim Chase wrote:
> I prefer the strength of Triple ROT-13 for my obfuscation needs, but I
> don't see it listed here.
That's old hat -- with the advent of 3GHz cpus and GPGPU, all the
experts are recommending quadruple ROT-128 nowadays.
--
Greg
==============================================================================
TOPIC: New product collection
http://groups.google.com/group/comp.lang.python/t/b43417240d6771d7?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 8 2010 10:54 pm
From: anitha raj
The site piece of article talk about http://www.shoppingreps.com?SourceId=1234
I visited this site and I found really good and implemented the
social networking for group shopping. I registered my intention to buy
Plasma TV and I received a email within a couple of day. Now I have to
bargain for a group of 4 people who wanted to buy the same Plasma TV
from Teynampet in Chennai. I am excited anybody wants to join this
group. Please visit http://www.shoppingreps.com?SourceId=1234
==============================================================================
TOPIC: C/C++ Import
http://groups.google.com/group/comp.lang.python/t/ca2e6428c406e538?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 8 2010 11:39 pm
From: Austin Bingham
Just to elaborate on Terry's point a bit, sys.path is influenced (in
part) by the PYTHONPATH environment variable. If you find that the
directory containing 'python' is not in sys.path (which you can check
with 'import sys; print sys.path'), add that directory to PYTHONPATH
and try again. This may not be the solution you ultimately end up
using, but it'll get you pointed in the right direction.
Austin
On Mon, Feb 8, 2010 at 5:52 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> On 2/7/2010 10:56 PM, 7H3LaughingMan wrote:
>>
>> To make the background information short, I am trying to take a
>> program that uses Python for scripting and recompile it for Linux
>> since it originally was built to run on Win32. The program itself was
>> designed to be able to be compiled on Linux and someone made there on
>> release with source that added python scripting. After some issues I
>> got it to compile but now it is unable to import the files that it
>> needs.
>>
>> The program is running the following code...
>> PyImport_Import( PyString_FromString("python.PlayerManager") );
>>
>> This is meant to import the file PlayerManager.py inside of the python
>> folder. However it throws the following Python Error (Gotten through
>> PyErr_Print())
>> ImportError: No module named python.PlayerManager
>>
>> I am using 2.6.4 so I can't call it by the filename, does anyone know
>> how to do a proper import?
>
> Your 'python' package directory must be in a directory listed in sys.path. I
> would print that check.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
==============================================================================
TOPIC: Hurry Up,Free Check of $367 With Your Name.
http://groups.google.com/group/comp.lang.python/t/6f194dc05b407473?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Feb 9 2010 12:07 am
From: FREE CHECKS
Hurry Up,Free Check of $367 With Your Name.
Open Below Website and Click on any one Red Text link and Enter your
Payee Name and Address where to get your Check.
http://googleadsense-toppayingkeywords.blogspot.com/
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en
To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home