467,077 Members | 974 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,077 developers. It's quick & easy.

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


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
Jul 18 '05 #1
  • viewed: 16883
Share:
3 Replies
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.

Jul 18 '05 #2
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
Jul 18 '05 #3
David Joyner wrote:
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
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Greg Chu | last post: by
2 posts views Thread by Iain Adams | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.