473,320 Members | 2,189 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Curios issues with Editors

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

Feb 9 '06 #1
3 1166
rodmc wrote:
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.
import socket
type(socket.AF_INET) <type 'int'>


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
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Feb 9 '06 #2
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

Feb 9 '06 #3
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

Feb 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Dustin | last post by:
Hello, I just started programming in Python last night, and I've really enjoyed my experience so far. I would like to know if there is a Windows editor that recognizes Python and will support a...
8
by: Radhika | last post by:
Hi, I am looking for some java based, opensource xml editors which support xml schemas. Can somebody help me??? thanks, Radhika.
5
by: lkrubner | last post by:
Go to this page: http://www.publicpen.com/designer/mcControlPanel.php?arrangement=createweblogsForm.php You'll need to login, use these: username: designer password: designer123 This is...
3
by: bbxrider | last post by:
am building a website and using templates to get started much of the page content is gif files, so am investigating different gif editors mostly what is needed so far is a tool that picks up the...
0
by: Outkast | last post by:
I've got a plugin architecture system that calls LoadFrom to load the .dlls in a specific folder and it works fine and dandy, imports everything, my code can create objects from types found in the...
21
by: windandwaves | last post by:
Hi Folk Right now, I am using notepad2 to edit my PHP files. Do you have any recommendations for any php editors I should purchase instead? I dont mind spending some money for a good product....
28
by: rich | last post by:
i know that there are die hard mark uppers that use notepad or some other plain editors...as far as graphic editors are concerned what are some reccomendations both commercial and if any freeware
0
by: CrispinH | last post by:
Hi I've just upgraded some Type Editors from 1.1 to 2.0 and whilst they compile OK, I'm not getting any results in the test harness PropertyGrid. Usually when you select a particular property,...
1
by: --== Alain ==-- | last post by:
Hi I've create a C++ managed Class as : *.h file -------- #pragma once #include "afxcmn.h" using namespace System::Design; using namespace System::Drawing::Design; using namespace...
27
by: prt7u | last post by:
Howdy, I've started back afte a very long time of working with web pages for an organization that I am affiliated with (personally not professionally). Seeing that technology has advanced a lot...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.