TypeError: send() argument 1 must be string or read-only buffer,not int

M

Manish Gupta (BBS)

Hello

invoking something like following -

sock.send(100)

generates the following error -

TypeError: send() argument 1 must be string or read-only buffer,
not int


how can I work around this? I wish to write
msg-length on a stream socket.

thanks in advance.
manish
 
W

wittempj

if you want to send the value '1000' over a socket connection in a
socket object do something like sock.send(str(1000)) if socket is a
socket.socket object.
 
D

David Joyner

Hi:
I'm trying to compile python 2.4 with tkinter.
(I'm trying to write a gui interface which
calls a program called GAP - I'm hoping to use
subprocess, a python 2.4 module, since I was getting
deadlocks using popen).

The instructions at the python web site said basically
to edit the /Modules/Setup file and recompile.
The edits consist of determining with location of various
Tcl/Tk libraries, header files, etc. I was wondering if
anyone could help out with how to determine these.
I have a suse 9.1 box and a new debian laptop, both of which
I would like to configure with python 2.4 and tkinter.
- David Joyner
 
R

Raymond L. Buvel

David said:
Hi:
I'm trying to compile python 2.4 with tkinter.
(I'm trying to write a gui interface which
calls a program called GAP - I'm hoping to use
subprocess, a python 2.4 module, since I was getting
deadlocks using popen).

The instructions at the python web site said basically
to edit the /Modules/Setup file and recompile.
The edits consist of determining with location of various
Tcl/Tk libraries, header files, etc. I was wondering if
anyone could help out with how to determine these.
I have a suse 9.1 box and a new debian laptop, both of which
I would like to configure with python 2.4 and tkinter.
- David Joyner
The problem is most likely missing header files for the Tcl/Tk
libraries. Most Linux distributions (including SuSE) package the
required files separately from the libraries. In Yast, look for
packages with the same name and a -dev suffix. Once you have installed
these, tkinter will be automatically built without any need to edit
/Modules/Setup.

If you are running Debian testing or unstable, you just need to install
the python2.4 and python2.4-tk modules. If you need to compile
extension modules, you will also need python2.4-dev.

Hope this helps.

Ray Buvel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top