comp.lang.python - 25 new messages in 10 topics - digest
comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en
comp.lang.python@googlegroups.com
Today's topics:
* Algorithm that makes maximum compression of completly diffused data. - 1
messages, 1 author
http://groups.google.com/group/comp.lang.python/t/cf4b4e4ba592ec63?hl=en
* Automation - 8 messages, 6 authors
http://groups.google.com/group/comp.lang.python/t/2cb5aaffece4c4a9?hl=en
* Possibly better loop construct, also labels+goto important and on the fly
compiler idea. - 4 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/a75134775506798f?hl=en
* Basic Python Questions - Oct. 31, 2013 - 4 messages, 4 authors
http://groups.google.com/group/comp.lang.python/t/ad34565704bc1d1e?hl=en
* ANN: rom 0.22 - Redis object mapper for Python - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/ccf62851c73aa6fb?hl=en
* Debugging decorator - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/a95572917c5f91d0?hl=en
* zero argument member functions versus properties - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/524063bb9e728c6c?hl=en
* Slicing with negative strides - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/ef887f44e65ca220?hl=en
* Problem installing matplotlib 1.3.1 with Python 2.7.6 and 3.3.3 (release
candidate 1) - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/1a324c1a06b20a2d?hl=en
* Parsing multiple lines from text file using regex - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/57600a0eb9098a0b?hl=en
==============================================================================
TOPIC: Algorithm that makes maximum compression of completly diffused data.
http://groups.google.com/group/comp.lang.python/t/cf4b4e4ba592ec63?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 3 2013 7:51 am
From: Joshua Landau
On 3 November 2013 15:34, Joshua Landau <joshua@landau.ws> wrote:
>I can genuinely compress
> the whole structure by N log2 Y items.
By which I mean 2N items.
==============================================================================
TOPIC: Automation
http://groups.google.com/group/comp.lang.python/t/2cb5aaffece4c4a9?hl=en
==============================================================================
== 1 of 8 ==
Date: Sun, Nov 3 2013 8:19 am
From: Renato Barbosa Pim Pereira
I have one .xls file with the values of PV MV and SP, I wanna to calculate
Kp Ki Kd with python from this file, can anyone give me any suggestion
about how can I do this? From now, thanks.
== 2 of 8 ==
Date: Sun, Nov 3 2013 1:22 pm
From: bob gailer
On 11/3/2013 11:19 AM, Renato Barbosa Pim Pereira wrote:
> I have one .xls file with the values of PV MV and SP, I wanna to
> calculate Kp Ki Kd with python from this file, can anyone give me any
> suggestion about how can I do this?
You could start by explaining what those terms mean. They have no direct
relationship to Python.
Does this have anything to do with statistics? Quantum theory? Telephony?
P = Pluto, V = Venus, S = Saturn?
Help us understand - then we *might* be able to help you.
--
Bob Gailer
919-636-4239
Chapel Hill NC
== 3 of 8 ==
Date: Sun, Nov 3 2013 1:48 pm
From: renato.barbosa.pim.pereira@gmail.com
http://pastebin.com/N9dgaHTx
With this program I can read a csv file with 3 columns, in one of these columns I need to read the value more high and multiply by 0.632 and with result, search in the same column by a value that aproximate with this result, and then return the vector position.
== 4 of 8 ==
Date: Sun, Nov 3 2013 1:53 pm
From: Mark Lawrence
On 03/11/2013 21:22, bob gailer wrote:
> On 11/3/2013 11:19 AM, Renato Barbosa Pim Pereira wrote:
>> I have one .xls file with the values of PV MV and SP, I wanna to
>> calculate Kp Ki Kd with python from this file, can anyone give me any
>> suggestion about how can I do this?
> You could start by explaining what those terms mean. They have no direct
> relationship to Python.
>
> Does this have anything to do with statistics? Quantum theory? Telephony?
>
> P = Pluto, V = Venus, S = Saturn?
>
> Help us understand - then we *might* be able to help you.
>
According to http://www.acronymfinder.com there are only 85 meanings for
PV, 75 for MV and a mere 290 for SP so simply take your pick :)
--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer
Mark Lawrence
== 5 of 8 ==
Date: Sun, Nov 3 2013 1:43 pm
From: Johannes Findeisen
On Sun, 3 Nov 2013 14:19:48 -0200
Renato Barbosa Pim Pereira wrote:
> I have one .xls file with the values of PV MV and SP, I wanna to calculate
> Kp Ki Kd with python from this file, can anyone give me any suggestion
> about how can I do this? From now, thanks.
Did you looked at http://www.python-excel.org/ ?
May this can help you solving your problem. Since you are not
explaining what you want to do I can really not help you more. And I
don't use Excel too.
And maybe ask the people over at
http://groups.google.com/group/python-excel if they can help you.
Regards,
Johannes
== 6 of 8 ==
Date: Sun, Nov 3 2013 2:40 pm
From: bob gailer
On 11/3/2013 4:48 PM, renato.barbosa.pim.pereira@gmail.com wrote:
> http://pastebin.com/N9dgaHTx
>
> With this program I can read a csv file with 3 columns, in one of these columns I need to read the value more high and multiply by 0.632 and with result, search in the same column by a value that aproximate with this result, and then return the vector position.
Oh ... will you please explain in good English and a lot more detail. I
can only begin to guess from that what you want. Guessing wastes all our
time.
--
Bob Gailer
919-636-4239
Chapel Hill NC
== 7 of 8 ==
Date: Sun, Nov 3 2013 3:32 pm
From: Denis McMahon
On Sun, 03 Nov 2013 14:19:48 -0200, Renato Barbosa Pim Pereira wrote:
> I have one .xls file with the values of PV MV and SP, I wanna to
> calculate Kp Ki Kd with python from this file, can anyone give me any
> suggestion about how can I do this? From now, thanks.
Why use Python? Why not simply write excel to do the calculations?
Assuming PV, MV and SP are in columns, you simply need to write your
equations for Kp, Ki and Kd so that they reference the relevant columns,
and then past them down the whole spreadsheet.
Seems to me like you're using a sledgehammer to shell a peanut.
--
Denis McMahon, denismfmcmahon@gmail.com
== 8 of 8 ==
Date: Sun, Nov 3 2013 3:53 pm
From: MRAB
On 03/11/2013 21:53, Mark Lawrence wrote:
> On 03/11/2013 21:22, bob gailer wrote:
>> On 11/3/2013 11:19 AM, Renato Barbosa Pim Pereira wrote:
>>> I have one .xls file with the values of PV MV and SP, I wanna to
>>> calculate Kp Ki Kd with python from this file, can anyone give me any
>>> suggestion about how can I do this?
>> You could start by explaining what those terms mean. They have no direct
>> relationship to Python.
>>
>> Does this have anything to do with statistics? Quantum theory? Telephony?
>>
>> P = Pluto, V = Venus, S = Saturn?
>>
>> Help us understand - then we *might* be able to help you.
>>
>
> According to http://www.acronymfinder.com there are only 85 meanings for
> PV, 75 for MV and a mere 290 for SP so simply take your pick :)
>
If you put all "PV MV SP" into Google you get results about Process
Dynamics/Control. Does that help? :-)
==============================================================================
TOPIC: Possibly better loop construct, also labels+goto important and on the
fly compiler idea.
http://groups.google.com/group/comp.lang.python/t/a75134775506798f?hl=en
==============================================================================
== 1 of 4 ==
Date: Sun, Nov 3 2013 9:46 am
From: rurpy@yahoo.com
On 11/01/2013 09:52 PM, Steven D'Aprano wrote:
>[...]
> I did not declare as a
> fact that he had no experience, as you claim, but posed it as a question
> and expressed it explicitly as a subjective observation.
This is a key point. Several of your other denials are
true only if you are right about this.
You concluded your reply to Skybuck with:
"Wait *until* you *start* programming..." [my emphasis]
The implication, that the OP does not have any programming
experience, will be clear to anyone with with even mediocre
English speaking ability. The semantic information conveyed
to the OP is the same as the statement of fact, "you have no
programming experience" and it is perfectly valid to claim
that you told the OP that he had no programming experience.
I pointed this out in nearly every email but in every one
of your responses to it, you ignore that concluding sentence
and mention *only* your initial questioning sentence to
justify your assertion that you "posed it as a question".
As an aside, you shouldn't rely on that initial question
sentence so much either -- just because something is framed
as a question does not mean its intent is not to attack:
"excuse me for asking, but are you an asshole?"
You asked, "have you *ever* done *any* programming *at all*?"
[my emphasis] which could be as easily taken as rhetorically
laying the ground for discrediting his idea as an honest
neutral question and the former interpretation is strengthened
by your concluding "wait until..." statement.
My claims of "ad hominem" and "attack" follow from the fact
that you *did* tell the OP he had no programming experience,
in direct contradiction to what he had stated, and with no
evidence to support your claim beyond the OP's opinions on
loops and goto's.
> Each time I have responded to you, I have given direct quotes and
> directly addressed the substance of your posts, which is all to do with
> the supposed tone of my response to the OP. Each time you have continued
> to misrepresent me, misquote me, and interpret my words assuming bad
> faith rather than good, in order to justify your idea that my post was an
> ad hominem attack.
>
> Including this post, where you make the false statement that:
>
> [quote]
> His idea was that loop tests should always or usually be done
> at the end of the loop. You discussed *nothing* that supported
> that idea.
>
> Emphasis yours. But in fact I gave the concrete example of Pascal
> repeat...until loops, which have the test at the end of the loop. So yet
> again your claims are simply wrong.
That was an unfortunate example for you to chose since it
directly contradicts your claims.
Read that quote again. You are a programmer. You should
understand logic. Please explain how acknowledging *one*
useful end-of-loop construct supports the idea that
/quote/
loop tests should *always or usually* be done at the end of the loop
/endquote/,
especially when you present it with long string of cases where
testing at the bottom is *not* desirable. You did not agree
with the OPs idea that the test should *always* go at the end
of the loop and I represented your opinion as such.
This was pointed out to you before yet you continue to claim
I am misrepresenting you.
> This is four posts in a row now that you have wrongly represented me. I
> can only conclude that you think that by repeating a lie often enough,
> you'll convince others that it must be true and "win".
In my preceding post, I pointed out your practice of repeating
the same discredited accusations in the the hope that repeating
them enough would somehow make them true... It is amusing to
see you lift my own words to use against me (although I used
the word "accusation" and you choose to use the word "lie" --
a difference in our standards I guess.)
I misrepresented you once, immediately acknowledged and corrected
it when you pointed it out. You have continued to accuse me of
misrepresenting you in *every* post you've made, while refusing
to respond to my request to tell me how you think you *should* be
paraphrased.
Indeed you have followed a consistent policy of falsely accusing
me of underhanded and disreputable practices, while at the same
time, often in the same sentence, engaging copiously in exactly
those same practices yourself.
> I will no longer
> play this game with you. Goodbye.
>
> *plonk*
Bye.
== 2 of 4 ==
Date: Sun, Nov 3 2013 9:50 am
From: rurpy@yahoo.com
On 11/02/2013 11:17 PM, Steven D'Aprano wrote:
> On Sat, 02 Nov 2013 18:22:38 +0000, Joshua Landau wrote:
> [...]
>> Sure, you in all probability didn't mean it like that but rurpy isn't
>> uncalled for in raising the concern. Really I just want to remind you
>> that you're both on the same side here.
>
> Thanks for the comments Joshua, but I'm afraid I cannot agree. I gave it
> a lot of thought and I cannot continue to give Rurpy the presumption of
> good faith any longer. This saddens me, but that's the way it is.
Steven, "presumption of good faith" is typical of the
disingenuous remarks that have permeated your posts
in this thread.
Early on, I misrepresented you by claiming you thought
Skybuck's proposal was "nutty" rather than that you
simply and reasonably disagreed with it [*1]. I also
used the phrase "makes no sense" implying it came from
you rather than from Skybuck as it had [*2].
However in pointing my mistake out [*3], you did so
with remarks like:
"You're making that quote up"
"that you would invent such a bare-faced falsehood
"that it is the *opposite* of what I actually said
"I don't know whether you are deliberately lying"
"you're just such a careless reader"
As soon as you pointed out my mistake, I immediately
acknowledged and corrected it [*4]. You continued
with the outrage and attacks on my character.
Bad faith in my part indeed. The nice thing about
email is that there exists a record that anyone can
refer to if they want to discern the truth.
----
[*1] https://groups.google.com/d/msg/comp.lang.python/p1E0d1UGeY8/e6Xs56paZSoJ
[*2] https://groups.google.com/d/msg/comp.lang.python/p1E0d1UGeY8/yDJJER6EJiIJ
[*3] https://groups.google.com/d/msg/comp.lang.python/p1E0d1UGeY8/SwMcqPLMwjgJ
[*4] https://groups.google.com/d/msg/comp.lang.python/p1E0d1UGeY8/7fLfIxBG4UUJ
== 3 of 4 ==
Date: Sun, Nov 3 2013 10:49 am
From: Antoon Pardon
Op 03-11-13 06:17, Steven D'Aprano schreef:
> On Sat, 02 Nov 2013 18:22:38 +0000, Joshua Landau wrote:
> [...]
>> Sure, you in all probability didn't mean it like that but rurpy isn't
>> uncalled for in raising the concern. Really I just want to remind you
>> that you're both on the same side here.
>
> Thanks for the comments Joshua, but I'm afraid I cannot agree. I gave it
> a lot of thought and I cannot continue to give Rurpy the presumption of
> good faith any longer. This saddens me, but that's the way it is.
Why can't you? I think you should give Rurpy more credit. If you want
this to make a welcoming community, then you should take such remarks
seriously. You should realise that you are not in a good position to
evaluate how your words come accross because you rely on the knowledge
of your intentions. Others who don't know your intentions can reasonably
get a very different understanding of what you intended.
> I'm trying hard to give up threads like this, where people debate the
> subjective tone of an email and ever more pedantic arguments about the
> precise wording. Even when all participants are arguing in good faith,
> they risk becoming quagmires which go nowhere in dozens of posts.
So it seems you want this to be a welcoming community, as long as we don't
propose you to change your own behaviour. As soon as it is suggested you may
have to adapt your own behaviour in order to make this a welcoming community,
threads where this sort of things are discusseed in, no longer appeal to
you?
== 4 of 4 ==
Date: Sun, Nov 3 2013 2:11 pm
From: Ben Finney
Antoon Pardon <antoon.pardon@rece.vub.ac.be> writes:
> Op 03-11-13 06:17, Steven D'Aprano schreef:
> > I'm trying hard to give up threads like this, where people debate
> > the subjective tone of an email and ever more pedantic arguments
> > about the precise wording. Even when all participants are arguing in
> > good faith, they risk becoming quagmires which go nowhere in dozens
> > of posts.
>
> So it seems you want this to be a welcoming community, as long as we
> don't propose you to change your own behaviour.
We aim to be a community that always welcomes diversity of people. This
does not entail always welcoming bad behaviour.
Steven is aiming to change his behaviour to make the community more
welcoming of people: he is aiming to cease contributing to threads where
the bad behaviour is an interminable discussion of tone and pedantry.
This is, as I see it, wholly compatible with making the community more
welcoming to people, by reducing the volume of such threads.
--
\ Eccles: "I just saw the Earth through the clouds!" Lew: "Did |
`\ it look round?" Eccles: "Yes, but I don't think it saw me." |
_o__) —The Goon Show, _Wings Over Dagenham_ |
Ben Finney
==============================================================================
TOPIC: Basic Python Questions - Oct. 31, 2013
http://groups.google.com/group/comp.lang.python/t/ad34565704bc1d1e?hl=en
==============================================================================
== 1 of 4 ==
Date: Sun, Nov 3 2013 10:18 am
From: Jim Gibson
In article <OKCdnXfaQqxze-jPnZ2dnUVZ_jGdnZ2d@earthlink.com>, E.D.G.
<edgrsprj@ix.netcom.com> wrote:
> My main, complex programs won't be run at Web sites. They will
> instead continue to be available as downloadable exe programs. The CGI (or
> whatever) programming work would involve relatively simple programs. But
> they would need to be able to generate charts that would be displayed on Web
> pages. That sounds like it is probably fairly easy to do using Python. A
> Perl - Gnuplot combination is also supposed to be able to do that. But so
> far I have not seen any good explanations for how to actually get Gnuplot to
> run as a callable CGI program. So other programs such as Python are being
> considered.
One way to generate plot within a CGI program is this:
1. Write a file with gnuplot commands (e.g., 'gnuplot.cmd') that set
the output device to a graphics file of some format (e.g., PNG),
generate a plot, and quit gnuplot.
2. Run gnuplot and point it to the file of commands (e.g., 'gnuplot
gunplot.cmd') . How this is done depends upon the CGI program language
(see below).
3. Generate HTML that uses the generated graphics file as an embedded
image (using the <img> tag).
I have done this in the past, but not recently. This should work for
Python (os.system("gnuplot gnuplot.cmd") or Perl (system("gnuplot
gnuplot.cmd") with suitable commands to execute external programs.
--
Jim Gibson
== 2 of 4 ==
Date: Sun, Nov 3 2013 10:28 am
From: rusi
On Sunday, November 3, 2013 1:13:13 PM UTC+5:30, Steven D'Aprano wrote:
> On Sun, 03 Nov 2013 01:02:24 -0500, E.D.G. wrote:
> [...]
> > Since Perl has a calculation speed
> > limit that is probably not easy to get around, before too long another
> > language will be selected for initially doing certain things such as
> > performing calculations and plotting charts. And the existing Perl code
> > might then be gradually translated into that new language.
> The nice things about Python are that it makes a great glue language for
> putting together components written in low-level languages like C and
> Fortran, and that there is a rich ecosystem of products for speeding it
> up in various ways. So when you hit the speed limits of pure Python, you
> have lots of options. In no particular order:
> * try using another Python compiler: PyPy is probably the most
> mature of the stand-alone optimizing compilers, and you can
> expect to double the speed of "typical" Python code, but
> there are others;
> * use numpy and scipy for vectorized mathematical routines;
> * re-write critical code as C or Fortran libraries;
> * use Pyrex (possibly unmaintained now) or Cython to write
> C extensions in a Python-like language;
> * use Psyco or Numba (JIT specialising compilers for Python);
> * use Theano (optimizing computer algebra system compiler);
> * use ctypes to call C functions directly;
> * use other products like Boost, Weave, and more.
Yes python is really state-of-art in this respect:
Every language will have some area where it sucks.
Allowing for a hatch where one could jump out is helpful.
Python allows more such hatches than probably any other language (that I know)
https://mail.python.org/pipermail/python-list/2012-August/628090.html
is a (non exhaustive) list I had made some time.
On the other hand if you know you are going to be escaping out often,
you may want to consider whether the 'escapee' should be your base
rather than python.
Which means take something like the pairwise function and code it up in python and julia -- its hardly 10 lines of code. And see what comparative performance you get.
== 3 of 4 ==
Date: Sun, Nov 3 2013 10:58 am
From: Mark Lawrence
On 03/11/2013 18:28, rusi wrote:
>
> Which means take something like the pairwise function and code it up in python and julia -- its hardly 10 lines of code. And see what comparative performance you get.
>
Solely on the grounds that you've mentioned julia how about this
http://blog.leahhanson.us/julia-calling-python-calling-julia.html
--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer
Mark Lawrence
== 4 of 4 ==
Date: Sun, Nov 3 2013 3:16 pm
From: Grant Edwards
On 2013-11-03, Jim Gibson <JimSGibson@gmail.com> wrote:
> In article <OKCdnXfaQqxze-jPnZ2dnUVZ_jGdnZ2d@earthlink.com>, E.D.G.
><edgrsprj@ix.netcom.com> wrote:
>
>> My main, complex programs won't be run at Web sites. They will
>> instead continue to be available as downloadable exe programs. The CGI (or
>> whatever) programming work would involve relatively simple programs. But
>> they would need to be able to generate charts that would be displayed on Web
>> pages. That sounds like it is probably fairly easy to do using Python. A
>> Perl - Gnuplot combination is also supposed to be able to do that. But so
>> far I have not seen any good explanations for how to actually get Gnuplot to
>> run as a callable CGI program. So other programs such as Python are being
>> considered.
>
> One way to generate plot within a CGI program is this:
>
> 1. Write a file with gnuplot commands (e.g., 'gnuplot.cmd') that set
> the output device to a graphics file of some format (e.g., PNG),
> generate a plot, and quit gnuplot.
Or you can use the pygnuplot module which handles much of that for y0ou.
http://pygnuplot.sourceforge.net/
--
Grant
==============================================================================
TOPIC: ANN: rom 0.22 - Redis object mapper for Python
http://groups.google.com/group/comp.lang.python/t/ccf62851c73aa6fb?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 3 2013 11:31 am
From: Josiah Carlson
Hey everyone,
As time progresses, so does my Redis object mapper.
The "rom" package is a Redis object mapper for Python. It sports an
interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's
datastore.
The changelog for recent releases can be seen below my signature.
You can find the package at:
https://www.github.com/josiahcarlson/rom
https://pypi.python.org/pypi/rom
And docs can be found at:
http://pythonhosted.org/rom/
Please CC me on any replies if you have any questions or comments.
Thank you,
- Josiah
#----------------------------------- 0.22
------------------------------------
[fixed] size estimation for intersection ordering when filtering has now
been
fixed, thank you to https://github.com/MickeyKim for the report and the
change (should improve performance).
[fixed] an issue with some types when trying to update attributes has now
been
fixed, thank you to https://github.com/denisvolokh for the report.
[changed] improved performance for simple numeric range queries of the form
Model.get_by(attr=value) or Model.get_by(attr=(min, max)) by roughly a
factor of 60x or better in some cases. Thank you to
https://github.com/MickeyKim for the report on poor performance.
#----------------------------------- 0.21
------------------------------------
[fixed] upload for rom 0.20 was missing new columns.py, now fixed
#----------------------------------- 0.20
------------------------------------
[changed] Added exception when performing .all(), .execute(), or .count() on
query objects that have had no filters or attribute ordering provided.
This addresses issue #12.
[changed] Moved column definitions to their own module, shouldn't affect any
normal uses of rom.
[added] For users of Redis 2.6 and later, there is a beta Lua-enabled
writing
option that allows for multiple unique columns on models. In some cases,
this may improve performance when writing many entities very quickly.
[added] The ability to reload an entity from Redis, optionally discarding
any
modifications to the object itself. Check out the documentation for
Model.refresh(), Session.refresh(), and Session.refresh_all()
[added] Tests for the newly changed/added features.
[changed] Tests no longer use flushdb() - all test models/indexes/etc. are
prefixed with RomTest, and we find/delete such keys before and after any
tests are run. Now anyone can reasonably run the test suite.
#----------------------------------- 0.19
------------------------------------
[fixed] Thanks to a bug report by https://github.com/MickeyKim , was
notified
of a bug when using unique indexes, which is now fixed and has a
testcase.
==============================================================================
TOPIC: Debugging decorator
http://groups.google.com/group/comp.lang.python/t/a95572917c5f91d0?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 3 2013 1:10 pm
From: Yaşar Arabacı
I don't think it would be much problem. I can do that when I have spare time.
Yasar.
> Oh, I just noticed that the person using 2to3 wasn't the OP. My
> apologies, my language was aimed at the decorator's primary developer.
> Yasar, are you prepared to take on Python 3 support fully? If it's as
> simple as tweaking the Print nodes, that shouldn't be too hard (I
> hope).
> ChrisA
--
http://ysar.net/
==============================================================================
TOPIC: zero argument member functions versus properties
http://groups.google.com/group/comp.lang.python/t/524063bb9e728c6c?hl=en
==============================================================================
== 1 of 2 ==
Date: Sun, Nov 3 2013 1:23 pm
From: Peter Cacioppi
Ian said :
" Whereas in Python, an attribute access is just
compiled as an attribute access no matter what the underlying
implementation of that access may end up being at run-time. "
Really? Very nice. Have a good link handy for that? I'm compiling a codex of "why py is better?".
== 2 of 2 ==
Date: Sun, Nov 3 2013 6:27 pm
From: Ian Kelly
On Sun, Nov 3, 2013 at 2:23 PM, Peter Cacioppi <peter.cacioppi@gmail.com> wrote:
> Ian said :
>
> " Whereas in Python, an attribute access is just
> compiled as an attribute access no matter what the underlying
> implementation of that access may end up being at run-time. "
>
> Really? Very nice. Have a good link handy for that? I'm compiling a codex of "why py is better?".
Sorry, no, but this fact should be apparent as a consequence of
Python's dynamicism. Since the compiler generally can't predict what
the types of objects will be, the bytecode that it generates can't
depend on those types.
==============================================================================
TOPIC: Slicing with negative strides
http://groups.google.com/group/comp.lang.python/t/ef887f44e65ca220?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 3 2013 3:15 pm
From: Martin Manns
On 29 Oct 2013 05:22:00 GMT
Steven D'Aprano <steve@pearwood.info> wrote:
> Does anyone here use slices (or range/xrange) with negative strides
> other than -1?
I have used negative strides for comparing discrete sequences e. g. for
turbulence analysis, and I hope that my code will still run in Python 4.
Martin
==============================================================================
TOPIC: Problem installing matplotlib 1.3.1 with Python 2.7.6 and 3.3.3 (
release candidate 1)
http://groups.google.com/group/comp.lang.python/t/1a324c1a06b20a2d?hl=en
==============================================================================
== 1 of 2 ==
Date: Sun, Nov 3 2013 5:15 pm
From: Piet van Oostrum
Hello,
I tried to install matplotlib 1.3.1 on the release candidates of Python 2.7.6 and 3.3.3.
I am on Mac OS X 10.6.8.
Although the installation gave no problems, there is a problem with Tcl/Tk.
The new Pythons have their own embedded Tcl/Tk, but when installing matplotlib it links to the Frameworks version of Tcl and TK, not to the embedded version. This causes confusion when importing matplotlib.pyplot:
objc[70648]: Class TKApplication is implemented in both /Library/Frameworks/Python.framework/Versions/2.7/lib/libtk8.5.dylib and /Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
objc[70648]: Class TKMenu is implemented in both /Library/Frameworks/Python.framework/Versions/2.7/lib/libtk8.5.dylib and /Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
objc[70648]: Class TKContentView is implemented in both /Library/Frameworks/Python.framework/Versions/2.7/lib/libtk8.5.dylib and /Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
objc[70648]: Class TKWindow is implemented in both /Library/Frameworks/Python.framework/Versions/2.7/lib/libtk8.5.dylib and /Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
And then later it gives a lot of error messages.
So I think it should be linked to the embedded version. For this the matplotlib setupext.py should be adapted to find out if there is an embedded Tcl/Tk in the Python installation and set the link parameters accordingly. However, the installed Python versions (from the DMG's) do not contain the Tcl/Tk header files, only the shared library and the tcl files. So I thing the distributed Python should also include the Tcl/Tk header files.
--
Piet van Oostrum <piet@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
== 2 of 2 ==
Date: Sun, Nov 3 2013 4:59 pm
From: Ned Deily
In article <21110.62791.44734.656127@cochabamba.vanoostrum.org>,
Piet van Oostrum <piet@vanoostrum.org> wrote:
> I tried to install matplotlib 1.3.1 on the release candidates of Python 2.7.6
> and 3.3.3.
[...]
Please open an issue on the Python bug tracker for the Python component of
this.
http://bugs.python.org
--
Ned Deily,
nad@acm.org
==============================================================================
TOPIC: Parsing multiple lines from text file using regex
http://groups.google.com/group/comp.lang.python/t/57600a0eb9098a0b?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 3 2013 5:28 pm
From: "Marc"
> This is an alternative solution someone else posted on this list for a similar problem I had:
> #!/usr/bin/python3
> from itertools import groupby
> def get_lines_from_file(file_name):
> with open(file_name) as reader:
> for line in reader.readlines():
> yield(line.strip())
> counter = 0
> def key_func(x):
> if x.strip().startswith("banner") and x.strip().endswith("<banner text delimiter>"):
> global counter
> counter += 1
> return counter
> for key, group in groupby(get_lines_from_file("my_data"), key_func):
> print(list(group)[1:-1])
Thanks Jason,
banner = re.compile(r'banner\s+(\w+)\s+(.+)(.*?)\2', re.DOTALL).findall(lines)
worked nicely to get what I needed:
outfile.write("Banner type: %s Banner Delimiter: %s\n" % (banner[0][0], banner[0][1]))
outfile.write("Banner Text:\n")
outfile.write(banner[0][2])
Probably not the prettiest, most concise code, but it gets the job done.
Thanks again,
Marc
==============================================================================
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