Hello!
I'm about to parallelize some algorithm that turned out to be too
slow. Before I start doing it, I'd like to hear some suggestions/hints
from you.
The algorithm essentially works like this: There is a iterator
function "foo" yielding a special kind permutation of [1,n]. The
main progr
On Sep 29, 6:07 pm, [EMAIL PROTECTED] wrote:
> You did not mention the OS, but because you are using
> "pathname\editfile.txt", it sounds like you are using an MS OS. From
> past experience with various MS OSes, I found that as the number of
> files in a directory increases the slower your proces
Hello,
Yesterday, I was at a programming competition. We programmed on Linux
liveCD's and Python was one of the allowed languages (among C and
Java). I cared just about the algorithmic approach so I used Python.
One of the main rules is, that the code reads its standard input and
dumps the result
Hello!
Many times I was suggested to use xrange and range instead of the
while constructs, and indeed, they are quite more elegant - but, after
calculating the overhead (and losen flexibility) when working with
range/xrange, and while loops, you get to the conclusion that it isn't
really worth usi
Matias Jansson wrote:
> I come from a background of Java and C# where it is common practise to have
> one class per file in the file/project structure. As I have understood it,
> it is more common practice to have many classes in a Python module/file.
> What is the motivation behind it, would it b
lines = open('blah').readlines()
for i in range(0, len(lines)-1) :
print lines[i]
[EMAIL PROTECTED] wrote:
> hi,
> how can i skip printing the last line using loops (for /while)
>
> eg
>
> for line in open("file):
> print line.
>
> I want to skip printing last line of the file.thanks
--
Usually, when I make some coding mistake (index out of range - in this
case) I just care to fix the mistake and I usually don't mind to
inspect by how much the index was overflowed. It really seems like a
feature that should be embedded in some Python debugger than a feature
in the interpreter itse
Hello!
I'm relatively new to python but I already noticed that many lines of
python code can be simplified to a oneliner by some clever coder. As
the topics says, I'm trying to split lines like this :
'foo bar- blah/hm.lala' -> [foo, bar, blah, hm, lala]
'foobbbar.. xyz' -> [foo, bbbar, xyz]
`range' is especially useful for iterating over long sequences ;-)
for i in range(0,100) :
OverflowError: range() result has too many items
Sybren Stuvel wrote:
> [EMAIL PROTECTED] enlightened us with:
> > I thought the xrange was preferred? for x in xrange(length):
>
> True. I
Ray wrote:
> Since I haven't used Python at work, I am using Python 2.5 right now.
> However I wonder, how fast are you guys moving from version to version
> at work? As an illustration my ex-company just moved to Java 5, which
> was released around... what, 2-3 years ago? (While I am running Java
10 matches
Mail list logo