On Wed, 23 Sep 2009 00:25:52 +0100, Nobody wrote:
> On Mon, 21 Sep 2009 16:33:08 -0400, Jack Diederich wrote:
>
>>> AIUI, as a python string is imutable, a slice of a string is a new
>>> string which points (C char *) to the start of the slice data and with
>>> a length that is the length of the
On Tue, Sep 22, 2009 at 7:25 PM, Nobody wrote:
> On Mon, 21 Sep 2009 16:33:08 -0400, Jack Diederich wrote:
>
>>> AIUI, as a python string is imutable, a slice of a string is a
>>> new string which points (C char *) to the start of the slice data
>>> and with a length that is the length of the slic
On Mon, 21 Sep 2009 16:33:08 -0400, Jack Diederich wrote:
>> AIUI, as a python string is imutable, a slice of a string is a
>> new string which points (C char *) to the start of the slice data
>> and with a length that is the length of the slice, about 8 bytes
>> on 32 bit machine.
>
> Not in CPy
twistedmatrix.com> writes:
>
> To the OP, you can get view-like behavior with the "buffer" builtin.
And, on Python 3 (or even the 2.7 in development), you can use the "memoryview"
builtin for similar effect.
Regards
Antoine.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Sep 21, 2009 at 2:10 PM, Rob Williscroft wrote:
> wrote in news:mailman.216.1253565002.2807.python-l...@python.org in
> comp.lang.python:
>
>>>Niether of the CPython versions (2.5 and 3.0 (with modified code))
>>>exibited any memory increase between "allocated 1 meg + " and "end"
>>
>> Yo
wrote in news:mailman.216.1253565002.2807.python-l...@python.org in
comp.lang.python:
>>Niether of the CPython versions (2.5 and 3.0 (with modified code))
>>exibited any memory increase between "allocated 1 meg + " and "end"
>
> You bumped into a special case that CPython optimizes. s[:] is s.
On Mon, Sep 21, 2009 at 4:00 PM, Rob Williscroft wrote:
> AIUI, as a python string is imutable, a slice of a string is a
> new string which points (C char *) to the start of the slice data
> and with a length that is the length of the slice, about 8 bytes
> on 32 bit machine.
Not in CPython. Whi
On 08:00 pm, r...@freenet.co.uk wrote:
Zac Burns wrote in news:mailman.211.1253559803.2807.python-
l...@python.org
in comp.lang.python:
The mysocket.mysend method given at
http://docs.python.org/howto/sockets.html has an (unwitting?) O(N**2)
complexity for long msg due to the string slicing.
I
Zac Burns wrote in news:mailman.211.1253559803.2807.python-l...@python.org
in comp.lang.python:
> The mysocket.mysend method given at
> http://docs.python.org/howto/sockets.html has an (unwitting?) O(N**2)
> complexity for long msg due to the string slicing.
>
> I've been looking for a way to op
On Sep 21, 2:03 pm, Zac Burns wrote:
> The mysocket.mysend method given
> athttp://docs.python.org/howto/sockets.htmlhas an (unwitting?) O(N**2)
> complexity for long msg due to the string slicing.
>
> I've been looking for a way to optimize this, but aside from a pure
> python 'string slice view
The mysocket.mysend method given at
http://docs.python.org/howto/sockets.html has an (unwitting?) O(N**2)
complexity for long msg due to the string slicing.
I've been looking for a way to optimize this, but aside from a pure
python 'string slice view' that looks at the original string I can't
thin
On Jul 30, 10:16 pm, "Jan Kaliszewski" wrote:
> 30-07-2009 o 12:29:24 Francesco Bochicchio wrote:
>
> > On Jul 30, 5:52 am, NighterNet wrote:
> >> I am trying to figure out how to send text or byte in python 3.1. I am
> >> trying to send data to flash socket to get there. I am not sure how to
>
30-07-2009 o 12:29:24 Francesco Bochicchio wrote:
On Jul 30, 5:52 am, NighterNet wrote:
I am trying to figure out how to send text or byte in python 3.1. I am
trying to send data to flash socket to get there. I am not sure how to
work it.
buff= 'id=' , self.id , ':balive=False\n'
clientSock.
30-07-2009 o 05:52:06 NighterNet wrote:
I am trying to figure out how to send text or byte in python 3.1. I am
trying to send data to flash socket to get there. I am not sure how to
work it.
buff= 'id=' , self.id , ':balive=False\n'
clientSock.send(buff);
And what is the problem?
*j
--
Jan
On 30 Lug, 18:06, NighterNet wrote:
> On Jul 30, 6:56 am, "Mark Tolonen" wrote:
>
>
>
>
>
> > "NighterNet" wrote in message
>
> >news:55aba832-df6d-455f-bf34-04d37eb06...@i4g2000prm.googlegroups.com...
>
> > >I am trying to figure out how to send text or byte in python3.1. I am
> > > trying to s
On Jul 30, 6:56 am, "Mark Tolonen" wrote:
> "NighterNet" wrote in message
>
> news:55aba832-df6d-455f-bf34-04d37eb06...@i4g2000prm.googlegroups.com...
>
> >I am trying to figure out how to send text or byte in python3.1. I am
> > trying to send data to flashsocketto get there. I am not sure how t
"NighterNet" wrote in message
news:55aba832-df6d-455f-bf34-04d37eb06...@i4g2000prm.googlegroups.com...
I am trying to figure out how to send text or byte in python 3.1. I am
trying to send data to flash socket to get there. I am not sure how to
work it.
buff= 'id=' , self.id , ':balive=False\
On Jul 30, 5:52 am, NighterNet wrote:
> I am trying to figure out how to send text or byte in python 3.1. I am
> trying to send data to flash socket to get there. I am not sure how to
> work it.
>
> buff= 'id=' , self.id , ':balive=False\n'
> clientSock.send(buff);
Try putting a 'b' before the co
I am trying to figure out how to send text or byte in python 3.1. I am
trying to send data to flash socket to get there. I am not sure how to
work it.
buff= 'id=' , self.id , ':balive=False\n'
clientSock.send(buff);
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
James Mills escribió:
Bryan Olson wrote:
I thought a firewall would block an attempt to bind to any routeable
address, but not to localhost. So using INADDR_ANY would be rejected.
No.
My understanding is that firewalls block network traffic, not system
calls.
This
En Mon, 05 Jan 2009 22:59:46 -0200, James Mills
escribió:
On Tue, Jan 6, 2009 at 10:49 AM, Bryan Olson
wrote:
I thought a firewall would block an attempt to bind to any routeable
address, but not to localhost. So using INADDR_ANY would be rejected.
No.
My understanding is that firewalls b
On Wed, Dec 24, 2008 at 3:59 PM, greyw...@gmail.com wrote:
(snip)
> If I run testserver.py via the cmd prompt in Windows XP and then the
> testclient.py program, I get the following error:
>
> Traceback (most recent call last):
> File "C:\Python30\testclient.py", line 12, in
>s.send('Hello
On Tue, Jan 6, 2009 at 10:49 AM, Bryan Olson wrote:
>> I thought a firewall would block an attempt to bind to any routeable
>> address, but not to localhost. So using INADDR_ANY would be rejected.
No.
> My understanding is that firewalls block network traffic, not system calls.
This is correct.
Gabriel Genellina wrote:
Bryan Olson escribió:
Gabriel Genellina wrote:
greyw...@gmail.com escribió:
[...]
A simple server:
from socket import *
myHost = ''
Try with myHost = '127.0.0.1' instead - a firewall might be blocking
your server.
Just a nit: I'd say the reason to use '127.0.0.1
En Sat, 03 Jan 2009 21:44:34 -0200, Bryan Olson
escribió:
Gabriel Genellina wrote:
greyw...@gmail.com escribió:
[...]
A simple server:
from socket import *
myHost = ''
Try with myHost = '127.0.0.1' instead - a firewall might be blocking
your server.
Just a nit: I'd say the reason to
Gabriel Genellina wrote:
greyw...@gmail.com escribió:
[...]
A simple server:
from socket import *
myHost = ''
Try with myHost = '127.0.0.1' instead - a firewall might be blocking
your server.
Just a nit: I'd say the reason to use '127.0.0.1' instead of the empty
string is that a firewall
On Thu, Dec 25, 2008 at 10:08 PM, greyw...@gmail.com wrote:
> Hi again,
>
> I've done some more playing around with socket and socketserver and
> have discovered I can send strings or lists with socket.send() by
> converting to bytes. But lists with strings in them or dicts can't be
> converted b
Hi again,
I've done some more playing around with socket and socketserver and
have discovered I can send strings or lists with socket.send() by
converting to bytes. But lists with strings in them or dicts can't be
converted by bytes(). How can I send those?
One idea I initially tried was to set
Chris & Gabriel,
Thank you so much. My simple example now works. It was very
frustrating that even the simple example didn't work, so your help is
most appreciated.
b'hello world' was the key. As for the error, I do still get it with
3.0 final so I'll go ahead and report it.
John.
On Dec 24,
En Wed, 24 Dec 2008 03:59:42 -0200, greyw...@gmail.com
escribió:
New guy here. I'm trying to figure out sockets in order to one day do
a multiplayer game. Here's my problem: even the simplest examples
don't work on my computer:
A simple server:
from socket import *
myHost = ''
Try with
On Tue, Dec 23, 2008 at 9:59 PM, greyw...@gmail.com wrote:
> Hi everyone,
>
> New guy here. I'm trying to figure out sockets in order to one day do
> a multiplayer game. Here's my problem: even the simplest examples
> don't work on my computer:
>
> A simple server:
>
> from socket import *
> my
Hi everyone,
New guy here. I'm trying to figure out sockets in order to one day do
a multiplayer game. Here's my problem: even the simplest examples
don't work on my computer:
A simple server:
from socket import *
myHost = ''
myPort = 21500
s = socket(AF_INET, SOCK_STREAM)# create a TCP
Dennis,
Thanks. That certainly looks like it could work. I understand
about the interactive shell and my app going back and forth with the
reads/writes. When my program runs it won't be used in an interactive
python shell, but that is the only way I know of to really test it.
--
http://mail
I even tried inserting a "\r" or "\r\n" or "\n" to stdout, also tried
the same using msvcrt.putch() ...but no luck. I still have to hit
enter to get the prompt , where I can then type a command and hit
enter.
For example, I get this displayed:
[example]
Microsoft Windows XP [Version 5.1.2600]
(C)
I have a basic client/server socket situation setupwhere the server
accepts a connection and then waits for commands.
On the client side, I create a socket, connect to the server...then I
pass the socket to a class which just reads from the socket (in a
thread).
class Reader(Thread):
def
35 matches
Mail list logo