Skip Montanaro writes:
> Much of XML makes no sense to me. Namespaces are one thing. If I'm
> parsing a document where namespaces are defined at the top level, then
> adding namespaces=root.nsmap works when calling the xpath method. I
> more-or-less get that.
>
> What I don't understand is how I'm
David Raymond writes:
> So what are you saying is an option vs an argument? Because I see no
> distinction whatsoever.
The command-line conventions do recognise the distinction.
* A command-line argument specifies input to the program.
For example, the destination file for a ‘cp’ command is
> See https://lxml.de/tutorial.html#namespaces and
> https://lxml.de/2.1/FAQ.html#how-can-i-specify-a-default-namespace-for-xpath-expressions
> for direction.
I had read at least the namespaces section of the tutorial. I could
see the namespace definition right there in the XML and figured
somehow
-Original Message-
From: Python-list On Behalf Of Skip
Montanaro
Sent: Wednesday, August 15, 2018 3:26 PM
To: Python
Subject: lxml namespace as an attribute
> Much of XML makes no sense to me. Namespaces are one thing. If I'm
> parsing a document where namespaces are defined at the top
Thanks to everyone who contributed to this thread. Great feedback and
suggestions! - Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote:
> And as an additional alternative, when I want something weird (extra python
> args or the like) I usually make my script.py into a module and invoke it
> via a shell script, eg:
>
> #!/bin/sh
> exec /particular/python python-opts... -m sc
On 15Aug2018 20:54, eryk sun wrote:
On Wed, Aug 15, 2018 at 9:22 AM, Thomas Jollans wrote:
If you really want to, you can pass a *single* argument in your #! line,
e.g.:
#!/usr/bin/python3 -Wd
This works for options that can be grouped into a single argument.
Multiple -X options aren't supp
> ChrisA
Yes, that works. Thank you all for your help. -->
class A:
def __init__(self):
self.number = 1
def A_biginc(self):
self.number += 107
A.biginc = A_biginc
class B(A):
def __init__(self):
super().__init__()
print("making a B")
def B_biginc(self):
super(B,self).bi
Ack. Of course I meant the subject to be "XML namespace as an
attribute". I happen to be using lxml.etree. (Long day, I guess...)
S
On Wed, Aug 15, 2018 at 4:25 PM Skip Montanaro wrote:
>
> Much of XML makes no sense to me. Namespaces are one thing. If I'm
> parsing a document where namespaces ar
Much of XML makes no sense to me. Namespaces are one thing. If I'm
parsing a document where namespaces are defined at the top level, then
adding namespaces=root.nsmap works when calling the xpath method. I
more-or-less get that.
What I don't understand is how I'm supposed to search for a tag when
On Thu, Aug 16, 2018 at 6:00 AM, thomas.lynch--- via Python-list
wrote:
> Appreciate some help in how in Python a person can add some external methods
> to existing classes in the presence of simple one level inheritance. Here is
> an example stripped down to the shiny brass tacks:
>
> class A:
You really can't, and shouldn't. The super() helper relies on information
that exists inside the class definition and which is not available simply
at runtime by virtue of being attached to the class.
Besides, modifying classes externally is generally considered a bad idea.
Maybe you could accompl
> # this prints for me when I run this in 3.6
excuse me, that is an extraneous comment from a cut and paste, in fact the
example never makes it to the prints, as shown in the transcript just below the
source code
--
https://mail.python.org/mailman/listinfo/python-list
Appreciate some help in how in Python a person can add some external methods to
existing classes in the presence of simple one level inheritance. Here is an
example stripped down to the shiny brass tacks:
class A:
def __init__(self):
self.number = 1
def A_biginc(self):
self.number += 1
On Wed, Aug 15, 2018 at 9:22 AM, Thomas Jollans wrote:
>
> If you really want to, you can pass a *single* argument in your #! line,
> e.g.:
>
> #!/usr/bin/python3 -Wd
This works for options that can be grouped into a single argument.
Multiple -X options aren't supported, nor is combining a -X opt
tomusa...@gmail.com wrote:
> Thank you very much! Do you also know how I might slightly alter to
> composite numbers that are one less than twice a composite number?
>
> 15 would be the first number
> Since 8 is composite then
>
> 2*8=16
> 16 - 1=15 Is composite
Like
>>> def is_composite(n):
.
Thank you very much! Do you also know how I might slightly alter to composite
numbers that are one less than twice a composite number?
15 would be the first number
Since 8 is composite then
2*8=16
16 - 1=15 Is composite
--
https://mail.python.org/mailman/listinfo/python-list
So what are you saying is an option vs an argument? Because I see no
distinction whatsoever. When you run something you give it a bunch of strings.
That's it.
There is nothing magical about putting a dash in front of a letter, nothing
magical about putting in a string that might possibly also b
Steven D'Aprano wrote:
> On Wed, 15 Aug 2018 05:34:06 -0700, tomusatov wrote:
>
>> I am not terribly familiar with Python, but am currently authoring an
>> integer sequence for www.oeis.org and was wondering if anyone in the
>> community could help me with authoring a Python program that outputs,
On Wed, 15 Aug 2018 05:34:06 -0700, tomusatov wrote:
> I am not terribly familiar with Python, but am currently authoring an
> integer sequence for www.oeis.org and was wondering if anyone in the
> community could help me with authoring a Python program that outputs,
> "Composite numbers that are
On Wed, Aug 15, 2018 at 8:36 AM wrote:
>
> I am not terribly familiar with Python, but am currently authoring an integer
> sequence for www.oeis.org and was wondering if anyone in the community could
> help me with authoring a Python program that outputs, "Composite numbers that
> are one less
I am not terribly familiar with Python, but am currently authoring an integer
sequence for www.oeis.org and was wondering if anyone in the community could
help me with authoring a Python program that outputs, "Composite numbers that
are one less than a composite number."
Thanks!
Musatov
--
htt
On 2018-08-15, Steven D'Aprano wrote:
> On Tue, 14 Aug 2018 15:18:13 +, Jon Ribbens wrote:
>> On 2018-08-14, Steven D'Aprano
>> wrote:
>>> # === process abstract methods en masse ===
>>> for name in "method_a method_b method_c method_d".split():
>>> @abstractmethod
>>>
On 14/08/18 23:45, Malcolm Greene wrote:
> When you run a script via "python3 script.py" you can include command
> line options like -b, -B, -O, -OO, etc between the "python3" interpreter
> reference and the script.py file, eg. "python3 -b -B -O -OO script.py".
> When you create a script that is ex
On Tue, 14 Aug 2018 15:18:13 +, Jon Ribbens wrote:
> On 2018-08-14, Steven D'Aprano
> wrote:
>> If there really are a lot of such missing methods, I'd consider writing
>> something like this:
>>
>> class A:
>> def __init__(self, ...):
>> ...
>>
>> # === process abstract method
Not works on Windows
>>> import sys
>>> sys.path.insert(0,
>>> 'C:/Users/i/Downloads/you-get-0.4.1128.zip/you-get-0.4.1128/src')
>>> from you_get import common
26 matches
Mail list logo