> I have what I think is a string from socket.recvfrom(...).
> I want to turn it into numbers so I tried:
> data, address = recvfrom (...stuff...)
> s = ""
This reads a sequence of bytes from the socket. What those bytes
represents only you can know. If they are a sequence of ascii codes
then th
> The only list search function I know is List.Index(X), which is
> pretty
> inefficient I reckon, especially hen the lists are likely to contain
> 100's
> or 100's of members.
Have you tried it? How long is it taking?
I'd be very surprised if it there was a serious problem indexing
a list of ev
[EMAIL PROTECTED] wrote:
> Hi, Can someone tell me if there is a bulit in Binary search function for
> python lists ?
>
> I am currently building lists and sorting them with a comparison function.
> The only list search function I know is List.Index(X), which is pretty
> inefficient I reckon, espe
Hi,
I'm slighty confused with python's string
formatting operators.
Why is it that this prints as
a string:
channel, info = server.accept()
print "Connection from", info
And this doesn't?
channel, info = server.accept()
print "Connection from
%s" % info
Also, anyone knows how do
Jorge Louis De Castro a écrit :
> Hi,
>
> I'm slighty confused with python's string formatting operators.
>
> Why is it that this prints as a string:
>
> channel, info = server.accept()
> print "Connection from", info
>
> And this doesn't?
>
> channel, info = server.accept()
> print "Connecti
Pierre Barbier de Reuille wrote:
> Jorge Louis De Castro a écrit :
>
>>Hi,
>>
>>I'm slighty confused with python's string formatting operators.
>>
>>Why is it that this prints as a string:
>>
>>channel, info = server.accept()
>>print "Connection from", info
>>
>>And this doesn't?
>>
>>channel, inf
I have the first printing. The snippets are on pp. 159 and 160, and are
there to illustrate the loop "else" clause.
found = 0
while x and not found:
if match(x[0]): # value at front?
print 'Ni'
found = 1
else:
x = x[1:]# slice off
Kent Johnson a écrit :
> Pierre Barbier de Reuille wrote:
>
[...]
>
>
>>Well, when using the "%" operator on string always put a tuple or a
>>dictionnary on the RHS :
>>
>>print "Connection from %s" % (info,)
>
>
> No, you can put a single item on the right without putting it in a tuple:
> >>
os.access is better/fast that os.path.isfile for checking if exist a file?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> os.access is better/fast that os.path.isfile for checking if exist a file?
I don't think we should judge this primarily as a matter of speed, but a
matter of functionality. If we do something like:
os.access(pathname, os.F_OK)
this will tell us if a path name exists. But note that this
Dick Moores wrote:
> I have the first printing. The snippets are on pp. 159 and 160, and are
> there to illustrate the loop "else" clause.
> while x: # exit when x empty
> if match(x[0]):
> print 'Ni'
> break# exit, go around else
Dick Moores wrote:
> I have the first printing. The snippets are on pp. 159 and 160, and are
> there to illustrate the loop "else" clause.
>
> found = 0
> while x and not found:
> if match(x[0]): # value at front?
> print 'Ni'
> found = 1
> else:
>
Ah, thanks for the explanation. I've never been tripped up by that...
Kent
Pierre Barbier de Reuille wrote:
> Kent Johnson a écrit :
>
>>Pierre Barbier de Reuille wrote:
>>
>
> [...]
>
>>
>>>Well, when using the "%" operator on string always put a tuple or a
>>>dictionnary on the RHS :
>>>
>>>
I want to use embedded python in an html page.
However, I dont want to force the user to have python installed for the
page to work.
Is there any way to make the embedded python code be executed by the server?
I'm hoping ti use python as an alternative to vbscript and jaava
thanks
tony
___
On 8/21/05, Tony Cappellini <[EMAIL PROTECTED]> wrote:
>
>
> I want to use embedded python in an html page.
> However, I dont want to force the user to have python installed for the
> page to work.
> Is there any way to make the embedded python code be executed by the server?
>
> I'm hoping ti u
15 matches
Mail list logo