On Tue, 04 Mar 2014 17:04:55 +1100, Chris Angelico wrote:
> On Tue, Mar 4, 2014 at 4:35 PM, Steven D'Aprano
> wrote:
>> On Tue, 04 Mar 2014 05:37:27 +1100, Chris Angelico wrote:
>>> x = 23 # Compiler goes: Okay, x takes ints. x += 5 # Compiler: No
>>> prob, int += int --> int x = str(x) # Compile
Hi,
In my understanding (I'm relatively new to python), I need to decode any
bytes data provided, in my case, by a shell command (such as findmnt)
started by the subprocess module. The goal of my application is to parse
the command outputs.
My application runs only on linux BTW and should run fin
"Steven D'Aprano" wrote in message
news:5314bb96$0$29985$c3e8da3$54964...@news.astraweb.com...
Think about the sort of type declarations you have to do in (say) Pascal,
and consider how stupid the compiler must be:
function add_one(x: integer):integer;
begin
add_one := x+1;
end;
Given th
Hi,
I was just looking into some documentation on readthedocs and I saw that they
have a cool new theme. I was wondering how the python documentation will look
like with that theme. So after some tinkering I have build python 2.7 CHM
documentation with the theme.
If you are wondering too you c
Hi, ALL,
Could someone please explain to me how the code in
http://docs.python.org/2/howto/logging#logging-from-multiple-modules
works?
In particular I'm interested in how the mylib.py knows about the myapp.log.
What I mean is: logging object is not passed to mylib.py, so
essentially it should cre
Op 2014-03-03T12:22:48 UTC schreef donarb in het
bericht , ID: <04659633-e14e-4d5b-90f2-93af04f05...@googlegroups.com> het
volgende.
> You're using the months format '%m' when you should be using minutes
> '%M'.
Arrgh: stupid error (snik).
p 2014-03-04T08:11:46 UTC schreef Chris Angelico in
Op 04-03-14 09:56, Steven D'Aprano schreef:
>
>
>> If you
>> explicitly say that this is an int, then yes, that should be disallowed;
> It's that "explicitly" part that doesn't follow. Having to manage types
> is the most tedious, boring, annoying, *unproductive* part of languages
> like Java, C
Op 02-03-14 11:41, Stefan Behnel schreef:
> Haven't seen any mention of it on this list yet, but since it's such an
> obvious flaw in quite a number of programming languages, here's a good
> article on the recent security bug in iOS, which was due to accidentally
> duplicated code not actually bei
Chris Angelico wrote:
In constant space, that will produce the sum of two infinite sequences
of digits.
It's not constant space, because the nines counter
can grow infinitely large.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 04 Mar 2014 09:18:57 +1100, Ben Finney wrote:
> Marko Rauhamaa writes:
>
>> Mark Lawrence :
>>
>> > I'd just like to know why people are so obsessed with identities,
>> > I've never thought to use them in 10+ years of writing Python. Do I
>> > use the KISS principle too often?
>>
>> Cal
On Mon, Mar 3, 2014 at 11:35 PM, Chris Angelico wrote:
> In constant space, that will produce the sum of two infinite sequences
> of digits. (And it's constant time, too, except when it gets a stream
> of nines. Adding three thirds together will produce an infinite loop
> as it waits to see if the
On Tue, Mar 4, 2014 at 4:19 AM, Ian Kelly wrote:
> def cf_sqrt(n):
> """Yield the terms of the square root of n as a continued fraction."""
>m = 0
> d = 1
> a = a0 = floor_sqrt(n)
> while True:
> yield a
> next_m = d * a - m
> next_d = (n - next_m * next
On Tue, 04 Mar 2014 11:56:07 +0100, Antoon Pardon wrote:
> Op 04-03-14 09:56, Steven D'Aprano schreef:
>
>
>>
>>> If you
>>> explicitly say that this is an int, then yes, that should be
>>> disallowed;
>> It's that "explicitly" part that doesn't follow. Having to manage types
>> is the most tedi
On Tue, 04 Mar 2014 11:10:34 +, Alister wrote:
> Definition of insanity
>
> Doing the same thing over and over again & expecting different results
*rolls dice*
:-)
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
How do I read a binary file, find/identify a character string and replace it
with another character string and write out to another file?
Its the finding of the string in a binary file that I am not clear on.
Any help appreciated
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Mar 4, 2014 at 10:05 PM, Gregory Ewing
wrote:
> Chris Angelico wrote:
>>
>> In constant space, that will produce the sum of two infinite sequences
>> of digits.
>
>
> It's not constant space, because the nines counter
> can grow infinitely large.
Okay, okay, technically yes. But the count
On 2014-03-04 02:09, Dennis Lee Bieber wrote:
On Sun, 2 Mar 2014 22:16:31 -0800 (PST), Westley Martínez
declaimed the following:
I understand that in an object method the first argument in the
object itself, called self. However, it doesn't have to be called
self, and can be called anything.
Am 03.03.2014 19:48, schrieb Terry Reedy:
> The 'is' operator has three uses, two intended and one not. In
> production code, 'is' tests that an object *is* a particular singular
> object, such as None or a sentinel instance of class object.
Just a bit of statistics on this one from a recent small
On Tue, Mar 4, 2014 at 10:47 PM, Steven D'Aprano
wrote:
> Not even close. I'd like to see the compiler that can work out for itself
> that this function is buggy:
>
> def sine_rule(side_a, side_b, angle_a):
> """Return the angle opposite side_b."""
> return math.sin(side_b/side_a)*angle_a
On 2014-03-04 12:27, loial wrote:
How do I read a binary file, find/identify a character string and
replace it with another character string and write out to another
file?
Its the finding of the string in a binary file that I am not clear
on.
Any help appreciated
Read it in chunks and search
loial wrote:
> How do I read a binary file, find/identify a character string and replace
> it with another character string and write out to another file?
>
> Its the finding of the string in a binary file that I am not clear on.
That's not possible. You have to convert either binary to string o
On 2014-03-04 02:41, Rolando wrote:> On Monday, March 3, 2014 6:06:22 PM
UTC-8, MRAB wrote:
>> On 2014-03-04 01:33, Rolando wrote:
>> > I have a GUI with a bunch of cells which is my "View" in the MVC
>> > design. The user enters some information in the view and I pass
>> > this on to the mode
"Steven D'Aprano" wrote in message
news:53159540$0$2923$c3e8da3$76491...@news.astraweb.com...
It's that "explicitly" part that doesn't follow. Having to manage types
is the most tedious, boring, annoying, *unproductive* part of languages
like Java, C and Pascal. Almost always, you're telling th
On Wed, Mar 5, 2014 at 12:30 AM, BartC wrote:
> But declaring variables is not just about specifying a type; it registers
> the name too so that misspelled names can be picked up very early rather
> than at runtime (and that's if you're lucky).
The two are separate. I don't know of any language t
On 04/03/2014 13:30, BartC wrote:
But declaring variables is not just about specifying a type; it registers
the name too so that misspelled names can be picked up very early rather
than at runtime (and that's if you're lucky).
I've said before that this, to me, is one of the major downsides o
On Tue, Mar 4, 2014 at 11:55 PM, Alexander Blinne wrote:
> Am 03.03.2014 19:48, schrieb Terry Reedy:
>> The 'is' operator has three uses, two intended and one not. In
>> production code, 'is' tests that an object *is* a particular singular
>> object, such as None or a sentinel instance of class ob
On Wed, Mar 5, 2014 at 1:05 AM, Mark Lawrence wrote:
> On 04/03/2014 13:30, BartC wrote:
>>
>>
>> But declaring variables is not just about specifying a type; it registers
>> the name too so that misspelled names can be picked up very early rather
>> than at runtime (and that's if you're lucky).
>
On Tue, 04 Mar 2014 12:47:09 +, MRAB wrote:
> In AppleScript a script can refer to the title of a window as "title of
> window" or "window's title", and it can refer to the title of its own
> window as "title of window of me" or "me's window's title". Consistent,
> yes, but bad English.
>
> T
On Wed, 05 Mar 2014 00:01:01 +1100, Chris Angelico wrote:
> On Tue, Mar 4, 2014 at 10:47 PM, Steven D'Aprano
> wrote:
>> Not even close. I'd like to see the compiler that can work out for
>> itself that this function is buggy:
>>
>> def sine_rule(side_a, side_b, angle_a):
>> """Return the ang
On 2014-03-04 14:25, Steven D'Aprano wrote:
> Ask-me-about-versine-and-haversine-ly y'rs,
More interested in a karosine, cuisine, and a limousine. ;-)
-tkc
--
https://mail.python.org/mailman/listinfo/python-list
On 04/03/2014 14:37, Tim Chase wrote:
On 2014-03-04 14:25, Steven D'Aprano wrote:
Ask-me-about-versine-and-haversine-ly y'rs,
More interested in a karosine, cuisine, and a limousine. ;-)
-tkc
What do you get if you differentiate versines, haversines, karosines,
cuisines and limosines?
On Tue, 04 Mar 2014 14:05:44 +, Mark Lawrence wrote:
> Once a statically typed language has been compiled the programmer can
> head down to the pub.
"It compiles? Quick! Ship it!"
Well, that certainly explains the quality of some programs...
--
Steven D'Aprano
http://import-that.dreamwi
On 2014-03-03, Ben Finney wrote:
> Gregory Ewing writes:
>
>> Just because the compiler *can* infer the return type doesn't
>> necessarily mean it *should*. When I was playing around with
>> functional languages, I ended up adopting the practice of always
>> declaring the types of my functions, b
On Wed, Mar 5, 2014 at 1:25 AM, Steven D'Aprano
wrote:
>
> The Sine Rule, or Law of Sines, tells us that the ratio of the
> length of a side and the sine of the angle opposite that side is constant
> for any triangle. That is:
>
> a/sin(A) == b/sin(B) == c/sin(C)
Oh! Right. Now I remember. Yeah.
On Wed, Mar 5, 2014 at 1:55 AM, Steven D'Aprano
wrote:
> On Tue, 04 Mar 2014 14:05:44 +, Mark Lawrence wrote:
>
>> Once a statically typed language has been compiled the programmer can
>> head down to the pub.
>
> "It compiles? Quick! Ship it!"
>
> Well, that certainly explains the quality of
On Mon, Mar 3, 2014 at 11:52 PM, Steven D'Aprano wrote:
> If your intention is to treat None as a singleton sentinel, not as a
> value, then you ought to use "is" to signal that intention, rather than
> using == even if you know that there won't be any false positives.
In all of the years I've be
On Tue, 04 Mar 2014 13:30:04 +, BartC wrote:
> "Steven D'Aprano" wrote in message
> news:53159540$0$2923$c3e8da3$76491...@news.astraweb.com...
>
>> It's that "explicitly" part that doesn't follow. Having to manage types
>> is the most tedious, boring, annoying, *unproductive* part of languag
On 2014-03-04 14:42, Mark Lawrence wrote:
> What do you get if you differentiate versines, haversines,
> karosines, cuisines and limosines?
Well, with cuisines, you can usually differentiate by seasoning:
your Tex/Mex is spicier and tends to have chili & cumin, while your
Indian tends to lean more
On 3.3.2014. 2:27, Ian Kelly wrote:
Python 3.3 has a C API function to create a memoryview for a char*,
that can be made read-only.
http://docs.python.org/3/c-api/memoryview.html#PyMemoryView_FromMemory
I don't see a way to do what you want in pure Python, apart from
perhaps writing an el
On Tue, 04 Mar 2014 14:59:51 +, Grant Edwards wrote:
> After a couple decades of working in software development, I've decided
> that comments like that are not correct often enough to be useful.
> You've got to reverse-engineer the code if there's no such comment. If
> there _is_ a comment,
On Wed, Mar 5, 2014 at 2:19 AM, Jerry Hill wrote:
> Out of curiosity, do you think we should be doing truth checking with
> 'is'? True and False are singletons, and it seems to me that the
> justification for idenity versus equality should be just as strong
> there, but I don't think I've ever se
On Wed, Mar 5, 2014 at 2:18 AM, Steven D'Aprano
wrote:
> You don't need to have static typing to have declared variables. The two
> are independent. E.g. one might have a system like Python, except you
> have to declare your variables before using them:
>
> global x
> local a
> a = x+1
Aside: If
Igor Korot wrote:
> Hi, ALL,
> Could someone please explain to me how the code in
> http://docs.python.org/2/howto/logging#logging-from-multiple-modules
> works?
> In particular I'm interested in how the mylib.py knows about the
> myapp.log.
>
> What I mean is: logging object is not passed to myl
On Tue, 04 Mar 2014 10:19:22 -0500, Jerry Hill wrote:
> On Mon, Mar 3, 2014 at 11:52 PM, Steven D'Aprano
> wrote:
>> If your intention is to treat None as a singleton sentinel, not as a
>> value, then you ought to use "is" to signal that intention, rather than
>> using == even if you know that th
On Wed, 05 Mar 2014 02:28:17 +1100, Chris Angelico wrote:
> On Wed, Mar 5, 2014 at 2:18 AM, Steven D'Aprano
> wrote:
>> You don't need to have static typing to have declared variables. The
>> two are independent. E.g. one might have a system like Python, except
>> you have to declare your variabl
On Wed, Mar 5, 2014 at 2:42 AM, Steven D'Aprano
wrote:
> # I never know when to stop
> if bool(flag) is True is True is True is True is True is True: ...
The banana problem.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Mar 5, 2014 at 2:45 AM, Steven D'Aprano
wrote:
>> Aside: If you declare your locals, you shouldn't need to declare your
>> globals. Though I could imagine a rule that global rebinding still needs
>> to be declared, but you certainly shouldn't need to declare nonlocal if
>> you have a local
Francis Moreau wrote:
> Hi,
>
> In my understanding (I'm relatively new to python), I need to decode any
> bytes data provided, in my case, by a shell command (such as findmnt)
> started by the subprocess module. The goal of my application is to parse
> the command outputs.
>
> My application ru
In article ,
Chris Angelico wrote:
> On Wed, Mar 5, 2014 at 2:42 AM, Steven D'Aprano
> wrote:
> > # I never know when to stop
> > if bool(flag) is True is True is True is True is True is True: ...
>
> The banana problem.
>
> ChrisA
You can refactor that as:
eval(" is ".join(itertools.chain(
Juraj Ivančić, 04.03.2014 16:23:
> Just for reference, it is doable in pure Python, with ctypes help
For some questionable meaning of "pure".
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
On Tuesday, March 4, 2014 8:49:22 PM UTC+5:30, Jerry Hill wrote:
> On Mon, Mar 3, 2014 at 11:52 PM, Steven D'Aprano wrote:
> > If your intention is to treat None as a singleton sentinel, not as a
> > value, then you ought to use "is" to signal that intention, rather than
> > using == even if you kn
On Monday, 3 March 2014 22:55:32 UTC, Chris Kaynor wrote:
> You can go much simpler than that. Merely port Python to LISP, then write a
> LISP interpreter in Python. Done.
http://blog.pault.ag/post/46982895940/heres-my-talk-from-pycon-2013-i-tried-to-queue
--
https://mail.python.org/mailman/lis
Note that it's bad form to post the same question to different forums, you also
posted this question to django-users. By posting to multiple forums, you run
the risk of not having the question answered or followed up in one of the
forums. This frustrates other users who may one day have a simila
On 2014-03-04 15:13, Chris Angelico wrote:
On Wed, Mar 5, 2014 at 1:55 AM, Steven D'Aprano
wrote:
On Tue, 04 Mar 2014 14:05:44 +, Mark Lawrence wrote:
Once a statically typed language has been compiled the programmer can
head down to the pub.
"It compiles? Quick! Ship it!"
Well, that c
On Wed, Mar 5, 2014 at 3:41 AM, wrote:
> On Monday, 3 March 2014 22:55:32 UTC, Chris Kaynor wrote:
>> You can go much simpler than that. Merely port Python to LISP, then write a
>> LISP interpreter in Python. Done.
>
> http://blog.pault.ag/post/46982895940/heres-my-talk-from-pycon-2013-i-tried-
On 2014-03-04 14:27, Steven D'Aprano wrote:
On Tue, 04 Mar 2014 12:47:09 +, MRAB wrote:
In AppleScript a script can refer to the title of a window as
"title of window" or "window's title", and it can refer to the
title of its own window as "title of window of me" or "me's
window's title". C
On 2014-03-04 16:02, Chris Angelico wrote:
On Wed, Mar 5, 2014 at 2:42 AM, Steven D'Aprano
wrote:
# I never know when to stop
if bool(flag) is True is True is True is True is True is True: ...
The banana problem.
Speaking of which:
The 'right' way to peel a banana
http://www.telegraph.co.u
On Tue, Mar 4, 2014 at 11:07 AM, Chris Angelico wrote:
> I don't have time to watch an hour-long video... what'd he do, exactly that?
If you fast forward to 16:14, his talk is about five minutes long. He
wrote a Lisp compiler whose backend is Python.
Skip
--
https://mail.python.org/mailman/list
In article ,
donarb wrote:
> Note that it's bad form to post the same question to different forums, you
> also posted this question to django-users. By posting to multiple forums, you
> run the risk of not having the question answered or followed up in one of the
> forums. This frustrates oth
Chris Angelico :
> As far as I know, there's no simple way, in constant space and/or
> time, to progressively yield more digits of a number's square root,
> working in decimal.
I don't know why the constant space/time requirement is crucial. Anyway,
producing more digits simple: http://nrich.math
Antoon Pardon :
> In the same way writing unit tests is the most tedious, boring,
> annoying, *unproductive* part. Amost always you are giving the program
> results it can work out for itself.
Undoubtedly, explicit type declarations add a dimension of quality to
software. However, they also signi
On Wed, Mar 5, 2014 at 6:49 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> As far as I know, there's no simple way, in constant space and/or
>> time, to progressively yield more digits of a number's square root,
>> working in decimal.
>
> I don't know why the constant space/time requirement is
On Wed, Mar 5, 2014 at 6:49 AM, Marko Rauhamaa wrote:
> public ConnectionPool(int maxConnections, String url) throws SQLException {
> try {
> super(() -> {
> try {
> return DriverManager.getConnection(url);
> } catch ( SQLException ex ) {
>
===
>BREAKING NEWS!
===
NEW YORK TIMES, THRINAXODON, OHIO
=
>
THRINAXODON RECENTLY FOUND 3 HUMAN FOSSILS FROM DEVONIAN STRATA FROM
GREENLAND, THE EVOLUTIONISTS HAVE NO BONES ABOUT.
>
ONE EVIL EVOLUTIONIST, BOB CASANOVA HAS ADMITTED THAT HUMAN EVOLUTIO
On 3/4/14 12:16 PM, Skip Montanaro wrote:
On Tue, Mar 4, 2014 at 11:07 AM, Chris Angelico wrote:
I don't have time to watch an hour-long video... what'd he do, exactly that?
If you fast forward to 16:14, his talk is about five minutes long. He
wrote a Lisp compiler whose backend is Python.
S
Chris Angelico :
> On Wed, Mar 5, 2014 at 6:49 AM, Marko Rauhamaa wrote:
>> public ConnectionPool(int maxConnections, String url) throws SQLException {
>> try {
>> super(() -> {
>> try {
>> return DriverManager.getConnection(url);
>> } catch ( S
Hi, ALL,
I'm getting this:
timestamp out of range for platform localtime()/gmtime() function
trying to convert the timestamp with milliseconds into the datetime object.
The first hit of Google gives me this:
http://stackoverflow.com/questions/12458595/convert-epoch-timestamp-in-python
but the
On 4 March 2014 19:58, Chris Angelico wrote:
> On Wed, Mar 5, 2014 at 6:49 AM, Marko Rauhamaa wrote:
>> Chris Angelico :
>>
>>> As far as I know, there's no simple way, in constant space and/or
>>> time, to progressively yield more digits of a number's square root,
>>> working in decimal.
>>
>> I
On Wed, Mar 5, 2014 at 7:50 AM, Marko Rauhamaa wrote:
> The "rigmarole" is trying to get around Java's mandatory exception
> handling limitations, which Python doesn't have.
>
> You are not allowed to pass a lambda to the super constructor that
> throws an SQLException. To get around the limitatio
Oscar Benjamin :
> To me the obvious method is Newton iteration which takes O(sqrt(N))
> iterations to obtain N digits of precision. This brings the above
> complexity below quadratic:
>
> #!/usr/bin/env python
>
> from decimal import Decimal as D, localcontext
>
> def sqrt(y, prec=1000):
> ''
On Wed, Mar 5, 2014 at 7:55 AM, Oscar Benjamin
wrote:
> I don't quite follow your reasoning here. By "cut-and-try" do you mean
> bisection? If so it gives the first N decimal digits in N*log2(10)
> iterations. However each iteration requires a multiply and when the
> number of digits N becomes lar
Chris Angelico :
> Oh, it's THAT problem. Well, it's still not really a fair comparison
> of declared types. It shows how Python's much easier to work with, but
> what you're showing off is the simpler exception handling :)
The other example I gave is really bread-and-butter Java. An ergonomic
di
On Wed, Mar 5, 2014 at 8:21 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> Oh, it's THAT problem. Well, it's still not really a fair comparison
>> of declared types. It shows how Python's much easier to work with, but
>> what you're showing off is the simpler exception handling :)
>
> The other
On 2014-03-04 20:57, Igor Korot wrote:
Hi, ALL,
I'm getting this:
timestamp out of range for platform localtime()/gmtime() function
trying to convert the timestamp with milliseconds into the datetime object.
The first hit of Google gives me this:
http://stackoverflow.com/questions/12458595/co
[I found this via the python-ideas thread]
Wolfgang Maier biologie.uni-freiburg.de> writes:
> math.factorial is accurate and faster than your pure-Python function,
especially for large numbers.
It is slower for huge numbers than decimal if you use this
Python function:
http://www.bytereef.org/
On 04/03/2014 20:57, Igor Korot wrote:
Hi, ALL,
I'm getting this:
timestamp out of range for platform localtime()/gmtime() function
trying to convert the timestamp with milliseconds into the datetime object.
The first hit of Google gives me this:
http://stackoverflow.com/questions/12458595/co
Chris Angelico :
> C++ at least has typedefs, and in the newer standards, the 'auto'
> keyword was repurposed.
Last I checked, C++ had no satisfactory way to express
callbacks/functors/listeners/lambdas. That's why Qt came up with a
metacompiler to supplement C++'s facilities.
No, STL and Boost
MRAB,
On Tue, Mar 4, 2014 at 1:38 PM, MRAB wrote:
> On 2014-03-04 20:57, Igor Korot wrote:
>
>> Hi, ALL,
>> I'm getting this:
>>
>> timestamp out of range for platform localtime()/gmtime() function
>>
>> trying to convert the timestamp with milliseconds into the datetime
>> object.
>>
>> The fi
On 04/03/2014 21:38, MRAB wrote:
On 2014-03-04 20:57, Igor Korot wrote:
Hi, ALL,
I'm getting this:
timestamp out of range for platform localtime()/gmtime() function
trying to convert the timestamp with milliseconds into the datetime
object.
The first hit of Google gives me this:
http://stack
On Wed, Mar 5, 2014 at 8:43 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> C++ at least has typedefs, and in the newer standards, the 'auto'
>> keyword was repurposed.
>
> Last I checked, C++ had no satisfactory way to express
> callbacks/functors/listeners/lambdas. That's why Qt came up with a
Am 04.03.2014 15:06, schrieb Chris Angelico:
> https://github.com/Rosuav/ExceptExpr/blob/master/find_except_expr.py
I have always found it quite nice that the python parser is so easy to
use from within python itself.
> Run across the Python stdlib, that tells me there are 4040 uses of
> is/is no
Mark,
On Tue, Mar 4, 2014 at 1:45 PM, Mark Lawrence wrote:
> On 04/03/2014 21:38, MRAB wrote:
>
>> On 2014-03-04 20:57, Igor Korot wrote:
>>
>>> Hi, ALL,
>>> I'm getting this:
>>>
>>> timestamp out of range for platform localtime()/gmtime() function
>>>
>>> trying to convert the timestamp with m
Hi, Mark,
On Tue, Mar 4, 2014 at 1:44 PM, Mark Lawrence wrote:
> On 04/03/2014 20:57, Igor Korot wrote:
>
>> Hi, ALL,
>> I'm getting this:
>>
>> timestamp out of range for platform localtime()/gmtime() function
>>
>> trying to convert the timestamp with milliseconds into the datetime
>> object.
On Wed, Mar 5, 2014 at 8:46 AM, Igor Korot wrote:
>> Are you using Python 2? If yes, then try dividing by 1000.0.
>
>
> Yes, I'm using python 2.7.
> But dividing by 1000 will give the precision in seconds, i.e. "-MM-DD
> HH:MM:SS".
Did you notice the bit at the end there? Try dividing by 1000
On Wed, Mar 5, 2014 at 8:53 AM, Alexander Blinne wrote:
> Am 04.03.2014 15:06, schrieb Chris Angelico:
>> https://github.com/Rosuav/ExceptExpr/blob/master/find_except_expr.py
>
> I have always found it quite nice that the python parser is so easy to
> use from within python itself.
Yes. Until I p
On Wed, Mar 5, 2014 at 8:55 AM, Igor Korot wrote:
>
> This is because this timestamp is not in seconds, but rather in
> milliseconds.
>
> Now the question I have is: how do I properly convert this timestamp into
> the datetime object with the milliseconds?
Read elsewhere in the thread, two people
On 4 March 2014 21:18, Chris Angelico wrote:
> On Wed, Mar 5, 2014 at 7:55 AM, Oscar Benjamin
> wrote:
>> I don't quite follow your reasoning here. By "cut-and-try" do you mean
>> bisection? If so it gives the first N decimal digits in N*log2(10)
>> iterations. However each iteration requires a m
On 4 March 2014 21:05, Marko Rauhamaa wrote:
> Oscar Benjamin :
>
>> To me the obvious method is Newton iteration which takes O(sqrt(N))
>> iterations to obtain N digits of precision. This brings the above
>> complexity below quadratic:
>>
>> #!/usr/bin/env python
>>
>> from decimal import Decimal
On Wed, Mar 5, 2014 at 9:02 AM, Oscar Benjamin
wrote:
> On 4 March 2014 21:18, Chris Angelico wrote:
>> On Wed, Mar 5, 2014 at 7:55 AM, Oscar Benjamin
>> wrote:
>>> I don't quite follow your reasoning here. By "cut-and-try" do you mean
>>> bisection? If so it gives the first N decimal digits in
On 03/04/2014 01:55 PM, Igor Korot wrote:
Now the question I have is: how do I properly convert this timestamp
into the datetime object with the milliseconds?
And Mark's point is: How do the docs say to do it? What fails when you
try it that way?
--
~Ethan~
--
https://mail.python.org/mai
On 03/04/2014 12:47 PM, Ned Batchelder wrote:
On 3/4/14 12:16 PM, Skip Montanaro wrote:
On Tue, Mar 4, 2014 at 11:07 AM, Chris Angelico wrote:
I don't have time to watch an hour-long video... what'd he do,
exactly that?
If you fast forward to 16:14, his talk is about five minutes long. He
wr
On Wed, Mar 5, 2014 at 12:18 AM, Peter Otten <__pete...@web.de> wrote:
> loial wrote:
>
>> How do I read a binary file, find/identify a character string and replace
>> it with another character string and write out to another file?
>>
>> Its the finding of the string in a binary file that I am not
On 04/03/2014 21:55, Igor Korot wrote:
But this particular question is easy.
If it's easy why can't you answer it via the docs rather than ask here?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
---
This email is f
Ethan Furman :
> Okay, that looks totally cool. Maybe I'll finally get a handle on
> LISP! :)
Lisp is conceptually simpler than Python, but awe-inspiring. One day, it
will overtake Python, I believe.
Once you have Lisp down pat, you'll be able to appreciate http://en.wikipedia.org/wiki/Combinato
On 4 March 2014 22:18, Chris Angelico wrote:
> On Wed, Mar 5, 2014 at 9:02 AM, Oscar Benjamin
> wrote:
>> On 4 March 2014 21:18, Chris Angelico wrote:
>>> On Wed, Mar 5, 2014 at 7:55 AM, Oscar Benjamin
>>> wrote:
>>>
>>> epsilon = 0.0001
>>> def sqrt(n):
>>> guess1, guess2 = 1, n
>>> wh
On Wed, Mar 5, 2014 at 9:48 AM, Marko Rauhamaa wrote:
> Lisp is conceptually simpler than Python, but awe-inspiring. One day, it
> will overtake Python, I believe.
>
> The final Nirvana is reached with...
No no no. The final Nirvana is achieved when you no longer write text
at all, but simply edi
In article ,
Chris Angelico wrote:
> On Wed, Mar 5, 2014 at 9:48 AM, Marko Rauhamaa wrote:
> > Lisp is conceptually simpler than Python, but awe-inspiring. One day, it
> > will overtake Python, I believe.
> >
> > The final Nirvana is reached with...
>
> No no no. The final Nirvana is achieved
On Wed, Mar 5, 2014 at 9:54 AM, Oscar Benjamin
wrote:
>> Let's compare two
>> versions. In the first, you set the precision (I'm talking in terms of
>> REXX's "NUMERIC DIGITS" statement
>
> I have no idea what that is.
>
>>- anything beyond this many digits
>> will be rounded (and represented expo
I'm trying to learn python. I'm doing it via Zed Shaw's Learn Python
the Hard Way. Sure enough, 16 lessons in and I've run aground. Is it
OK for a painfully stupid ol' fart to ask painfully stupid noob
questions, here? I'm a long time usenet fan and prefer it to irc.
I've run Slackware for man
On 03/04/2014 03:03 PM, notbob wrote:
I'm trying to learn python. I'm doing it via Zed Shaw's Learn Python
the Hard Way. Sure enough, 16 lessons in and I've run aground. Is it
OK for a painfully stupid ol' fart to ask painfully stupid noob
questions, here? I'm a long time usenet fan and prefe
1 - 100 of 165 matches
Mail list logo