'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no']
>
>
> Ouch. Seems like I spotted the subtle cornercase error and missed the big
> one.
>
No, you just realised subconsciously that we
le at once (as you only need one byte at a time).
>
Indeed, but reading one byte at a time is about the slowest way to
process a file, in Python or any other language, because it fails to
amortize the overhead cost of function calls over many characters.
Buffering wasn't invented because
>>you decide to write something. There are a lot of features available
>>and, although daunting, I think the reference is the best resource
>>for discovering them.
>>
>>This group has also been indispensable to me.
>
>
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
being unreadable by another.
Secondly, it's usual to have the subclass explicitly call the superclass
to initialize that portion of the instance. So it would be more
typically Pythonic to write
class Child(Parent):
def __init__(self, c):
Parent.__init__(self, a, b)
self.C = c
This allows you to pass the a and b values into the creator call in the
following way:
obj = Child(2, 3, 1)
rather than explicitly setting attributes of the Child instance in line.
If your inheritance patterns are complex you may find it useful to
investigate the super() function.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
ram? Would this be a security problem?
It would indeed be a security problem, and there are enough of those
already without adding more.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
you'd do in wxPython like:
wx.EVT_BUTTON(parent, but1, but2.onClick)
but similar considerations apply to Tkinter, and you appear to have the
wit to be able to extend the argument to that toolkit.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC
inter and in turn calls your
> callback with the proper arguments.
>
I don't see why this is preferable to having the callback as a bound
method of the button instances. What's the advantage here? It looks
opaque and clunky to me ...
regards
Steve
--
Steve Holden +
sking for a write
> Asking for a write
> Asking for a write
>
> ...
> ...
>
>
Normally if a socket channel asks for a write and you have no data you
should respond by removing it from the list of write-enabled channels
for the asyncore loop until you *do* have some da
Paul Watson wrote:
> Steve Holden wrote:
>
>>>Since everyone needs this, how about building it in such that files
>>>which are closed by the runtime, and not user code, are reported or
>>>queryable? Perhaps a command line switch to either invoke or su
John W wrote:
> On 10/31/05, Steve Holden <[EMAIL PROTECTED]> wrote:
>
>>John W wrote:
>>
>>>Hello,
>>>
>>>I have a gui application where I am trying to use the asyncore module to
>>>gather data from other computers. I am able to con
Though it does have problems with stored procedures.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
ftware. You'd probably have to post
a bit more code before we could say why you are seeing what you are seeing.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
Jarek Zgoda wrote:
> Steve Holden napisał(a):
>
>
>>>>Does anyone know a good python mudule that works with MS SQL server?
>>>
>>>Google will yield something, but I prefer adodbapi over specialized
>>>modules. Works good with SQLServer using SSPI a
Jarek Zgoda wrote:
> Steve Holden napisał(a):
>
>
>>>>>>Does anyone know a good python mudule that works with MS SQL server?
>>>>>
>>>>>Google will yield something, but I prefer adodbapi over specialized
>>>>>modules. Works
Alex wrote:
> Thanks to both Alex Martelli and Steve Holden.. We need __slots__ for
> other reasons, too long to explain, but basically to prevent assignment
> of extra attributes.
>
> I ended up changing child classes this way:
>
> def __getstate__(self):
&g
as Larry Wall
> in the computing industry, mostly likely things will not go well.
>
> [Disclaimer: all mention of real persons are opinion only.]
>
[... etc., etc.]
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
ython to the Linksys Network
Storage device, which as far as I know uses the same chip and a similar
Linux environment - or possibly even the WRT45G itself. Google isn't
being very cooperative, though, sorry.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden
ten lately?
>
Possibly real maintenance occasioned by a recent move to a new server,
in preparation for the new-look web site.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org
bel :-)
[Thinks: wonder if it's time to release a sneak preview].
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
(I ask because I often recommend
> SQLite, but would like to temper that advice if in some cases these
> setup problems would cause someone trouble.)
>
> -Peter
My experience on Cygwin was that I had to install sqlite before pySqlite
worked. Maybe that's what was meant.
re
ies? what's could be wrong?
> thanks for any help rendered.
>
You should try adding "/path/to/sybase" to sys.path as well as/rather
than putting it in an environment variable. sys.path is what the
interpreter uses to find importable modules.
regards
Steve
--
ecommend that you direct the members to the tutor list rather
than trying to shore up an ineffective initiative.
Good luck either way.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www
>
You'll definitely need something to call the database API functions, I
suspect.
You could do a *private* install of the module though, surely, on your
web host?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
much about how the spammers
operate and how the web really works. Generally speaking any attempt to
"fight back" by generating more traffic and more search engine entries
will only make things worse. They certainly *won't* go away if you don't
ignore them, and they *probably* wo
re you can you can get lot's of
> suggestions for a suitable replacement.
>
I have a _mysql.c as a part of my distrbution of MySQLdb. Don't you?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Bartkus wrote:
> "Steve Holden" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>Thomas Bartkus wrote:
>>
>>>Well, I'm looking at the source for the ever popular MySQLdb library. It
>>>appears to be nothing but st
ths is a long time to wait, so
maybe you should have asked about this rather sooner. Volunteers don't
always behave as perfect bureaucrats :-)
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
a solution?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
junior member. Such a
>
>
> I like the general idea but not your formula. If the most junior team
> member was 1 month out of school, would it really be OK for the
> supervisor to be somebody who graduated 3 months ago?-)
>
It worked for Microsoft ...
regards
Steve
--
S
es you.
>
>
> No matter wat the OO model is, I don't think the following code
> exhibits sane behaviour:
>
> class A:
> a = 1
>
> b = A()
> b.a += 2
> print b.a
> print A.a
>
> Which results in
>
> 3
> 1
>
I don't suppose you&
Paul Rubin wrote:
> Steve Holden <[EMAIL PROTECTED]> writes:
>
>>>class A:
>>> a = 1
>>>b = A()
>>>b.a += 2
>>>print b.a
>>>print A.a
>>>Which results in
>>>3
>>>1
>>>
>>
>>I don
Robert Kern wrote:
> Steve Holden wrote:
>
>>Sorry about this almost off-topic post, but I am guessing there must be
>>other readers of this group who use Thunderbird (in my case 1.0.2) to
>>access it as gmane.comp.general.python.
>>
>>I'm currently sho
mmunity is much more welcoming than
that of most programming languages, which is important if you are
looking for support as your familiarity with the language grows.
Good luck with your Python advocacy.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
to the fully portable
import os
print os.path.basename(filepath)
that Robert Dowell suggested in immediate response to your post?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
hread qualify their opinions with "IANAL", but on second
thoughts I suppose that's fairly obvious by the fatuaous and inaccurate
nature of many of the observations.
Man, I'm beginning to really dislike Xah Lee.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494
ng past experience that our perceptions of Python's
execution model differ quite radically, and that I seem to find it quite
satisfactory overall, whereas you are forever banging on about what
"should" be true of Python and what Python "should" do. Which, a
chies) unless the name is first found in the
instance's namespace.
That's just the way Python was designed. Like it or loathe it, it's too
late to change now. . Some languages only use such a technique
for resolving the names associated with methods, but this isn't
comp.
as unwise coding, doesn't imply
> it is sane behaviour of python. Variable shadowing happens. I don't
> consider it sane behaviour if the same reference in a line gets
> resolved in different name spaces
>
Well I'm sure Guido will be happy to know you think his design is
saying that Java
> is more or less like COBOL. (OO COBOL?)
>
Quite. People have said exactly that, you know ;-)
http://www.artima.com/weblogs/viewpost.jsp?thread=42242
[...]
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
te them).
Never used PygreSQL, so can;t help there (though you might try a similar
trick and Googal for "PygreSQL Windows installer", say).
If you look at
http://www.holdenweb.com/Python/
you'll find a link to Mike Fletcher's page describing how you can
install and use the free Mic
Antoon Pardon wrote:
> Op 2005-11-04, Steve Holden schreef <[EMAIL PROTECTED]>:
[...]
>>I suppose ultimately I'm just more pragmatic than you.
>
>
> It has nothing to do with being more pragmatic. Being pragmatic
> is about how you handle things with real life
ght version (or didn't set some variables),
> since the error remains. Could you please help me (it will need some
> patience with a computer newbie)?
>
See
http://www.vrplumber.com/programming/mstoolkit
and say thanks to Mike Farmer.
regards
Steve
--
Steve Holden +44
; variable gets updated instead of an instance variable getting created.
> If you don't find the inconsistency to be weird, then ducky for you.
Ho, hum.
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
\')[-1]
>
> works well too. Zope is very finicky about running specific commands,
> I'm sure this is due to security issues of running os commands through
> a website/webserver.
>
That's a good enough reason. You are excused. :-)
regards
Steve
--
S
Antoon Pardon wrote:
> Op 2005-11-04, Steve Holden schreef <[EMAIL PROTECTED]>:
>
>>Antoon Pardon wrote:
>>
>>>Op 2005-11-04, Steve Holden schreef <[EMAIL PROTECTED]>:
>>
>>[...]
>>
>>>>I suppose ultimately I'm jus
separate CGI
> scripts?
>
Another alternative might be to serve a script that sent the browser
back 2 pages in its history, as long as server state hasn't changed in
the meantime.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
ongue and I am still trying to figure out how to
> solve this problem), how can I let MainClass knowing about the Custom
> methods without rewriting all the Custom functions inside MainClass and then
> pass the parameters to Custom? Is there a way to "propagate" the methods to
&g
x27;m reacting pretty badly to the construction you're
> describing. I haven't gotten around to looking at the asyncore code
> but will try to do so.
I wouldn't bother. From memory it's just using a class variable as an
initialiser.
regards
Steve
--
Steve Holden
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
>
>>What should I do to be able to compile C-extensions (with python 2.4,
>>winXP)? I get an error message, approximately "The .NET Framework SDK
>>needs to be installed"; I tried to get something from the Micros
rom
users' needs. But of course we pragmatists know that practicality beats
purity :-)
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
package tools suck quite badly.
>
> Debian and SUSE are both pretty good choices.
I used yum on Fedora Core 2, and it downloaded and installed
dependencies fine.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
P
37,
> in execute
> self.errorhandler(self, exc, value)
>
> File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line
> 33, in defaulterrorhandler
> raise errorclass, errorvalue
>
> OperationalError: (1054, "Unknown column 'artist' in 'field list'")
>
> Thanks for the help
>
It's a while since I used mod_python, so this is a guess: The publisher
module finds function arguments in the POST input stream. Since your
form field is called "z_rating", publisher fails to find a "rating"
argument to pass to the function.
The second error message seems to imply that the database InventoryList
table doesn't have a column called "article".
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
[...]
>
> The second error message seems to imply that the database InventoryList
> table doesn't have a column called "article".
>
> regards
> Steve
^article^artist^
--
Steve Holden +44 150 684 725
. Needing to pull over and
> change a few jumpers on the PC board of the radio to get it on the right
> channel.
>
> PyGTK - no experience there
>
> Pythoncard - a 50cc motorbike with training wheels
>
Less of the "old", if you don't mind ...
regards
Steve
-
GNU gmp-static library, but then of course in both cases I was
missing the gmp library to link it against.
So I'm afraid you might need someone with access to VC to test this on
Windows for you, sorry.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden We
r it changed, but it is not that I *want* it to
> change. I'll happily continue with python if it doesn't change.
>
That's sort of a pity. At this stage I'd recommend Ruby just to be rid
of the incessant twaddle you come up with to defend your throwaway ideas.
> Maybe
va client i have the same:
>
> % java Loader server.py server.py server.py
> init 29
> server.py reading 631 1
> server.py reading 631 40
> server.py reading 631 41
>
> why?
>
Seems to me that should probably be a question for comp.lang.java.
regards
Steve
--
Steve Holden
Alex Martelli wrote:
> Steve Holden <[EMAIL PROTECTED]> wrote:
>...
>
>>I tried compiling it with the MS free toolkit but the C compile
>>complains about the absence of "gmp.h". Since I see such a header in my
>>Cygwin installation I presume it&
27;t see that you have a chance in
hell of extracting useful demographics. Which all leads me back to
"what's the point?" - just because you can?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
umber of different ways, and they are supposed to
indicate the technique they use by setting a module variable
"paramstyle" to one of five possible values.
Magnus' original code was written to use a different (but valid)
paramstyle, so I'm guessing that his sqlite module a
basic and i want to learn the right way
>
> thanks so much,
> dave
>
>
Sounds to me like you could usefully take a look at dabo and/or django.
Both can be used to produce multi-tier applications, but django is
web-based where dabo is GUI-based. Both seem to have the elements you
sa
x27;'
rows = []
for row in toprint:
print " "
for cell in row:
print "%s" % cell
print " "
print ""
Of course you should really be ensuring that the cell contents correctly
escape any special characters in the cell conte
> Does anyone know if it'll be coming back up, or if it's mirrored anywhere?
>
> Can anyone recommend any other good warehouses of Python goodies?
>
It appears to be up now ...
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC
posting".
The reason you can't run Tkinter applications under PythonWin is that
PythonWin does not use a separate process to run the modules you ask it
to execute.
Since PythonWin used MFC-style windowing, there is a conflict between
the event-handling loops of the two different wind
ou clearly aren't even good at spamming and have very few clues
about mailing lists.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
ter than this, or am I missing some joke?
>>> hex(33*33)
'0x441'
>>> hex(33*33)[2:]
'441'
>>> 33*33
1089
>>> "%x" % 1089
'441'
>>>
Of course, you have to watch out for operator precedence:
>
Paul Rubin wrote:
> Steve Holden <[EMAIL PROTECTED]> writes:
>
>>>Try hex(33**33).
>>
>>You're usually smarter than this, or am I missing some joke?
>>
>> >>> hex(33*33)
>>'0x441'
>
>
> You used o
Peter Hansen wrote:
> [EMAIL PROTECTED] wrote:
>
>>I have no idea why people are so facinating with python.
>
>
> Hey, I'm fascinating even without python!
>
And so modest, too :-)
regards
Steve
--
Steve Holden +44 150 684 7255 +
1
#Guessing Loop
while guess != the_number and tries < 5:
if (guess >the_number):
print "Lower..."
else:
print "Higher..."
guess = int(raw_input("Take another Guess:"))
tries +=1
if guess == the_number:
print "You guess correctly!!"
print "The number was:", the_number
print "You got it correct in", tries, "tries"
else:
print "Sorry you lose."
print "The Correct Number was ", the_number
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
>
Unfortunately this appears to mean that pysqlite2 isn't fully DB
API-conformant.
>>> import pysqlite2
>>> pysqlite2.paramstyle
Traceback (most recent call last):
File "", line 1, in ?
AttributeError: 'module' object has no attribute 'paramstyle'
>>>
Of course, given the module's flexibility it's difficult to know what
you *would* put in paramstyle. I take it mixing different paramstyles in
the same query will fail?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
do this.
>>>in fact, the free version of the visual studio 2005, which is free, have
>>>this ability.
>
>
> Just out of curiosity, how much is the free version of Visual Studio 2005?
>
>
I'm not positive, but i think they're currently giving i
7;RE GETTING BACK FROM THE SERVER ?
>
COULD YOU GUYS BE QUIET, PLEASE, I'M TRYING TO WORK HERE!
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
it more context, like:
"My boss tells me we have to be able to run admin commands from inside
the order processing suite. Can anyone tell me how to do this?".
If you *do* understand what you want to do then I'm afraid you still
need to explain yourself more clearly.
regards
Stev
he product.
Personally I've never bothered with obfuscation, and prefer to rely on
copyright when I deliver code to customers.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006
))
>
> [0, 1]
Maybe, but the code also implies an esoteric knowledge that the trught
value of the predicate is monotonically decreasing (in a Boolean sense).
This would not be true if (e.g.) p = lambda x: x % 2 == 0. So while
itertools.takewhile can save you unnecessary computations, such
gt;
>
> Thanks!
> Swaroop
> www.swaroopch.info
>
import sys
print sys.argv[0]
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> Steve Holden wrote:
>
>
>>>Is there a way to set the program name in Python, similar to $0 in
>>>Perl?
>>>
>>>>From `man perlvar`:
>>>
>>>$0 Contains the name of the program being executed. On some op
ocation window.
I think it's a bit ill-advised to use parens in a URL, and if you do
then they shoud really be represented as %xx escapes.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006
ween the database server and the client, particularly
if the result set is large.
>>> curs.execute("SELECT secID, secTitle, secPath FROM SECTION")
>>> curs.fetchone()
(1, 'Explore Holden Web', 'hd_explore')
>>>
So of course you can unpack the tuple as well:
>>> id, ttl, pth = curs.fetchone()
>>> print "Title:", ttl, "path:", pth, "id:", id
Title: Student Links path: hd_students id: 2
>>>
If the result sets are too large to comfortably hold in memory you can
fetch them N at a time with fetchmany(N), repeating until there's
nothing left to read. And so on, but I hope this gives you the idea.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
net/projects/mysql-python
If you have any trouble installing it, get back on this list and someone
will help.
You're going to have *such* fun!
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006
guess)/2.
>
> Comments please.
>
> Norman
>
Effectively you want to start with a minposs and maxposs, which are set
to 0 and 100 respectively. Your guess should bisect the range (as nearly
as it can given that you are dealing with integers, and you have to be
careful to get
paren and the x were perfectly
acceptable.
Copying the text and pasting it into Firefox's location widget brought
the page up without difficulty.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
t; should never get here
>
Which is Fredrik's way of telling you you need to *call* sys.exit and
not just reference it (works in Perl, which assumes you want to call it,
but in Python "explicit is better than implicit").
$ more test.py
import sys
print "should get here"
e are more pythonic ways to perform this task.
You might try:
for index in range(len(fruit)):
letter = fruit[-index-1]
print letter
as one example. I'm sure other readers will have their own ways to do
this, many of them more elegant.
regards
Steve
--
Steve Holden +44 150 6
john boy wrote:
[top-posting corrected]
>
> Steve Holden <[EMAIL PROTECTED]> wrote:john boy wrote:
>
>>using the following program:
>>
>>fruit = "banana"
>>index = 0
>>while index < len (fruit):
>>letter = fruit[index-1]
>>
n
$ grep -i keep-alive /lib/python2.4/urllib*.py
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
27;d be interested to see whether the material is any use to someone new
to networking.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
PORTABILITY comments all over the place and too much boilerplate. Now
> I go with a startup check on sys.hexversion, and exit with similar
> wording.
>
We could all take an example from Fredrik Lundh, who still regularly
releases products that run on everything back to Python 1.5.2.
Run the command
python -v
and if this doesn't explain what the problem is, post the output back on
the group.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
taking the time to make sure the subject line really
does describe the subject of your message - that way people with an
interest in your problem are much more likely to read it instead of
skipping over your posts.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494
methods, but basically you just need to close each cursor
you open once.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
bout base 2, 8, 10, 16.
>
> May be :
>
> int("E500.000,23")
>
> as we are using :
>
> 0x
>
> already for hex number
>
I really wouldn't want it to become possible to write Python code in one
locale that had to be edited before the numeric lite
t;>> dir(d)
['GetFileExt', 'GetFileName', 'GetFileTitle', 'GetPathName',
'GetPathNames', 'GetReadOnlyPref', 'SetOFNInitialDir', 'SetOFNTitle']
>>> d.Show()
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Steve Holden wrote:
[...]
>>I really wouldn't want it to become possible to write Python code in one
>>locale that had to be edited before the numeric literals were valid in
>>another locale. That way madness lies.
>
> That is the fact
rs werw regarded as equivalent.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
noticed the same thing in Unix-like operating systems when
running tail -f on a file being fed by an active process: the output
appears in chunks ending in partial lines because the feeding process's
output buffer has been filled and the operating system has passed it to
the tail process.
reg
each time is less efficient, am I right?
>
Not necessarily. Try this:
f = file("filename.txt")
for line in f:
if token in line: # or whatever you need to identify it
break
else:
sys.exit("File does not contain token")
lin
x2*(a6 + x2*(a8 + x2*a10
>
> (or least that's what I like to write). Now, if I were going to higher
> precision, I'd have more digits of course.
>
Right, this is clearly such a frequent use case it's worth changing the
compiler for.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
ter 5 seconds , other input 5
> after 5 more seconds , 15 is being proccessed
> Thanks.
It sounds like you will have to learn how to do two things in parallel,
which is normally done using threads. Unfortunately it also seems you
would like the input thread to be terminated when the timer thread finds
its time is up, and that's not particularly easy because there's no way
to stop a thread "from the outside" once it's started.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
string
> with an empty string thus
> """.replace('\n','')
>
Of course there's also the alternative of escaping the newlines out in
the literal. The replace result above is exactly
"""\
lots of text hundreds of characters long\
more text on another line but we really don't want any line breaks\
in our final string\
so we replace newlines in this multiline string\
with an empty string thus\
"""
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
201 - 300 of 4732 matches
Mail list logo