Curios issues with Editors

R

rodmc

I recently wrote a program in IDLE and it runs perfectly. However when
the same application is executed within SPE I receive errors saying
that certain socket items are not callable, in particular AF_INET.

I am new to Python, is there a reason why somethings will run in IDLE
and not SPE?

I could post the source code but it is changing quite a bit, so this is
more of a general question than one about a specific bug or issue.


Best,

Rod
 
S

Steve Holden

rodmc said:
I recently wrote a program in IDLE and it runs perfectly. However when
the same application is executed within SPE I receive errors saying
that certain socket items are not callable, in particular AF_INET.

I am new to Python, is there a reason why somethings will run in IDLE
and not SPE?

I could post the source code but it is changing quite a bit, so this is
more of a general question than one about a specific bug or issue.
I think you are fooling yourself about this error.

You would appear to have some code that reads something like

socket.AF_INET( ... )

which is clearly wrong, since AF_INET is an integer intended to indicate
the address family required at the creation of a socket.

regards
Steve
 
R

rodmc

As I said I am most likely to have made an error, being a newbie and
all that. Here is the offending function. I said i would not post
source code but there you go...

As I said I plan to change this function, so it will no doubt be out of
date quite soon.

def senddata(msg):
host = "localhost"
port = 21568
buf = 1024
addr = (host,port)

UDPSock = socket(AF_INET,SOCK_DGRAM)
UDPSock.sendto(msg,addr)
UDPSock.close()

cheers,

rod
 
S

SPE - Stani's Python Editor

How do you run your code in SPE? I advise you to run it with
Tools>Run/Stop (Ctrl+R) There would be no reason why it wouldn't work.

Stani
 

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

Forum statistics

Threads
474,283
Messages
2,571,409
Members
48,102
Latest member
charleswillson

Latest Threads

Top