mj...@iol.pt wrote
You forgot to answer the question. You say The OS knows how to
open. Does *your* *program* know what program is needed, to open
this particular binary data?
Yes. My program knows. A database column stores the complete file name
(including extension), and I can be
Stephen Nelson-Smith wrote:
I think I'm having a major understanding failure.
Perhaps this will help ...
http://www.learningpython.com/2009/02/23/iterators-iterables-and-generators-oh-my/
snip
So in essence this:
logs = [ LogFile( /home/stephen/qa/ded1353/quick_log.gz, 04/Nov/2009 ),
mj...@iol.pt wrote:
div class=moz-text-flowed style=font-family:
-moz-fixedda...@ieee.org wrote:
(You forgot to send this message to the list, so I'm forwarding it)
mj...@iol.pt wrote:
da...@ieee.org wrote:
mj...@iol.pt wrote:
div class=oz-text-flowed style=font-family: -moz-fixedI'm
Shashwat Anand wrote:
How to find all possible integer co-ordinates lying on a circle of
given radius 'r'.
If given the upper bound of 'r', I want to calculate all given
co-ordinates lying for 0 = r = n
Let's say the upper bound of radius is 5
All possible results are:
radius 'r' - (x,
Hi Martin,
Thanks for a very detailed response. I'm about to head out, so I
can't put your ideas into practice yet, or get down to studying for a
while.
However, I had one thing I felt I should respond to.
It's unclear from your previous posts (to me at least) -- are the
individual log files
For my program I disable the py2exe log feature by routing output to the
nul-file.
Code:
if win32 and py2exe:
sys.stdout = open(nul, w)
sys.stderr = open(nul, w)
This always worked fine.
Today, I received an email from a user with the following error:
IOError:
Le Sat, 14 Nov 2009 10:43:47 -0700,
Modulok modu...@gmail.com s'exprima ainsi:
List,
This is kind off topic, but:
Does anyone else find, writing code while tired to be counterproductive?
It just seems like when I push myself to stay up late finishing a
project, I sorely regret it the
Christopher Spears, 14.11.2009 19:47:
Thanks! I have a lot of XML files at work that users search through. I
want to parse the XML into a python dictionary and then read the dictionary
into a database that users can use to search through the thousands of files.
I think database is the right
To upack your variables a and b you need an iterable object on the right
side, which returns you exactly 2 variables
What does 'unpack' mean? I've seen a few Python errors about packing
and unpacking. What does it mean?
S.
___
Tutor maillist -
On So, 2009-11-15 at 15:12 +, Stephen Nelson-Smith wrote:
To upack your variables a and b you need an iterable object on the right
side, which returns you exactly 2 variables
What does 'unpack' mean? I've seen a few Python errors about packing
and unpacking. What does it mean?
Stephen Nelson-Smith wrote:
It's unclear from your previous posts (to me at least) -- are the
individual log files already sorted, in chronological order?
Sorry if I didn't make this clear. No they're not. They are *nearly*
sorted - ie they're out by a few seconds, every so often, but they
i get asked this question a lot, esp. when it pertains to my book,
Core Python Programming. which should i learn? is your book
obsolete? etc. i basically tell them that even though they are
backwards-incompatible, it's not like Python 2 and 3 are so
different that you wouldn't recognize
Le Sat, 14 Nov 2009 20:49:52 +,
Stephen Nelson-Smith sanel...@gmail.com s'exprima ainsi:
My brother in law is learning python. He's downloaded 3.1 for
Windows, and is having a play. It's already confused him that print
hello world gives a syntax error
He's an absolute beginner
Le Sun, 15 Nov 2009 09:11:16 +0530,
Shashwat Anand anand.shash...@gmail.com s'exprima ainsi:
No, I'm trying to find all integer co-ordinates which lies on a circle.
Say for a circle of radius 5 the co-ordinates are [(5, 0), (0, 5), (-5, 0),
(0, -5), (3, 4), (4,3), (3, -4), (4, -3), (-3,
Forwarding to the tutor list with cut n paste sessions.
It looks to me like the code page issue somebody else
referred to is the problem but the behaviour seems a
bit extreme, I'd have thought it might have chosen
a default value or something...
But I'm not sure what causes it to select
Stephen Nelson-Smith sanel...@gmail.com wrote
To upack your variables a and b you need an iterable object on the right
side, which returns you exactly 2 variables
What does 'unpack' mean? I've seen a few Python errors about packing
and unpacking. What does it mean?
It has a coup[le of
Hi Marty,
Thanks for a very lucid reply!
Well, you haven't described the unreliable behavior of unix sort so I
can only guess, but I assume you know about the --month-sort (-M) flag?
Nope - but I can look it up. The problem I have is that the source
logs are rotated at 0400 hrs, so I need
spir wrote:
Le Sun, 15 Nov 2009 09:11:16 +0530,
Shashwat Anand anand.shash...@gmail.com s'exprima ainsi:
No, I'm trying to find all integer co-ordinates which lies on a circle.
Say for a circle of radius 5 the co-ordinates are [(5, 0), (0, 5), (-5, 0),
(0, -5), (3, 4), (4,3), (3,
On Sun, Nov 15, 2009 at 4:11 PM, Stephen Nelson-Smith sanel...@gmail.comwrote:
import gzip
from heapq import heappush, heappop, merge
Is this a preferred method, rather than just 'import heapq'?
It has a couple of advantages:
- convenience: if you import heapq, then to do a push you need
Forgive the top-posting, but when in Rome...
Running 'chcp' at the command line will show the default code page. Judging
from the OP's name it is probably an Arabic version of Windows.
Since Python 2.6 works it probably is falling back to something besides
cp720. Try:
import sys
print
@DaveA: thanks for pointing it out.
For a origin-centre circle x**2 + y**2 = r**2, I assumed r to be integer,
however it was r**2 which was integer. A mistake on my part.
On Mon, Nov 16, 2009 at 6:41 AM, Dave Angel da...@ieee.org wrote:
spir wrote:
Le Sun, 15 Nov 2009 09:11:16 +0530,
regarding Integer co-ordinates within a circle got a nice link :
http://mathworld.wolfram.com/GausssCircleProblem.html
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Sun, Nov 15, 2009 at 8:57 PM, Marc Tompkins marc.tompk...@gmail.com wrote:
On Sun, Nov 15, 2009 at 4:11 PM, Stephen Nelson-Smith sanel...@gmail.com
wrote:
import gzip
from heapq import heappush, heappop, merge
Is this a preferred method, rather than just 'import heapq'?
It has a
Marc Tompkins wrote:
On Sun, Nov 15, 2009 at 4:11 PM, Stephen Nelson-Smith sanel...@gmail.comwrote:
import gzip
from heapq import heappush, heappop, merge
Is this a preferred method, rather than just 'import heapq'?
It has a couple of advantages:
- convenience: if you
Le Sun, 15 Nov 2009 19:23:33 -,
Alan Gauld alan.ga...@btinternet.com s'exprima ainsi:
What does 'unpack' mean? I've seen a few Python errors about packing
and unpacking. What does it mean?
Unpacking is rarely needed. It matches some kind of problems.
Imagine you parse codes each made
From first-hand experience, i would concur :)
A refreshed mind will perform much better than an over-exerted one.
On Sat, Nov 14, 2009 at 8:57 PM, Alan Gauld alan.ga...@btinternet.comwrote:
Modulok modu...@gmail.com wrote
Does anyone else find, writing code while tired to be
hi,
Although not a question, i just want to tell you guys how awesome you are!
I am not a programmer, i can do a bit of bash. I have never officially
learnt programming, but numerous times looked at some perl, c, java
and never really gotten past the beginning stages of it. That all
changed when
Should I advise him to
stick with 2.6 for a bit, since most of the material out there will
be for 2.x? Or since he's learning from scratch, should he jump
straight to 3.x In which case what can you recommend for him to work
through - I must stress he has absolutely no clue at all about
28 matches
Mail list logo