Re: py2exe socket.gaierror (10093)

2008-03-26 Thread Knut
> The script can't resolve the server name. Try to do it by hand using
> nslookup or even ping (you may want to add a few print statements inside
> the script to see the exact host name it is trying to connect to, in case
> it isn't what you expect)
> If you can't resolve the host name using nslookup, there is a network
> problem, not in your script. If you can resolve it, try your script
> without py2exe if possible.
>
> --
> Gabriel Genellina

Thank you for the quick reply Gabriel.

I have made sure the script works fine before I exe it.
It is when I compile the program I get this error.

I don't get how the compile changes server availability.


Thanks again,
Knut
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py2exe socket.gaierror (10093)

2008-03-27 Thread Knut
On 26 Mar, 23:08, Thomas Heller <[EMAIL PROTECTED]> wrote:
> Knut schrieb:
>
>
>
> >> The script can't resolve the server name. Try to do it by hand using
> >> nslookup or even ping (you may want to add a few print statements inside
> >> the script to see the exact host name it is trying to connect to, in case
> >> it isn't what you expect)
> >> If you can't resolve the host name using nslookup, there is a network
> >> problem, not in your script. If you can resolve it, try your script
> >> without py2exe if possible.
>
> >> --
> >> Gabriel Genellina
>
> > Thank you for the quick reply Gabriel.
>
> > I have made sure the script works fine before I exe it.
> > It is when I compile the program I get this error.
>
> > I don't get how the compile changes server availability.
>
> Could it be a firewall issue?
>
> Thomas

Hi Thomas,

Thanks for the tip!

Disabled the firewall to check if this could be the problem, but no
help there either..

The mail server is on the local network, but I have also tried
connecting to internal sockets to another program I have which sniffs
a port.
This works fine, until I run it as an exe..


My quest continues..
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py2exe socket.gaierror (10093)

2008-03-27 Thread Knut
This is frustrating.

I was working on writing a sample for my problem. I start with
dissecting my code which still gives the same error. Then I start
thinking that it might be my setup file doing the damage. And i start
it from scratch. Everything suddenly works.

Fine! i think, i will have to start over with the setup file. Buy i
give the old setup a last go, and guess what. It works.


So I am honestly utterly frustrated.. I have no idea what what the
reason for the problem, but apparently it is solved, for now.


Thanks for all you comments and help. I really appreciate it!

K
-- 
http://mail.python.org/mailman/listinfo/python-list


python and pymat

2005-11-25 Thread Knut Birger Lunde
Pretty new to python
I have a module for python who is made for python2.2. I have the  
endthought version 2.3. I have dowloaded a c++ source file and a makefile  
to create pymat.dll. However I think the maekfile is made for cygwin,  
since it complains that it does not find -lpython23 . This is the  
corresponding line in the makefile "PYTHON_LIB=-L${PYTHON_DIR}  
-lPython23". If I remove -Python23, the make program listst a lot og  
undefined references:
"pymat.o(.text+0x9e):pymat.cpp: undefined reference to  
`_imp__PyErr_SetString'".
Knut


-- 
http://mail.python.org/mailman/listinfo/python-list


Sending arrays of a structure as an argument via ctypes

2008-06-23 Thread Knut Saua Mathiesen
Hi there.
I am reprogrammed my astar* path finding algorithm in C to make it quicker.
I am now trying to make python use this C extension, however I keep
getting "Segmentation fault".

Some of the C stuff:



typedef struct Point {
int x;
int y;
} Point;

typedef struct Node {
Point pos;
int cost;
int g;
int obstacle;
struct Node* parent;
} Node;

void astar(Node map[], Point from, Point to) {
(...)
}
main () {
(...)
Node map[maptotal];
(...)
astar(map, createPoint(0,0), createPoint(50,50));
}


Now I am by no means a C programmer, this is basicly the first "bigger
than hello-world" program, but I have got it working in C. What I am
now trying to do is to make the map using python, and send it to my
astar C function using ctypes.

Basicly I've rewritten my structures in python:


class Point(Structure):
_fields_ = [("x", c_int), ("y", c_int)]
def __repr__(self): return "" % (self.x, self.y)

class Node(Structure):
def __repr__(self):
return "" % (self.pos.x, self.pos.y)
Node._fields_ = [('pos', Point), ('cost', c_int), ('g', c_int),
('obstacle', c_int), ('parent',POINTER(Node))]



And after that, this is how I am trying to call it:

self.astar = astarlib.astar
self.astar.argtypes = [Node * self.maptotal, Point, Point]
self.astar.restype = None

self.nodes = (Node * self.maptotal)()
for i in range(self.mapwidth):
for i2 in range(self.mapheight):
self.nodes[i2 * self.mapwidth + i] = Node(Point(i, i2))

self.astar(self.nodes, Point(5,6), Point(6,6))


When I call the self.astar function it segfaults. And what I think
I've done wrong is the self.nodes part, but I can't find any good
documentation on it.

Any help? :p
--
http://mail.python.org/mailman/listinfo/python-list