On Thursday, September 3, 2015 at 6:55:06 PM UTC+2, Palpandi wrote:
> Hi All,
>
> Is there any module available in python standard library for XML binding? If
> not, any other suggestions.
>
> Which is good for parsing large file?
> 1. XML binding
> 2. Creating our own classes
>
>
> Thanks,
>
"Ian Kelly" wrote in message
news:calwzidm3khnagtt0ohveo5bhqk1tfejbuuuinw9tnuxrpnr...@mail.gmail.com...
On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
> That makes me wonder if, in my project, I can import all modules inside
> 'start.py', and then just use 'import package_name' inside
"Frank Millman" writes:
>...
> My project comprises a number of modules, split into packages. Modules
> frequently need to access the contents of other modules, in the same
> or in a different package. I am getting better at it, but I still
> occasionally bump my head against circular imports, and
Ian Kelly :
> Emacs users with that setup would probably want the Python compiler to
> interpret a tab as eight spaces.
Which it does:
Tabs are replaced (from left to right) by one to eight spaces such
that the total number of characters up to and including the
replacement is a multiple
On Fri, Sep 11, 2015 at 3:15 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> Personally, I like to use tab characters for indentation. You can
>> choose how many pixels or ems or ens or spaces the actual visual shift
>> is, and if I disagree with your choice, it won't affect anything. As
>> long
Chris Angelico :
> Personally, I like to use tab characters for indentation. You can
> choose how many pixels or ems or ens or spaces the actual visual shift
> is, and if I disagree with your choice, it won't affect anything. As
> long as tabs are used _exclusively_, Python won't be bothered by it
On Thu, Sep 10, 2015 at 10:34 PM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> You can use tabs *or* spaces. If you want to mix the two, then there
>> would need to be some official decision made about how many spaces
>> compose a tab, and then everybody who wants to use tabs would have to
>> configur
On Fri, Sep 11, 2015 at 2:34 PM, Marko Rauhamaa wrote:
> etc. The TAB *key* is a command that makes emacs indent with a mix of
> spaces and TABs.
I don't care how you key them in. If your tab key moves you to the
next position, that's good. If you convert a sequence of N spaces into
a tab charact
Ian Kelly :
> You can use tabs *or* spaces. If you want to mix the two, then there
> would need to be some official decision made about how many spaces
> compose a tab, and then everybody who wants to use tabs would have to
> configure their editors to conform to that decision, or risk breaking
>
On Thu, 10 Sep 2015 22:05:07 -0500, Seb wrote:
> The key to my solution was to use numpy's meshgrid to generate the
> coordinates for defining the sub-units. However, it seems awfully
> complex and contrived,
Half a dozen lines of code is "complex and contrived"?
Also, you should lose marks for
Hello,
The code below is what I came up with to solve the problem:
1. We're given geographic coordinates for two opposite vertices of a
rectangle.
2. If any of the sides of the rectangle is larger than some number of
degrees, then subdivide the rectangle into squares/rectangles such
that
hi, Laura:
My embedded arm device supports floating point operation. I
have to use numpy and pandas packages. But now, I do not known how to
cross compile numpy and pandas packages?
On 09/11/2015 12:05 AM, Laura Creighton wrote:
In a message of Thu, 10 Sep 2015 18:11:08 +0800, "chenc.
On Thursday 10 September 2015 20:33:03 Dennis Lee Bieber wrote:
> On Thu, 10 Sep 2015 12:04:05 -0700 (PDT), rurpy--- via Python-list
>
> declaimed the following:
> >I also doubt there were more programming languages around in the
> >1970s than now, on the grounds that there were far fewer people
On Fri, Sep 11, 2015 at 6:12 AM, James Harris wrote:
> Thanks for your help, Chris. Using select() is a very good option. I tried
> first without a timeout and even then this version of Windows does not
> recognise Control-C until after the select() call returns (which needs
> similar prompting as
On Fri, Sep 11, 2015 at 6:07 AM, wrote:
> On Thu, Sep 10, 2015, at 12:48, Chris Angelico wrote:
>> Having assignment be a statement (and therefore illegal in a loop
>> condition) makes sense. Having it be an expression that yields a
>> useful or predictable value makes sense. Having it be an expr
On 2015-09-11 01:35, Ian Kelly wrote:
On Thu, Sep 10, 2015 at 4:25 PM, wrote:
[snip]
It is correct that there have to be a decision for spaces or tabs.
But sure not necessarily the exact same indentation to the right for each block.
Jus more same inserter to the right and the context is clear
On Fri, 11 Sep 2015 03:54:14 +1000, Steven D'Aprano wrote:
> If I did this thing, would people follow me down the street booing and
> jeering and throwing things at me?
Yes
>>> x = func()
>>> x
>>> func()
>>> print x == func()
>>> assert x == func()
Would you expect the last two calls to func(
Hi there,
I am researching a nice slick way to provide the difference between
generated python multi-line configuration output and specific
configuration lines gathered from an output file. I could put things in
a list? I could put both forms output into IOString() and run a diff
command t
On Thu, Sep 10, 2015 at 4:25 PM, wrote:
> with following proofs uncommented:
None of these are "proofs".
> Each sample provided would work without global
> (or you get runtime failure while try to write a global).
What samples? It would be easier to follow your messages if you would
include qu
On 9/10/2015 3:25 PM, t...@freenet.de wrote:
> Who decides it?
The BDFL or his delegate. It's simplest that way.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
Some notes to the "global"-keyword and the other proposals.
It has been proposed to have these six enhancements
1. optional keyword "global"
2. switch statement
3. less restrictive indentation
4. universal scope
5. goto label
6- "include" script statement
with following proofs uncommented:
On Wed, 9 Sep 2015 20:20:42 +0100, Mark Lawrence wrote:
> On 09/09/2015 18:59, William Ray Wing wrote:
>>> On Sep 9, 2015, at 1:22 PM, Steven D'Aprano wrote:
[snip]
>> Right. Note that the Arabs, who DID invent zero, still count from one.
[snip]
> Would you please provide a citation to support yo
On Thu, Sep 10, 2015, at 16:15, Akira Li wrote:
> There are cases when it might be justified to alter the behavior e.g.,
> *colorama* allows to strip ANSI codes (e.g., disable colored output) if
> stdout is not a tty or *win-unicode-console* make sys.stdout to use
> WriteConsoleW() to write Unicode
On Thu, Sep 10, 2015, at 14:13, Steven D'Aprano wrote:
> Because that's the definition of an expression in this context. An
> expression is evaluated to either return a result, or raise an exception.
Nonsense. An expression is something allowed within a larger expression.
It's easy to imagine an e
On 2015-09-10, Akira Li <4kir4...@gmail.com> wrote:
> Grant Edwards writes:
>
>> On 2015-09-10, Steven D'Aprano wrote:
>>
>>> I have a function which is intended for use at the interactive interpreter,
>>> but may sometimes be used non-interactively. I wish to change it's output
>>> depending on
Grant Edwards writes:
> On 2015-09-10, Steven D'Aprano wrote:
>
>> I have a function which is intended for use at the interactive interpreter,
>> but may sometimes be used non-interactively. I wish to change it's output
>> depending on the context of how it is being called.
>
> [...]
>
> Sounds
"Chris Angelico" wrote in message
news:mailman.337.1441913195.8327.python-l...@python.org...
On Fri, Sep 11, 2015 at 5:11 AM, James Harris
wrote:
...
However, on Windows the recognition of Control-C does not happen
until after
something connects to the socket.
...
This is a known pro
On Thu, Sep 10, 2015, at 12:48, Chris Angelico wrote:
> Having assignment be a statement (and therefore illegal in a loop
> condition) makes sense. Having it be an expression that yields a
> useful or predictable value makes sense. Having it be an expression,
> but not returning a value, doesn't.
On Fri, 11 Sep 2015 01:59:27 +1000, Steven D'Aprano wrote:
>
> Although, I'm not sure that I agree with the idea that "everything is an
> expression". I think that's a category mistake, like asking for the
> speed of dark[1], or for a bucket of cold. Some things are functional by
> nature, and oth
On Thu, 10 Sep 2015 12:11:55 -0700, wxjmfauth wrote:
s = """1, 2, 3, 4
> ... #keyword1 ... 3, 4, 5, 6 ... 2, 3, 4, 5 ... #keyword2 ... 4, 5, 6
> ,7"""
s[s.find('keyword1') + len('keyword1'):s.find('keyword2') - 1]
> '\n3, 4, 5, 6\n2, 3, 4, 5\n'
#or s[s.find('keyword1') + len('keywor
On Fri, Sep 11, 2015 at 5:11 AM, James Harris wrote:
> S:\>python socktest.py
> Traceback (most recent call last):
> File "socktest.py", line 6, in
>endpoint = s.accept()
> File "C:\Python27\lib\socket.py", line 202, in accept
>sock, addr = self._sock.accept()
> KeyboardInterrupt
>
> S:
On 2015-09-10, Steven D'Aprano wrote:
> I have a function which is intended for use at the interactive interpreter,
> but may sometimes be used non-interactively. I wish to change it's output
> depending on the context of how it is being called.
[...]
Sounds like an excellent way to waste someb
Steven D'Aprano writes:
> I want the function to know its own context.
> I don't mind if it is CPython only, or if it is a bit expensive.
That sounds crazy but if it's really what you want, you can probably
fake it by examining the control stack using the backtrace module. I
remember doing some
Steven D'Aprano writes:
> Or os.abort. The docs for that say:
>
> Help on built-in function abort in module posix:
>
> abort(...)
> abort() -> does not return!
>
> Abort the interpreter immediately. This 'dumps core' or otherwise
> fails in the hardest way possible on the hosting oper
"Chris Angelico" wrote in message
news:mailman.332.1441910212.8327.python-l...@python.org...
On Fri, Sep 11, 2015 at 4:24 AM, James Harris
wrote:
I have a listening socket, self.lsock, which is used in an accept()
call as
follows
endpoint = self.lsock.accept()
The problem is that if cont
On Thursday, September 10, 2015 at 6:18:39 AM UTC-6, Steven D'Aprano wrote:
> On Thu, 10 Sep 2015 05:18 am, Chris Angelico wrote:
> > On Thu, Sep 10, 2015 at 5:14 AM, Laura Creighton wrote:
> >> In a message of Thu, 10 Sep 2015 05:00:22 +1000, Chris Angelico writes:
> >>>To get started, you need s
Oops, missing print:
On 10.09.2015 20:45, Sven R. Kunze wrote:
On 10.09.2015 20:34, Sven R. Kunze wrote:
You are right. I turned out to me harder that I first thought.
My initial guess was like: use AST. But now I see, it would be hard
to get the source code.
So, what actually could work, w
On 10.09.2015 20:34, Sven R. Kunze wrote:
You are right. I turned out to me harder that I first thought.
My initial guess was like: use AST. But now I see, it would be hard to
get the source code.
So, what actually could work, would be faking the interactive
interpreter wrapping it up and th
In a message of Fri, 11 Sep 2015 03:54:14 +1000, "Steven D'Aprano" writes:
>def func():
>do_stuff()
>if procedure: # FIXME what goes here???
>return "Awesome"
>else:
>return 999
>
>Now I can do this:
>
>
>x = func()
>assert x == 999
>
>L = [1, 2, func(), 4]
>assert L[2
On Fri, Sep 11, 2015 at 3:54 AM, Steven D'Aprano wrote:
> If the function is being called as if it were a procedure or command, that
> is the return result is just ignored, I want to return one thing. But if it
> is being called where the return result goes somewhere, I want to return
> something
On Fri, Sep 11, 2015 at 4:13 AM, Steven D'Aprano wrote:
> Sometimes they might be. But in general, I think it is meaningless to expect
> a imperative command to have a return result. The whole point of an
> imperative command is that it operates by side-effect.
>
> For example, what would `del x`
On Fri, Sep 11, 2015 at 4:24 AM, James Harris wrote:
> I have a listening socket, self.lsock, which is used in an accept() call as
> follows
>
> endpoint = self.lsock.accept()
>
> The problem is that if control-C is pressed it is not recognised until
> something connects to that socket. Only when
On 10.09.2015 20:14, Ben Finney wrote:
"Sven R. Kunze" writes:
http://stackoverflow.com/questions/2356399/tell-if-python-is-in-interactive-mode
I'm pretty sure Steven knows full well the answer to that question,
which is not anything like the one he asked. Would you care to read the
question
On 10.09.2015 20:12, Ben Finney wrote:
First thing in the morning I will purchase a head of cabbage and store
it in a warm place to make it rot, on the off chance you find some
obscure way to achieve your benighted goal, just so I can be first in
line to throw it as you pass.
Well, go ahead. An
I have a listening socket, self.lsock, which is used in an accept() call
as follows
endpoint = self.lsock.accept()
The problem is that if control-C is pressed it is not recognised until
something connects to that socket. Only when the accept() call returns
is the signal seen.
The question,
I need to add: you need to look up the stack to see if you have been
called by __main__ and if __main__.__file__ is missing.
Implementation: I would write decorator for your func.
Best,
Sven
PS: did I say it would probably be a bad idea? If not, it would probably
be a bad idea.
PPS: what is
"Sven R. Kunze" writes:
> http://stackoverflow.com/questions/2356399/tell-if-python-is-in-interactive-mode
I'm pretty sure Steven knows full well the answer to that question,
which is not anything like the one he asked. Would you care to read the
question he did ask?
--
\ “The optimist
On Fri, 11 Sep 2015 02:31 am, random...@fastmail.us wrote:
> On Thu, Sep 10, 2015, at 11:59, Steven D'Aprano wrote:
>> Although, I'm not sure that I agree with the idea that "everything is an
>> expression". I think that's a category mistake, like asking for the speed
>> of dark[1], or for a bucke
Steven D'Aprano writes:
> I have a function which is intended for use at the interactive
> interpreter, but may sometimes be used non-interactively. I wish to
> change it's output depending on the context of how it is being called.
> […]
>
> x = func()
> assert x == 999
>
> L = [1, 2, func(), 4]
http://stackoverflow.com/questions/2356399/tell-if-python-is-in-interactive-mode
On 10.09.2015 19:54, Steven D'Aprano wrote:
I have a function which is intended for use at the interactive interpreter,
but may sometimes be used non-interactively. I wish to change it's output
depending on the con
I have a function which is intended for use at the interactive interpreter,
but may sometimes be used non-interactively. I wish to change it's output
depending on the context of how it is being called.
If the function is being called as if it were a procedure or command, that
is the return result
Am 10.09.15 um 13:18 schrieb Gerald:
Hey,
is there a easy way to copy the content between 2 unique keywords in a .txt
file?
example.txt
1, 2, 3, 4
#keyword1
3, 4, 5, 6
2, 3, 4, 5
#keyword2
4, 5, 6 ,7
If "copying" does mean copy it to another file, and you are not obliged
to use Python, thi
On Fri, Sep 11, 2015 at 2:31 AM, wrote:
> On Thu, Sep 10, 2015, at 11:59, Steven D'Aprano wrote:
>> Although, I'm not sure that I agree with the idea that "everything is an
>> expression". I think that's a category mistake, like asking for the speed
>> of dark[1], or for a bucket of cold. Some th
On Thu, Sep 10, 2015, at 11:59, Steven D'Aprano wrote:
> Although, I'm not sure that I agree with the idea that "everything is an
> expression". I think that's a category mistake, like asking for the speed
> of dark[1], or for a bucket of cold. Some things are functional by
> nature,
> and other th
In a message of Thu, 10 Sep 2015 18:11:08 +0800, "chenc...@inhand.com.cn" write
s:
>hi:
>I have to use numpy package. My python runs on my embedded arm
>device. So, how do i cross compile numpy?
>--
>https://mail.python.org/mailman/listinfo/python-list
Ask that one here:
http://mail.scipy.or
On Thu, 10 Sep 2015 04:59 am, random...@fastmail.us wrote:
> On Wed, Sep 9, 2015, at 13:55, Steven D'Aprano wrote:
>> In fairness to the C creators, I'm sure that nobody back in the early
>> seventies imagined that malware and security vulnerabilities would be as
>> widespread as they have become.
MRAB:
Thanks for replying. I got so hyper focused on solving my hardware
problems, and excited that I did, that I forgot details from previous
comments. Thanks for your post.
Off to make things global...
--
https://mail.python.org/mailman/listinfo/python-list
On 10/09/2015 11:20, Tim Golden wrote:
On 10/09/2015 00:52, Mark Lawrence wrote:
I've installed 3.5 for all users so it's in C:\Program Files
From
https://docs.python.org/3.5/using/windows.html#from-the-command-line it
says "System-wide installations of Python 3.3 and later will put the
launche
On Thu, 10 Sep 2015 04:26 am, Sven R. Kunze wrote:
> Just to understand it the way you want it to be understood: what do you
> mean by "technical excellence"?
That's one of those things that are difficult to define precisely. All I can
do is give some partial examples, and counter-examples.
Lisp
Vlastimil Brom writes:
> just to add another possible approach, you can use regular expression
Now you have three problems: whatever the two problems are that you are
alleged to have whenever you decide to use regular expressions for
anything at all, plus all the people piling on you to tell that
On Thu, Sep 10, 2015 at 8:47 AM, Peter Otten <__pete...@web.de> wrote:
> Ian Kelly wrote:
>> That surprises me also, but I suspect it's because they're
>> subdirectories of the current working directory rather than packages
>> found on the sys.path.
>
> So even the experts cannot keep up with all t
On Thursday, 10 September 2015 13:18:39 UTC+1, Steven D'Aprano wrote:
> On Thu, 10 Sep 2015 05:18 am, Chris Angelico wrote:
>
> > On Thu, Sep 10, 2015 at 5:14 AM, Laura Creighton wrote:
> >> In a message of Thu, 10 Sep 2015 05:00:22 +1000, Chris Angelico writes:
> >>>To get started, you need som
Ian Kelly wrote:
> On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
>> That makes me wonder if, in my project, I can import all modules inside
>> 'start.py', and then just use 'import package_name' inside each module?
>
> You can, but for readability and reuse I think it's better to be
> ex
2015-09-10 13:18 GMT+02:00 Gerald :
> Hey,
>
> is there a easy way to copy the content between 2 unique keywords in a .txt
> file?
>
> example.txt
>
> 1, 2, 3, 4
> #keyword1
> 3, 4, 5, 6
> 2, 3, 4, 5
> #keyword2
> 4, 5, 6 ,7
>
>
> Thank you very much
Hi,
just to add another possible approach, you
On 09/10/2015 01:27 AM, Antoon Pardon wrote:
> Op 09-09-15 om 19:55 schreef Steven D'Aprano:
>> In fairness to the C creators, I'm sure that nobody back in the early
>> seventies imagined that malware and security vulnerabilities would be as
>> widespread as they have become. But still, the fundame
On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
> That makes me wonder if, in my project, I can import all modules inside
> 'start.py', and then just use 'import package_name' inside each module?
You can, but for readability and reuse I think it's better to be
explicit in each module and im
Gerald writes:
> Hey,
>
> is there a easy way to copy the content between 2 unique keywords in a
> .txt file?
>
> example.txt
>
> 1, 2, 3, 4
> #keyword1
> 3, 4, 5, 6
> 2, 3, 4, 5
> #keyword2
> 4, 5, 6 ,7
Depending on your notion of easy, you may or may not like itertools.
The following code gets
On Thu, 10 Sep 2015 04:23 am, Emile van Sebille wrote:
> On 9/9/2015 10:55 AM, Steven D'Aprano wrote:
>
>> (I wanted to link to the "Everything Is Broken" essay on The Medium, but
>> the page appears to be gone.
>
> Is this it?
> http://www.sott.net/article/280956-Everything-is-broken-on-the-Int
On Thu, 10 Sep 2015 05:18 am, Chris Angelico wrote:
> On Thu, Sep 10, 2015 at 5:14 AM, Laura Creighton wrote:
>> In a message of Thu, 10 Sep 2015 05:00:22 +1000, Chris Angelico writes:
>>>To get started, you need some other sort of kick.
>>
>> Having Brian Kernighan write a really nice book about
On Thu, 10 Sep 2015 09:18 pm, Gerald wrote:
> Hey,
>
> is there a easy way to copy the content between 2 unique keywords in a
> .txt file?
>
> example.txt
>
> 1, 2, 3, 4
> #keyword1
> 3, 4, 5, 6
> 2, 3, 4, 5
> #keyword2
> 4, 5, 6 ,7
>
>
> Thank you very much
Copy in what sense? Write to ano
Hey,
is there a easy way to copy the content between 2 unique keywords in a .txt
file?
example.txt
1, 2, 3, 4
#keyword1
3, 4, 5, 6
2, 3, 4, 5
#keyword2
4, 5, 6 ,7
Thank you very much
--
https://mail.python.org/mailman/listinfo/python-list
On 10/09/2015 00:52, Mark Lawrence wrote:
> I've installed 3.5 for all users so it's in C:\Program Files
>
> From
> https://docs.python.org/3.5/using/windows.html#from-the-command-line it
> says "System-wide installations of Python 3.3 and later will put the
> launcher on your PATH. The launcher i
hi:
I have to use numpy package. My python runs on my embedded arm
device. So, how do i cross compile numpy?
--
https://mail.python.org/mailman/listinfo/python-list
Antoon Pardon :
> Op 09-09-15 om 19:55 schreef Steven D'Aprano:
>> In fairness to the C creators, I'm sure that nobody back in the early
>> seventies imagined that malware and security vulnerabilities would be
>> as widespread as they have become. But still, the fundamental
>> decisions made by C
On Wednesday, September 9, 2015 at 10:06:31 AM UTC+1, wxjm...@gmail.com wrote:
> Le mardi 8 septembre 2015 21:02:31 UTC+2, wxjm...@gmail.com a écrit :
> > Le mardi 8 septembre 2015 20:18:20 UTC+2, Irmen de Jong a écrit :
> > > On 8-9-2015 17:54, wxjmfa...@gmail.com wrote:
> > > > win7 / py433
> > >
Op 09-09-15 om 19:55 schreef Steven D'Aprano:
> In fairness to the C creators, I'm sure that nobody back in the early
> seventies imagined that malware and security vulnerabilities would be as
> widespread as they have become. But still, the fundamental decisions made
> by C are lousy. Assignment i
Hi all
My project comprises a number of modules, split into packages. Modules
frequently need to access the contents of other modules, in the same or in a
different package. I am getting better at it, but I still occasionally bump
my head against circular imports, and have to fiddle around unt
77 matches
Mail list logo