for a future offense.” |
`\ —Ambrose Bierce, _The Devil's Dictionary_, 1906 |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
n this to me?
Uncle Ben
--
http://mail.python.org/mailman/listinfo/python-list
Uncle Ben writes:
> Can someone explain this to me?
Yes, the documentation for that function (‘list.append’) can explain it.
In short: if a method modifies the instance, that method does not return
the instance. This policy holds for the built-in types, and should be
followed for user-defi
On May 26, 12:46 am, Uncle Ben wrote:
> In playing with lists of lists, I found the following:
>
> (In 3.1, but the same happens also in 2.7)
>
> list = [1,2,3]
> list.append ( [4,5,6] )
> x = list
> x ->
> [1,2,3,[4,5,6]]
> as expected.
>
> But t
t the right time, and the rest do not |
`\ happen at all. The conscientious historian will correct these |
_o__) defects.” —Mark Twain, _A Horse's Tale_ |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
tchie, _The C programming language_, |
_o__) 1988 |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
ing the explanation.
--
\“If this is your first visit to the USSR, you are welcome to |
`\ it.” —hotel room, Moscow |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
“If you continue running Windows, your system may become |
`\unstable.” —Microsoft, Windows 95 bluescreen error message |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
On May 27, 5:33 pm, Ethan Furman wrote:
> Lew Schwartz wrote:
> > So, if I read between the lines correctly, you recommend Python 3? Does
> > the windows version install with a development environment?
>
> Dabo, last I checked, uses wxPython, which uses wxWidgets (sp?), which
> is not yet ported t
ent.” —Robert Benchley |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
myself to the wrong which I condemn.” —Henry Thoreau, _Civil |
_o__)Disobedience_ |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney writes:
> the two-character “CR LF” sequence (U+000C U+000A)
> http://en.wikipedia.org/wiki/Newline>
As detailed in that Wikipedia article, the characters are of course
U+000D U+000A.
--
\ “You say “Carmina”, and I say “Burana”, You say “Fortuna”, and |
`\
for other non-name references like list indices etc.
--
\ “Pinky, are you pondering what I'm pondering?” “I think so, |
`\ Brain, but where are we going to find a duck and a hose at this |
_o__) hour?” —_Pinky and The Brain_ |
Ben Finney
--
http:/
nt/93903/I_m_OK_The_Bull_Is_Dead>
--
\ Moriarty: “Forty thousand million billion dollars? That money |
`\must be worth a fortune!” —The Goon Show, _The Sale of |
_o__) Manhattan_ |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
valuable thing we have. Let us economize |
`\ it.” —Mark Twain, _Following the Equator_ |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
#x27;t ‘5.__add__(6)’, without
the space, work?
--
\“Telling pious lies to trusting children is a form of abuse, |
`\plain and simple.” —Daniel Dennett, 2010-01-12 |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
means something other than what they might expect.
--
\ “In case you haven't noticed, [the USA] are now almost as |
`\ feared and hated all over the world as the Nazis were.” —Kurt |
_o__) Vonnegut, 2004 |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
a Lily Tomlin, 1985 |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
Lily Tomlin |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
,
it's a good idea to stick to that specification when claiming to
implement that functionality in a type.
--
\ “The man who is denied the opportunity of taking decisions of |
`\ importance begins to regard as important the decisions he is |
_o__)allowed
ere a more elegant way?
Or should I to go the full database route? It is not a lage
application.
Ben
--
http://mail.python.org/mailman/listinfo/python-list
Uncle Ben writes:
> Or should I to go the full database route? It is not a lage
> application.
I would recommend you at least investigate the use of SQLite for your
application. It is part of the standard library since Python 2.5
http://docs.python.org/library/sqlite
[p for p in sys.path].
> Anyway this is a good example to distinguish
>
> [p for p in sys.path]
> from
> {p for p in sys.path}
>
> Both work in python
> But the second is probably not correct because path-searching is order
> dependent
Right. So i'm puzzled why y
len(n) == 0:
return []
else:
rest = n.copy()
e = rest.pop()
return [set([e]) | l for l in css(rest, r-1)] + css(rest, r)
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Rustom Mody writes:
> On Tuesday, September 5, 2017 at 1:44:24 AM UTC+5:30, Ben Bacarisse wrote:
>> Rustom Mody writes:
>>
>> > Here is some code I (tried) to write in class the other day
>> >
>> > The basic problem is of generating combinations
>
“An idea isn't responsible for the people who believe in it.” |
`\ —Donald Robert Perry Marquis |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
s, everything will remain the same.” —Barne's |
`\ Law |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
used a set but that's
just stylistic. Converting the list-of-list version to a set of
(frozen) sets is about twice as fast.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
just want
def cs(n, r): return frozenset({frozenset(s) for s in c(n, r)})
as suggested.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
gh
arbitrary rules are also possible, they will rarely be simple. (On
average a rule will need at least as many symbols to be described as the
puzzle itself[1].)
The trouble with this puzzle is that has at least two answers that are
simple rules and, to my mind, neither has a pleasing "ah!" associated
with it.
[1] Obviously this is not formal but it could be made so by reference to
algorithmic complexity.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
|
`\ devices tell us about the actual nature of reality.” —Ann |
_o__) Druyan, _Cosmos_, 2014 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
orrect whatever is
keeping them from moving to the actively-developed language.
--
\ “Dvorak users of the world flgkd!” —Kirsten Chevalier, |
`\rec.humor.oracle.d |
_o__)
it is
best to avoid the dead-end Python 2 altogether and use the current
version of Python 3.
--
\ “My interest is in the future, as I am going to spend the rest |
`\ of my life there.” —Charles F. Kettering |
_o__)
ral “parent” to refer to that relationship.)
--
\“We cannot solve our problems with the same thinking we used |
`\ when we created them.” —Albert Einstein |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
y-value semantics need not copy large objects when
passing them to a function. The program must behave *as if* there is a
copy but there need not actually be one.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
people laugh.” —George Bernard Shaw |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
thing else |
`\ is opinion.” —Democritus |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ve a keyword argument for each name you want to refer to in
the format string.
--
\ “There's a certain part of the contented majority who love |
`\ anybody who is worth a billion dollars.” —John Kenneth |
_o__)Galbraith, 1992-05-23 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
can
categorically say the Python Secret Underground does not exist.
--
\ “Pinky, are you pondering what I'm pondering?” “Well, I think |
`\ so, Brain, but first you'd have to take that whole bridge |
_o__) apart, wouldn't you?” —_Pinky and T
consider it. The dress
looks good!
--
\ “Contentment is a pearl of great price, and whosoever procures |
`\it at the expense of ten thousand desires makes a wise and |
_o__) happy purchase.” —J. Balguy |
Ben Finney
--
https://mail.python.org/
der to justify in human speech. So, that
basis doesn't convince me of a useful pronunciation.
--
\“[R]ightful liberty is unobstructed action, according to our |
`\will, within limits drawn around us by the equal rights of |
_o__) others.” —T
know this is an old thread now, but Real Life got in the way of
programming as it so annoyingly does sometimes.)
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
, then we would still be sitting |
_o__) in caves sucking our feet.” —Gene Kan, creator of Gnutella |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
thought of Western civilization) |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
t the Zen of Python means what
you say it means :-)
--
\“I spent a lot of money on wine and women, and like a fool I |
`\ squandered the rest.” —Benny Hill |
_o__) |
Ben Finney
--
https://mail
ar communication.
That's IMO support for “tee kay inter” pronunciation of “Tkinter”.
--
\ “Remember: every member of your ‘target audience’ also owns a |
`\ broadcasting station. These ‘targets’ can shoot back.” —Michael |
_o__) Rathbun to advertisers, news.admin.ne
Steven D'Aprano writes:
> On Thu, 14 Sep 2017 17:01:30 +1000, Ben Finney wrote:
>
> > [“Tkinter” is] not an English word. Yet we are still called upon to
> > pronounce it.
>
> This is the first time I've heard an English language jargon word
> described a
urd is able to make you |
`\unjust.” —Voltaire |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
mon implementations. To get a more
fruitful exchange of views, a division like 1/3 or 1/10 might be a
better example.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
tion I expected!
Teaching rings and fields is (or at least was 30 or so years ago) 1st
year undergraduate maths here in the UK. Maybe it's changed.
BTW, I don't think this has anything to do with what 1/3 should be in
Python. Python as no interest in rings and fields -- it's purely a
pragmatic decision.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
n that was repeatedly
asked was whether a universal print function could be written in this or
that language.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
bartc writes:
> Value-Added-Tax in the UK increased from 17.5% to 20%, ...
When it was 17.5% you could shock people not in the know by working it
out in your head since it's much simpler than it sounds: take a tenth,
halve it, halve it again, and add all three.
--
Ben.
-
't believe you.
Dull knife, was it? Luxury! We had to dab at card wi' tongue 'till it
were wet enough to punch with a whittled stick.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
tial Mystery that attends any journey is: how did the |
`\ traveller reach his starting point in the first place?” —Louise |
_o__) Bogan, _Journey Around My Room_ |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
27;Not
',D('=',' is ',D('!','Not ',""" Boolean Operators
1&1=1
1&0=0
0&1=0
0&0=0
1|1=1
1|0=1
0|1=1
0|0=0
!1=0
!0=1"""
And applying the same idea twice I can get 255:
def D(x,y,s):return s.replace(x,y)
print(eval(D('"D','D("',D(',','","','''"D-,--,D1,True,D0,False,D&, and ,D|, or
,D!,Not ,D=, is ,D!,Not ,"" Boolean Operators
1&1=1
1&0=0
0&1=0
0&0=0
1|1=1
1|0=1
0|1=1
0|0=0
!1=0
!0=1"""'''
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
all. You can continue with
that license grant indefinitely.
--
\ “One time I went to a drive-in in a cab. The movie cost me |
`\ ninety-five dollars.” —Steven Wright |
_o__) |
Ben Fin
discuss how both misapprehensions are wrong.
--
\ “[H]ow deep can a truth be — indeed, how true can it be — if it |
`\ is not built from facts?” —Kathryn Schulz, 2015-10-19 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
erday, stand up today.” —_The Anatomy of |
`\ Frustration_, H. G. Wells, 1936 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
drive downtown and get a |
`\ great parking spot, then sit in my car and count how many |
_o__)people ask me if I'm leaving.” —Steven Wright |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
you know.” —Sassan Tat |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
gt; return sequence
>
> It crawls pretty soon. Please advise?
A mathematical rather than Python answer... change it to
last = (last**2 + c) % N
return next
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Steve D'Aprano writes:
> On Mon, 2 Oct 2017 09:49 am, Ben Bacarisse wrote:
>
>> Daniel Bastos writes:
>>
>>> def make_sequence_non_recursive(N, x0 = 2, c = -1):
>>> "What's wrong with this function? It's very slow."
>>>
Steve D'Aprano writes:
> On Mon, 2 Oct 2017 12:00 pm, Ben Bacarisse wrote:
>
>
>>> Better:
>>>
>>> last = (pow(last, 2, N) + (2 % N)) % N
>>
>> You meant c rather than 2, I think.
>
> Oops, yes, that was a typo.
>
>
>>
y_group[group_name]
}
for group_name in argument_names_by_group
}
--
\ “I believe our future depends powerfully on how well we |
`\ understand this cosmos, in which we float like a mote of dust |
_o__) in the morning sky.” —Carl Sagan, _Cosmos_, 1980 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
hat don't exit the loop ...
while condition
begin
... more statements that don't exit the loop ...
... statements that don't exit the loop ...
end
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
ear.” —Ambrose Redmoon |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
-loop as an abbreviation for that.
That sounds very complicated, but I think I favour the other extreme to
you.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
ode, I would certainly not
indent my text commentary.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
> and repeat if statements for the rest of 25+ employees.
Eek! When you have named objects selected using a string that is the
object's name you know you want a dict. You'd have a single dict for
all employees, keyed by the tag in field 18 of the file. Does that
help?
I'm del
nd why |
`\ is, quite literally, what a very large part of our brain has |
_o__) evolved to do.” —Douglas Adams |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
e to be cautious before accepting the research as
> fact.
I think the paper is this one:
http://faculty.psy.ohio-state.edu/sloutsky/pdf/KSH-published.pdf
(You can find more recent papers by searching the Ohio State University
site.)
>From what I've read, your anecdotes are not in c
me across a few too many programs
lately clearly written by people who want to be helpful, but the wordy
output is hard to parse when using the program in a script. Some
programs offer a flag to simplify the output so it can be processed more
easily, but not all...
> But the OS is what it is, and the culture has a certain level of commandline
> machismo, so that's unlikely to change.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
put fileno to see if a prompt is needed. You
could argue, though, that anyone who's re-arranged a program's input so
that some non-zero input fileno is attached to a terminal won't need the
prompt!
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Steve D'Aprano writes:
> On Fri, 6 Oct 2017 09:33 pm, Ben Bacarisse wrote:
>
>> A general solution to the (rather odd) complaint about silent waiting
>> should really check any input fileno to see if a prompt is needed. You
>> could argue, though, that anyone who
> If gcc -E wrote its output to a file, you'd have to read that file,
>> manage the process of deleting it after use (and handle possible
>> deletion of it if an error occurred), etc.
>
> But if I use the -S option (show assembly listing) that DOES output to
> a fil
in the 1970s either. No one did it then and no
one does it now. What you are actually saying is that it is not
acceptable that the option of unprompted input even exists.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
bartc writes:
> On 07/10/2017 01:14, Ben Bacarisse wrote:
>> bartc writes:
>>
>>> On 06/10/2017 14:35, Paul Moore wrote:
>>>> On 6 October 2017 at 13:56, bartc wrote:
>>>>> If you don't like the word 'crude'
e that were (Perl almost always was) could not, by
default, be used embedded -- you had to generate the whole page.
What is (or are) the Python way (or ways) to do it?
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico writes:
> On Thu, Oct 12, 2017 at 7:42 AM, Ben Bacarisse wrote:
>> Bill writes:
>>
>>> Mikhail V wrote:
>>>>>>> [...] I'm not here to "cast stones", I like Python. I just think
>>>>>>> that you
ferent type. I think you mean that a human writing C
(rather than bartc's code generator) would probably design the code to
use tokenrec ** then I agree, but the latter is not just a different way
to write the former.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Ben Bacarisse writes:
>>That's a different type. I think you mean that a human writing C
>>(rather than bartc's code generator) would probably design the code to
>>use tokenrec ** then I agree, but the latter is not
Chris Angelico writes:
> On Thu, Oct 12, 2017 at 9:44 AM, Ben Bacarisse wrote:
>> Chris Angelico writes:
>>> Check out Django and Flask, the two most popular ways. I quite like
>>> Flask.
>>
>> I see. Both appear to be frameworks (I'd heard of Djang
Chris Angelico writes:
> On Thu, Oct 12, 2017 at 11:55 AM, Ben Bacarisse wrote:
>> Chris Angelico writes:
>>> it binds your URLs to
>>> the concrete file system. That may not seem like too much of a
>>> problem, but it's a pretty big limita
the same between C and C++. Even two
> different C compilers could return different values.
The size of (in the sense of sizeof) an expression of type char is
defined to be 1. All conforming C and C++ compilers must return 1 in
such a case. The difference being highlighted here is that, in C, 'a'
is an integer expression. In C++ it's of type char.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico writes:
> On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse wrote:
>> Chris Angelico writes:
>>
>>> On Thu, Oct 12, 2017 at 11:55 AM, Ben Bacarisse
>>> wrote:
>>>> Chris Angelico writes:
>>>>> it binds your URLs to
>
Gregory Ewing writes:
> Ben Bacarisse wrote:
>> That's a different type. I think you mean that a human writing C
>> (rather than bartc's code generator) would probably design the code to
>> use tokenrec ** then I agree, but the latter is not just a different way
Chris Angelico writes:
> On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans wrote:
>> On 2017-10-12 07:31, Chris Angelico wrote:
>>> On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse
>>> wrote:
>>>> Provided some early part of the URL is handled by PHP, the r
Jon Ribbens writes:
> On 2017-10-12, Ben Bacarisse wrote:
>> Chris Angelico writes:
>>> Normally, with a Python-based framework, you don't need _any_ web
>>> server configuration. You simply define your URL routing within the
>>> Python code. The o
Thomas Jollans writes:
> On 2017-10-12 15:16, Ben Bacarisse wrote:
>> Gregory Ewing writes:
>>
>>> Ben Bacarisse wrote:
>>>> That's a different type. I think you mean that a human writing C
>>>> (rather than bartc's code generator) wou
Jon Ribbens writes:
> On 2017-10-12, Ben Bacarisse wrote:
>> I see. If I'm reading this right, the app requests are passed through
>> to another server -- uWSGI.
>
> Yes. It doesn't have to be uWSGI; it could be gunicorn, or you could
> probably use Apache
Chris Angelico writes:
> On Fri, Oct 13, 2017 at 1:09 AM, Ben Bacarisse wrote:
>> Chris Angelico writes:
>>
>>> On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans wrote:
>>>> On 2017-10-12 07:31, Chris Angelico wrote:
>>>>> On Thu, Oc
Chris Angelico writes:
> On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse wrote:
>> Chris Angelico writes:
>>> I abbreviated that down to nothing, but since you ask, here's a really
>>> REALLY simple run-down of how to use Heroku:
>>
>> I
Chris Angelico writes:
> On Sat, Oct 14, 2017 at 8:42 AM, Ben Bacarisse wrote:
>> Chris Angelico writes:
>>
>>> On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse
>>> wrote:
>>>> Chris Angelico writes:
>>>>> I abbreviated that down
"Peter J. Holzer" writes:
> On 2017-10-13 21:42, Ben Bacarisse wrote:
>> That's one way to put it. Another is that to use Python I need to buy a
>> new service that is already configured.
>
> That's exactly the same for PHP. You can't use that ei
7;http://finance.yahoo.com/d/quotes.csv?s=aapl&f=l1'
156.99
Finally, wget -S shows that the resource has moved. It is now at
Location: http://download.finance.yahoo.com/d/quotes.csv?s=aapl&f=l1
I don't think this has anything to do with your problem, but it's worth
noting.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
eresting.
> Apparently, Python 3 differs from Python 2 in the way that it is
> handling a missing/forwarding URL, because the original code in Python
> 2.7 works perfectly.
Python 3 works for me. I still suspect it's some system difference
rather than being, say, a 3.6.1 vs 3.5.2 difference. What happens if
you change the URL to use https rather than http?
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Irv Kalb writes:
>> On Oct 14, 2017, at 6:46 PM, Ben Bacarisse wrote:
>>>> Finally, wget -S shows that the resource has moved. It is now at
>>>>
>>>> Location: http://download.finance.yahoo.com/d/quotes.csv?s=aapl&f=l1
>>>>
>>
al sanction, most or all of our religious |
`\ beliefs and rituals would fall into the domain of mental |
_o__) disturbance.” —John F. Schumaker |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ossible.
Of course it is. I have half a dozen programs on this machine that do
it. I don't need yours.
It's possible you want to claim something beyond what you stated, but no
one is going to get excited until you actually claim such a thing.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
ost the link to the journal
article when you are done.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
501 - 600 of 5100 matches
Mail list logo