not
only alphanumeric; will also match spaces etc. that might appear in
filenames).
Note 2: Instead of translating to regular expressions, it would probably
be easier to use the fnmatch and/or glob module. They use Unix
shell-style wildcards, which I believe are very similar to Windows style
wildcards, if not identical.
--
"Codito ergo sum"
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
e
>>> This line isn't really quoted three times.
Seems to work :) Now let's hope lots of people will use an approach like
that for code sent to the various Python newsgroups and mailing lists.
--
"Codito ergo sum"
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
This, of course, means that DJIJSTRA (there, one of the J's is right)
SUX!!!
And so do DONALD NUTH, BRIAN ERNIGHAN, ROB PIE, EN THOMPSON, JOHN
CARMAC, FRED BROOS, NIKAUS WIRTH, ONRAD ZUSE AND STEVE WOZNIA!!
;)
--
"Codito ergo sum"
Roel Sc
etter" replacement for function composition.
Whether this is better or not, I don't know.
--
"Codito ergo sum"
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Replying to myself, with a simpler version:
Roel Schroeven wrote:
Alan G Isaac wrote:
def compose(list_of_functions): return reduce(lambda f, g: lambda x:
f(g(x)), list_of_functions)
def compose(list_of_functions):
def compose2(f, g):
def func(x):
return f(g(x
this time. It might have had
something to do with the test setup the first time.
--
"Codito ergo sum"
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Rocco Moretti wrote:
So to summarize:
Commas define tuples, except when they don't, and parentheses are only
required when they are necessary.
I hope that clears up any confusion.
You have my vote for QOTW.
--
"Codito ergo sum"
Roel Schroeven
--
http://mail.python.org/mailman/
and last quotes
in the regex, by the way, at least if you use ' instead of " to delimite it:
>>> print re.search(r'"([^"\\]|(\\.))*"',
... r'"I said \"Hello!\""').group(0)
"I said \"Hello!\""
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
cumstances, as documented on http://sql-info.de/mysql/gotchas.html.
I'm not saying these issues should make one avoid MySQL at all costs,
but I think one should at least be aware of them.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. --
o see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
elect what you want to copy and press Enter or choose Edit->Copy in the
system menu.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ly eCQQmSxK\n. I guess the data has
been modified in order to get that potential confusion out of the way.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Victor Hooi schreef:
with open(self.full_path, 'r') as input, open(self.output_csv,
'ab') as output:
I think I would write that as
with open(self.full_path, 'r') as input:
with open(self.output_csv, 'ab') as output:
That introduces an extra indentation level, but that
msus...@gmail.com schreef:
I had a bug in a Python script recently. The code in question was something
along the lines of:
if a == 1:
x = y
else:
x = z
y = z + y
z = z + 1
While editing this file I accidentally pushed TAB on the line with 'y = z + y'.
My changes were elsewhere and I d
science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov
Roel Schroeven
--
https://mail.python.org/mailman/listinfo/python-list
msus...@gmail.com schreef:
On Thursday, February 6, 2014 12:29:36 PM UTC-8, Roel Schroeven wrote:
My suggestion: configure your editor to insert the appropriate amount of
spaces instead of a tab when you press the tab key.
You misunderstood the problem, but managed to start a Tab war
Use uuid.uuid1()?
--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov
Roel Schroeven
--
https://mail.python.org/mailman/listinfo/python-list
society gathers wisdom.
-- Isaac Asimov
Roel Schroeven
--
https://mail.python.org/mailman/listinfo/python-list
t; print(itm)
Item(id=1, productId=None, quantity=1, pageCount=1, files='asdf',
option={'ads': 55, 'asdf': 3}, metadata=None)
See
https://docs.python.org/3/library/collections.html?highlight=namedtuple#collections.namedtuple
--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov
Roel Schroeven
--
https://mail.python.org/mailman/listinfo/python-list
ss I could have used 32-bit Python instead of 64-bit Python to
limit available memory.
--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov
Roel Schroeven
--
https://mail.python.org/mailman/listinfo/python-list
.
-- Isaac Asimov
Roel Schroeven
--
https://mail.python.org/mailman/listinfo/python-list
-
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ften use cygwin's bash (with rxvt). I haven't yet tried ipython.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
to Windows.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ll
kinds of misplaced eye candy.
In fact I like the old one better: short, clear and to the point.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Tim Parkin schreef:
> Roel Schroeven wrote:
>> Tim N. van der Leeuw schreef:
>>
>>> Shalabh,
>>>
>>> You've managed very well to express the same things I feel about the
>>> new Python website.
>>
>> FWIW, I don't like
neprint on a
contract.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
the
large-company-look with hard-to-find-information.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
s the user manual that came with the
modem had an overview of the available commands for that modem.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
JW schreef:
> On Wed, 18 Jan 2006 20:51:03 +0000, Roel Schroeven wrote:
>
>> I, Jim Wilson, schreef:
>>> I'm assured that in print ads the only "content" anyone reads is in
>>> picture captions, and you damn well better make sure your message is
>&g
Roel Schroeven schreef:
> JW schreef:
>> I
>> immediately
>> noticed something when visiting Joel using Firefox. **Scrollbars**. The
>> page wouldn't even fit on the screen! I started to read it, but my face
>> went numb before I needed to use the scrol
yself using len() from time to time (even though I can't think of a use
case right now).
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ython idioms instead of
C or C++ idioms, but apparently sometimes my years of experience in
these languages sometimes show trough in Python. Luckily my BASIC habits
have died out long ago.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ies.
You seem to imply that your rule #1 would have prevented the problem
you're experiencing. After this whole discussion, frankly I still don't
understand how it would have done that.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
"%0.3f" % 1.2345
1.234
>>> print "%0.4f" % 1.2345
1.2345
If you use 4 decimals after the decimal sign, you get the same result as
with a plain print statement (at least in this case). That means that
print is not treating it as 1.2345 first and then rounding it off to
ch, set_bit is the only function that has access
to the bits so you can't easily create other operations.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ou sure that you don't have 2 copies of that file around, and that
your program is using the wrong one? Or is it possible that some module
imported with 'from blabla import *' clashes with the builtin open()?
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
he IDLE it didn't work unless the
> data was in a text file. Weird.
Weird indeed: I ran the script under IDLE too...
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
..
It's the same here in Belgium. Except that our Van is with a capital V
in most cases; if it's a lower v it either indicates nobility or a Dutch
name.
I don't see it as a problem. I prefer having Van Straeten and Van
Stralen next to each other than having them mixed up with names without
Van like this:
Straeten, Van
Straetmans
Stralen, Van
For me the string as a whole is the name; the parts separated don't have
much meaning.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Theerasak Photha schreef:
> On 10/10/06, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>>>>>>> Roel Schroeven <[EMAIL PROTECTED]> (RS) wrote:
>>> RS> It's the same here in Belgium. Except that our Van is with a capital V
>>> in
>>&
nbook.red-bean.com/nightly/en/svn.advanced.props.html#svn.advanced.props.special.ignore
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
at; anyone can ask
Gmane to add a mailing list to their gateway via the form at
http://gmane.org/subscribe.php
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
y because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
cause I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ecause I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
that much until I
learned by experience that I unconsciously try, unsuccessfully of
course, to do it in other editors.
BTW, you can type :x instead of :wq. 33% shorter!
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels schreef:
> Roel Schroeven wrote:
>> Isn't Python for other platforms built with GCC? Seems to me that if it
>> GCC is good enough for other platforms, it's good enough for Windows.
>
> You clearly misunderstand the interface to the Windows OS &a
able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
joe
Inside joe
If you call it as a function, first the function is executed (printing
"Inside joe"), but then Python tries to call the return value of the
function, which is None.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
27;10 m').
But I still can't answer the question. I don't even know if there's a
way for python to read shape files. Maybe there's something to be found
at http://www.freegis.org/ or http://www.opensourcegis.org/.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
:
import string
data = 'asdfbasdf'
translatetable = string.maketrans('asx', 'fgy')
data = data.translate(translatetable)
print data
This results in:
fgdfbfgdf
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
y is this? If I change
> a.txt to:
>
> # comments
> [('recId', 3), ('parse', {'pos': u'np', 'gen': u'm'})]
>
> it works fine. Why doesn't it work with multiple lines? it's driving me
> crazy!
It looks like it&
manstey schreef:
> Roel Schroeven wrote:
>> manstey schreef:
>>> I often have code like this:
>>>
>>> data='asdfbasdf'
>>> find = (('a','f')('s','g'),('x','y'))
>>> for i i
ents the reference counting already used in
Python, you can disable the collector if you are sure your program does
not create reference cycles."
I don't know if that's only true for CPython or also for the other
implementations.
--
If I have been able to see further, it was onl
le to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
!H4BH20BHI", strMessage)
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
You fix the bug and all is well again.
Very strange, but it has happened to me on a few occasions. There's
probably a perfectly logical explanation for what happened, but I never
found it.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Roel Schroeven schreef:
> Have you never experienced the following:
>
> A customer reports a bug. Upon investaging you find the source of the
> problem, but from studying the code you don't understand anymore how it
> has ever been able to function correctly. From th
o say anything about it.
> Both Python2.4 and 2.5 are behaving the same. I will also try to create
> the file with Vi editor.
If by Vi you mean Vim, that's my favorite editor for editing Python
code, with Idle second.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
sure the indentation is really made up of tabs.
BTW I'm a proponent of spaces instead of tabs, but indentation by tabs
only (i.e. not a mixture of tabs and spaces) is an acceptable solution
too and it should work.
--
If I have been able to see further, it was only because I stood
on the s
he subscribers list:
Admin address: ___ Password: ___ [Visit Subscriber List[
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
n able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
uot;:" and afterwards "/".
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
he objects like other file-like objects.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
eal port and a fake one.
> (what about usb/parallel adapters?)
Never tried it, but I guess it will work too.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
irectly import MyClass into the global namespace like this:
from MyModule import MyClass
x = MyClass()
x.f()
But that's not recommended since it clutters the global namespace and
makes it more difficult to see which name comes from which module.
--
If I have been able to see
rintf("timer1: %lf\n", timer1());
printf("timer2: %lf\n", timer2());
return 0;
}
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
f I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
-systems are able to handle that
easily, but Windows doesn't.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
that doesn't help either.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Roel Schroeven wrote:
Dan Bishop wrote:
Dan Bishop wrote:
Correction: Now I'm stuck on Level 11. I think I'm supposed to do
something with the pixels in the image, but what?
Me too.
There's a new image on the website now (still the same name though); I
solved the riddle now
:, then one or
more digits, then }'.
re.split('{.*}', textdata) would be a more direct translation of your
wildcard, but that doesn't work: .* matches as much as possible, so in
your example it would match '{1:1} Random text here. {1:2}' instead of
just '{1:1}
> more after I sleep on it.)
>
> -John
Possible spoiler, so ROT13'ed:
Qvq lbh frr naq ernq gur ernqzr.gkg va gur mvc svyr?
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Dan Bishop wrote:
> Roel Schroeven wrote:
>
>>Dan Bishop wrote:
>>
>>
>>>Dan Bishop wrote:
>>>
>>>Correction: Now I'm stuck on Level 11. I think I'm supposed to do
>>>something with the pixels in the image, but what?
&
-
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Roel Schroeven wrote:
> John Hazen wrote:
>
>
>>Hmmm. The title of the html page is "dealing evil". If you were
>>playing war instead of solitaire, how would you change how you deal the
>>cards?
>
>
> Hm, I'm not familiar with playing war.
there. I thought it was going to be too simplistic, but
it worked. And fortunately my first guess was the right one.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
Dan Christensen wrote:
> Roel Schroeven <[EMAIL PROTECTED]> writes:
>
>
>>Chris McAloney wrote:
>>
>>
>>>Hi all,
>>>
>>>Okay, so I've been working on level seven for a LONG time now. I've
>>>decoded the first messag
given so far is to rmember the solution for
> level 12.
You don't really need the remember the solution; it's more the process
that led you to find the solution.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
a
warning and an incorrect image, another one showed a cropped image of
what I suppose should have been the real image.
I tried some variations to get an uncorrupted object, but didn't succeed.
However, I didn't need it for solving level 13.
When all else fails, try Google.
Martijn Pieters wrote:
> Roel Schroeven wrote:
>
>>You don't really need the remember the solution; it's more the process
>>that led you to find the solution.
>
>
> Yup, I do remember the process, and it hasn't been any help so far.. no
> adj
e to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ble to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ngs I
used PHP for at the time really were nothing more than scripts, despite
me thinking about writing them in C or C++.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
> prefer)?
Ah, that's not polymorphism; it's method overloading. And AFAIK it is
not possible in Python.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
ulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
since repeated multiplication is
the same as taking the power with the number of years as the exponent:
def inflation():
start = ... # same as before
inflation = ... # same as before
print start * (1+inflation)**30
--
If I have been able to see further, it was only because I sto
t is better to open it in binary mode: file(filename, 'rb')
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
olive schreef:
> Lol!
>
> What is a "sharp hair boss" ?
Pointy-haired boss, see http://en.wikipedia.org/wiki/Pointy_Haired_Boss
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail
se you want to show MTRRHH without waiting for the user to close
it, use DialogRRHH.Show() instead of .ShowModal(). I think MTRRHH can be
either a wxDialog or a wxForm in that case.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
) from add_record(), and do it once after all
records are added.
The reason that the process is slow with a commit after every INSERT is
that sqlite syncs the inserted data to disk before it continues.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants.
ning curve plots the learning effort vs. the
progress made. A steep learning curve means you need to learn a lot in
order to make a little progress.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
Roel Schroeven
--
http://mail.python.org/mailman/listinfo/python-list
lefield of Europe for nothing...
I'm not sure if this adds anything of interest (well actually I'm pretty
sure it doesn't), but our king Albert I was a fanatic mountain climber,
until he died from a fall in 1934.
--
If I have been able to see further, it was only because I st
hg schreef:
> Roel Schroeven wrote:
>
>> Hendrik van Rooyen schreef:
>>> "Steve Holden" <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>> Perhaps in Belgium they prefer climbing mountains over walking up and
>>>> down gen
201 - 300 of 456 matches
Mail list logo