C type buffer copy

2005-03-22 Thread [EMAIL PROTECTED]
Hello, How does Python deal with C type memory buffers. Does Python return everything as an object irrespective of the data type? Here's what i am trying to achieve? testCode(unsigned char buf, unsigned long len) { unsigned long data=0x0; while (len--) { *buf++ = (unsigned ch

ebXML and Python

2005-03-22 Thread [EMAIL PROTECTED]
Hi, I am looking for advice on implementing ebXML messaging(ebMS) in Python. Any input? (www.ebxml.org). Thanks. -- http://mail.python.org/mailman/listinfo/python-list

newbie help

2005-03-23 Thread [EMAIL PROTECTED]
static void testme( unsigned char *buf, unsigned long size, CODE code) { unsigned long data switch (code) { // Generate some test patterns case TEST1 : value = 0x0; while (size--) {

Re: newbie help

2005-03-23 Thread [EMAIL PROTECTED]
I want to pass and index number and a file name from the command line. This index number corresponds to a buffer. I need to maintain 2 such buffers for my test. In C you would do someting like this unsigned char buf1[512]; In python is this as simple as? buf 1 = 512 buf 2 = 512 And how do i keep

Re: MMA - Musical MIDI Accompaniment, Beta 0.12

2005-03-24 Thread [EMAIL PROTECTED]
Hans Elst a écrit : I do not succeed in downloading MMA from http://mypage.uniserve.com/~bvdp/mma/mma.html Error 404. Can you help me? > http://mypage.uniserve.com/~bvdp/mma/mma-bin-0.13.tar.gz seems to work Regards, Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie help

2005-03-24 Thread [EMAIL PROTECTED]
I did something like this. index is passed from the command line. def __getBuffer( index): if index == 1: buf1 = [None] * 512 print "Buffer: %s" % (buf1) return buf1 if index == 2: buf2 = [None] * 512 print "Buffer: %s" % (buf1) return buf2 Is thi

Re: newbie help

2005-03-24 Thread [EMAIL PROTECTED]
Here it is again. I did something like this. index is passed from the command line. def __getBuffer( index): if index == 1: buf1 = [None] * 512 print "Buffer: %s" % (buf1) return buf1 elif index == 2: buf2 = [None] * 512 print "Buffer: %s" % (buf2)

Re: newbie help

2005-03-24 Thread [EMAIL PROTECTED]
Hello, Thanks to all for great responses. Here's what iam trying to do. I am writing a script to generate test patterns. For this i am passing an index number, size and a opcode from the command line testit -i -s [-o ] When the user passes the index number(1 or 2), it maps to one of the buffers

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread [EMAIL PROTECTED]
Patrick Useldinger wrote: > cjl wrote: > > > Implementations of what I'm trying to accomplish are available (open > > source) in C++ and in Java. > > > > Which would be easier for me to use as a reference? > > > > I'm not looking for automated tools, just trying to gather opinions on > > which lan

Re: What's the best GUI toolkit in Python,Tkinter,wxPython,QT,GTK?

2005-03-28 Thread [EMAIL PROTECTED]
Tom, there's a reason that Tkinter is included with Python - it's probably the most straitforward of the 4 you mentioned. It's dead easy to get running on Win32 and Linux systems (haven't tried on Mac OS, but I hear reports of it being used). I found GTK to be damn near impossible to install on W

Little Q: how to print a variable's name, not its value?

2005-03-28 Thread [EMAIL PROTECTED]
No doubt I've overlooked something obvious, but here goes: Let's say I assign a value to a var, e.g.: myPlace = 'right here' myTime = 'right now' Now let's say I want to print out the two vars, along with their names. I could easily do this: print "myPlace = %s, myTime = %s" % (myPlace, myTime)

Re: 133+ Tutorials and counting...

2005-03-28 Thread [EMAIL PROTECTED]
There's a Tkinter wiki for helping beginners: http://tkinter.unpy.net/wiki S -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if program is installing using python

2005-03-30 Thread [EMAIL PROTECTED]
does this help? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52224 -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: ClassA instance has no attribute '__len__'

2005-03-30 Thread [EMAIL PROTECTED]
The most simple way to get this error I can think of is like this. It happens because len does not know how to calculate the lenght of this object. -class classA: - def __init__(self): - pass -a = classA() -print len (a) Traceback (most recent call last): File "./test.py", line 10, in ?

Re: Little Q: how to print a variable's name, not its value?

2005-03-30 Thread [EMAIL PROTECTED]
my god, I've created a monster! Maybe I should restate my original problem. Actually, the word 'problem' is too strong. I had a little curiosity about whether I could write a couple of lines of code more succinctly, or more pythonically. I didn't realize that this would trigger a discussion abou

Re: tkinter destroy()

2005-03-30 Thread [EMAIL PROTECTED]
Your app seems to give the right state values only if you select 'Freni a posto'. But I see you recognize that with your 'FIXME' note. also the app seems to have too many variables and widgets defined as self objects. That isn't necessary unless they will be used outside the method they were cr

Re: Little Q: how to print a variable's name, not its value?

2005-03-31 Thread [EMAIL PROTECTED]
Bengt wrote: "The way you use those words makes me wonder: "assign _it_"?? Which 'it'? " - it's probably evident to any close observer that my understanding of objects is superficial, no doubt a reflection of the fact that I started programming on punch cards a very long time ago. I use objects e

Re: StopIteration in the if clause of a generator expression

2005-04-03 Thread [EMAIL PROTECTED]
This is all just making everything far too complicated. What you really want to do is quite simple: import itertools def condition(x): return x < 5 list(itertools.takewhile(condition, (i for i in range(10 The 'Stop Iteration In Generator Expression' problem was solved in the language that Li

Semi-newbie, rolling my own __deepcopy__

2005-04-04 Thread [EMAIL PROTECTED]
Hi, folks, First, the obligatory cheerleading -- then, my questions... I love Python! I am only an occasional programmer. Still, the logic of the language is clear enough that I can retain pretty much all that I have learned from one infrequent programming session to the next. That's quite an a

setup distributed computing for two computer only

2005-04-04 Thread [EMAIL PROTECTED]
Hello, Is there any one who has experiance about how to setup distributed computing for 2 computer only. I really want to know from the start. Any suggestion appreciated. Sincerely Yours, Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: setup distributed computing for two computer only

2005-04-04 Thread [EMAIL PROTECTED]
Hello, There are two computer. For example one computer ask other computer to run function, procedure or object then receive the result. I want to know about what should I do to setup such system and what software I need to implement it. Sincerely Yours, Pujo -- http://mail.python.org/mailman/

Re: Name of IDLE on Linux

2005-04-04 Thread [EMAIL PROTECTED]
Peter Otten wrote: and now typing e. g. > pym os.path > in the address bar immediately brings up that module's documentation. > > Peter Nice one! Thanks. S -- http://mail.python.org/mailman/listinfo/python-list

Re: Makeing TopLevel Modal ?

2005-04-04 Thread [EMAIL PROTECTED]
well, top.transient(root) will ensure your toplevel window is on top of all others. IIRC, you could also use top.grab_set() to make it modal, but you'll have to try it and see. S -- http://mail.python.org/mailman/listinfo/python-list

Python IDE like NetBeans/Delphi IDE

2005-04-05 Thread [EMAIL PROTECTED]
Hi ! I search for an IDE that working in Windows, and knows these functions: A.) Automatic name searching/showing/extending on classes with keypressing (like Netbeans, or Delphi Ctrl+Space). B.) Debugging: breakpoints, step on lines (code), watch variables. Or A and B both. Please help me. Thanx:

Python & MySQL

2005-04-05 Thread [EMAIL PROTECTED]
Hi all, I've got a weird problem. I was running Python 2.3 and MySQLdb and had everything running fine. Cutting to the chase: After upgrading to 2.4 (and latest modules) the MySQLdb functions in Python can connect to the database, do queries and do inserts. Or rather, it seems to do inserts. I

Re: Python & MySQL

2005-04-05 Thread [EMAIL PROTECTED]
Okay, I had the brilliant idea right after posting to google the newsgroups on this. db = MySQLdb.connect(user=database_user,passwd=database_password) db.autocommit(True) <--- One little line! There ya go. Works like a champ. I swear I was pulling my hair out yesterday over this. -- http

Re: oracle interface

2005-04-05 Thread [EMAIL PROTECTED]
We use cx_oracle, for us it has proven to be very stable running on Solaris. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best editor?

2005-04-05 Thread [EMAIL PROTECTED]
I use gedit under gnome, works perfect, it is very easy to use, it has the colours - it also supports other languages. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path query functions behavior incorrect?

2005-04-05 Thread [EMAIL PROTECTED]
It works fine under linux [EMAIL PROTECTED]:~ $ python Python 2.3.4 (#2, Feb 2 2005, 11:10:56) [GCC 3.3.4 (Debian 1:3.3.4-9ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os.path >>&

Re: tkinter destroy()

2005-04-05 Thread [EMAIL PROTECTED]
Macs: "if we follow your advice we should do: immagine_1a = PhotoImage() instead, but it doesn't work. why? " Images are a special case. You need to create an object instance of them through the self. construction or else Tkinter seems to forget about them within a couple of lin

Establishing connection SSH

2005-04-06 Thread [EMAIL PROTECTED]
Hello all, I have one computer and 1 server. I have login and password. The only way I can connect to server is using SSH protocol. I usually use Winscp3 to connect to the server (by providing login and password). Now I would like to connect to the server directly using python code. How can I esta

Re: Semi-newbie, rolling my own __deepcopy__

2005-04-06 Thread [EMAIL PROTECTED]
Michael Spencer wrote: > [EMAIL PROTECTED] wrote: [snip] > > Anyway, my present problem is that I want to make copies of instances > > of my own custom classes. I'm having a little trouble understanding > > the process. Not that I think that it matters -- but in case

Re: how to parse system functions output

2005-04-06 Thread [EMAIL PROTECTED]
Or if you run 2.4 you can use subprocess -- http://mail.python.org/mailman/listinfo/python-list

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread [EMAIL PROTECTED]
For me it works fine. It seems that for you stdout is not flushed correctly in your terminal. What kind of terminal are you writing to? -- http://mail.python.org/mailman/listinfo/python-list

Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread [EMAIL PROTECTED]
I'd like to overwrite just one line of a binary file, based on a position set by seek(). Is there no way to do this? As far as I can tell I need to read the whole file, change the line, and write it all back out. Not exactly easy on the memory, but I see no other solution. so far: patch

Re: Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread [EMAIL PROTECTED]
Erik Max Francis wrote: > [EMAIL PROTECTED] wrote: > > > I'd like to overwrite just one line of a binary file, based on a > > position set by seek(). Is there no way to do this? As far as I can > > tell I need to read the whole file, change the line, and write it a

Re: Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread [EMAIL PROTECTED]
Ok the key was "r+b" as opposed to "a+b" but why is that? R is for read, correct? And b for binary. Adding the plus gives me some form of write capability? -- http://mail.python.org/mailman/listinfo/python-list

Re: Web application toolkit recommendation?

2005-04-06 Thread [EMAIL PROTECTED]
I have looked briefly at Karrigell. does it support user logins? S -- http://mail.python.org/mailman/listinfo/python-list

Re: Python modules for image / map manipulation?

2005-04-06 Thread [EMAIL PROTECTED]
my image file is only about 5 MB, so, it's not too large. I've done some testing with PIL and it will meet my needs, I think. I can see how I could slice and dice my image, or only present the cropped section that I need. thanks, S -- http://mail.python.org/mailman/listinfo/python-list

client-client connection using socket

2005-04-07 Thread [EMAIL PROTECTED]
Hello, I have two client computers, each has its own host name. Can I do connection like socket between the two? I check when we want to make connection we have to only put hostname and port. For example: #Server program. Could we use client hostname here ? HOST = "" PORT = 21567 BUFSIZ =

Re: logging as root using python script

2005-04-07 Thread [EMAIL PROTECTED]
use the program called 'expect' it can be called via python. you can build a script using the 'autoexpect' tool. http://www.linuxjournal.com/article/3065 cheers Raghul wrote: > Hi >Is it possible to login as a root in linux using python script? > What I need is when I execute a script it shou

Re: Best editor?

2005-04-08 Thread [EMAIL PROTECTED]
Howdy, I'm sold on out Leo, http://leo.sf.net, pure Python amazingly easy to learn and powerful. Based on outlining, it provides a powerful and flexible way to manage content. Lots of built in Python code awareness. Extensible with plugins, a very active community is making "I wish my editor cou

email and smtplib modules

2005-04-09 Thread [EMAIL PROTECTED]
Hi, I'm writing a small script that generates email and I've noticed that: 1) one should add the 'To' and 'CC' headers to the email message 2) one needs to specify the recipients in the smtplib sendmail() method Can someone explain how these are related? Thanks, Mark -- http://mail.python.org

Re: python modules in home dir

2005-04-09 Thread [EMAIL PROTECTED]
set the PYTHON_PATH to include your home directory -- http://mail.python.org/mailman/listinfo/python-list

Re: Unit tests in Leo

2005-04-10 Thread [EMAIL PROTECTED]
Hello Tomi, I'm not really sure about your question, but concerning unit testing you can do a simple test. import unittest First: in your module (where you define functions) you should create a class which use unittest.TestCase as your superclass. Second: Use method runTest to type your test

Re: email and smtplib modules

2005-04-10 Thread [EMAIL PROTECTED]
Hi Mike, Thanks for the quick tutorial :) Quite helpful. -- http://mail.python.org/mailman/listinfo/python-list

Re: Smart help again

2005-04-10 Thread [EMAIL PROTECTED]
You can create your own Exception class, based on thisrecipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52215, it will look like -import sys, traceback - -class Error: -def __init__(self, arg): -self._arg = arg -tb = sys.exc_info()[2] -while 1: -

PIGIP Meeting -- Python Interest Group In Princeton

2005-04-10 Thread [EMAIL PROTECTED]
Python Interest Group In Princeton (PIGIP) PIG/IP will hold its fourth meeting on Tuesday April 12, 2005 at the Lawrenceville Library. Unfortunately, the Lawrenceville library has no free rooms at the usual 3rd Wednesday time. We will be reviewing more of the Python Tutorial (we last left off fini

database in python ?

2005-04-10 Thread [EMAIL PROTECTED]
Hello I need to build table which need searching data which needs more power then dictionary or list in python, can anyone help me what kind of database suitable for python light and easy to learn. Is mySQL a nice start with python ? Sincerely Yours, Pujo -- http://mail.python.org/mailman/listin

Re: Doubt regarding sorting functions

2005-04-10 Thread [EMAIL PROTECTED]
Basically you can sort after you put your data in your list: L = [1.2,1.23,4.5,2] L.sort() print L L = ["a","c","b","A","C","B"] L.sort() print L Result: [1.2, 1.23, 2, 4.5] ['A', 'B', 'C', 'a', 'b', 'c'] # remember in character the "A"

Re: compound strip() string problem

2005-04-10 Thread [EMAIL PROTECTED]
use re module instead: import re s = "helo world niceday" res = re.split("\s+",s) print res result: ['helo', 'world', 'nice', 'day'] Sincerely Yours, Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: hello

2005-04-10 Thread [EMAIL PROTECTED]
Hi Mage, You can use "for in " instead of "while break". I start from C# and I found python is wonderfull, some style is strange but it fun anyway to learn new way of thinking. Best Regards, Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: database in python ?

2005-04-11 Thread [EMAIL PROTECTED]
MySQL is an excellent option is very well documented. It is also a defacto standard for OpenSource databases. You will need to install the Python module MySQLdb. --> http://sourceforge.net/projects/mysql-python There should be plenty of examples online too for using MySQLdb with Python. If you

Re: Smart help again

2005-04-12 Thread [EMAIL PROTECTED]
I hope a rewrite makes it a bit more clear for you. The test module is defined below, it contains a simplified Error object, it resemble the one I use a lot in my own scripting. The test file generates an error ( A ZeroDivisionError in method eggs of class Spam). -#!/usr/bin/env python -import

Re: how to explain such codes, python's bug or mine?

2005-04-13 Thread [EMAIL PROTECTED]
Hi, it is not python bug. You refer the list j and remove the element in the same time, that is the problem. Python dinamicaly goes to the next element with the same index but apply it in the new list. use this code instead: j = range(20) print j L = [x for x in j if x > 10] print L Sinc

Re: how to explain such codes, python's bug or mine?

2005-04-13 Thread [EMAIL PROTECTED]
Hi The second style can be used: j = range(20) print j L = [x for x in j if x > 10] j = L There are another method such poping the item based on last index to 0: for i in range(len(j)-1,0-1,-1): if j[i]<=10: j.pop(i) print j Pujo -- http://mail.python.org/mailman/listinf

Re: Compute pi to base 12 using Python?

2005-04-13 Thread [EMAIL PROTECTED]
Dan Bishop wrote: > Dick Moores wrote: > > I need to figure out how to compute pi to base 12, to as many digits > as > > possible. I found this reference, > , > > but I really don't understand it well enough. > > How many stars are in "***

Re: Compute pi to base 12 using Python?

2005-04-14 Thread [EMAIL PROTECTED]
Nick Craig-Wood wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm using GMPY (see code). > [snip] > > If you are using gmpy you might as well do it like this. > > gmpy.pi() uses the Brent-Salamin Arithmetic-Geometric Mean formula for > pi II

Re: Socket Error

2005-04-14 Thread [EMAIL PROTECTED]
You missed the import socket statement. Also the socket.PF_INET should be socket.AF_INET -- http://mail.python.org/mailman/listinfo/python-list

key-logging capability using python ?

2005-04-15 Thread [EMAIL PROTECTED]
Hi, I am commanding a robot through a laptop keyboard and I would like to be able to record the different keys I hit in order to achieve a certain goal. I looked at PyHook, http://sourceforge.net/project/showfiles.php?group_id=65529&package_id=92632&release_id=307838 but it seems to only be availa

mySQL values not updating after query

2005-04-15 Thread [EMAIL PROTECTED]
I have an application that I am trying to add mySQL to. I can connect to the server with no problems and get a couple values from a table the first time the page loads, ( a wxPython GUI app ), after changing the table values from a mySQL shell I refresh the page and the values don't update unless

Re: mySQL values not updating after query

2005-04-15 Thread [EMAIL PROTECTED]
Don't forget to call: db.commit() Hope that's help. Pujo -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python 2.3.2 for PalmOS available

2005-04-15 Thread [EMAIL PROTECTED]
Hello, Some months ago i did a port of the Python2.3.2 interpreter to PalmOS. I didnt port any C module or created modules for PalmOS API's. But you can run an interpreter and use stdin/stdout from a form. There is also a tool to freeze scripts and use the interpreter as a pseudo-shared library.

Re: ANN: Python 2.3.2 for PalmOS available

2005-04-15 Thread [EMAIL PROTECTED]
Fixed. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Do You Want To Know For Sure That You Are Going To Heaven? The reason some people don't know for sure if they are going to Heaven when they die is because they just don't know. The good news is that you can know for sure that you are going to Heaven which is described in the Holy Bible as a beautiful place with no death, sorrow, sickness or pain. (newsgroup-post 140)

2005-04-16 Thread [EMAIL PROTECTED]
I don't know why you post this article and contradict pope and Christian. Is this the right forum to talk something like this ? I guess this is only python language forum not Religion forum --- pujo -- http://mail.python.org/mailman/listinfo/python-list

Problem with unpack hex to decimal

2005-04-17 Thread [EMAIL PROTECTED]
Hello, I was looking at this: http://docs.python.org/lib/module-struct.html and tried the following >>> import struct >>> struct.calcsize('h') 2 >>> struct.calcsize('b') 1 >>> struct.calcsize('bh') 4 I would have expected >>> struct.calcsize('bh') 3 what am I missing ? Thanks in advance, Jak

Re: Strings and Lists

2005-04-18 Thread [EMAIL PROTECTED]
Hello Tom, I think it is more efficient if we can use list (with True,False) member to do genetics algorithms. Of course a lot of works to do to change from string binary into boolean list. I do programming genetics algorithms in C# I guess I have to modify my program also because my old program

Re: Problem with unpack hex to decimal

2005-04-18 Thread [EMAIL PROTECTED]
Thank you all very much. It looked like I was not the only one confused. Jake. -- http://mail.python.org/mailman/listinfo/python-list

Replaying multimedia data.

2005-04-18 Thread [EMAIL PROTECTED]
Hello, On a robotic project I am working on, I am taking data through different sensors (cameras, acceleration, gyroscopes,) and store the attendant data into files for further processing. When I am done gathering data, I read them offline using nearly the same script as the one I used to gat

Re: Compute pi to base 12 using Python?

2005-04-18 Thread [EMAIL PROTECTED]
Nick Craig-Wood wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Nick Craig-Wood wrote: > > > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > I'm using GMPY (see code). > > > [snip] > > > > > > If you are us

Re: The value of the entry widget doesn't get updated

2005-04-19 Thread [EMAIL PROTECTED]
Yes that solves my problem all right...THanks a bunch to both of you -- http://mail.python.org/mailman/listinfo/python-list

Why Python does *SLICING* the way it does??

2005-04-19 Thread [EMAIL PROTECTED]
Many people I know ask why Python does slicing the way it does. Can anyone /please/ give me a good defense/justification??? I'm referring to why mystring[:4] gives me elements 0, 1, 2 and 3 but *NOT* mystring[4] (5th element). Many people don't like idea that 5th element is not invited. (BT

pyGTK on Mouse over event ?

2005-04-20 Thread [EMAIL PROTECTED]
hello, Is there an event simular to the java event onMouseOver ? I want to get the coordinates of the mouse pointer when it is over an image ( GTKImage widget) I've tried using the EventBox with the motion_notify but that only seems to work when the mouse is pressed ? -- http://mail.python.org/

Re: pyGTK on Mouse over event ?

2005-04-20 Thread [EMAIL PROTECTED]
if i add a motion_notify or even a butten_press event to an image object it does absolutly nothing :s -- http://mail.python.org/mailman/listinfo/python-list

Re: pyGTK on Mouse over event ?

2005-04-20 Thread [EMAIL PROTECTED]
def __init__(self): xml = gtk.glade.XML("/home/domenique/project1.glade") self.window = xml.get_widget("window1") self.img = xml.get_widget("image1") self.img.set_from_file("./test.svg") self.img.show() self.img.add_events(gtk.gdk.BUTTON_MOTION_MASK) xml.signal_autoconne

Re: pyGTK on Mouse over event ?

2005-04-20 Thread [EMAIL PROTECTED]
no problem i'll just keep using the eventbox but is there an event wich is triggert when the mouse moves over the eventbox ? -- http://mail.python.org/mailman/listinfo/python-list

Re: regarding main function

2005-04-21 Thread [EMAIL PROTECTED]
if you run in the same file there is no difference. Block under "__main__" will be executed if you run that file only but if you import that file from another file, then if you don't put your code inside "__main__" your code it will be executed (this is not what you want). Example: You have 1 fi

Re: pyGTK on Mouse over event ?

2005-04-21 Thread [EMAIL PROTECTED]
the POINTER MOTION MASK doesn't do the trick either. This is the first time i'm using python and pyGTK and it's really sad to see that a simple mouseover is hard to program. :s -- http://mail.python.org/mailman/listinfo/python-list

Re: pyGTK on Mouse over event ?

2005-04-21 Thread [EMAIL PROTECTED]
I've managed to get it all working ! I've used an Image inside an eventBox and used the motion notify event. The trick was to add the Events in the Common tab of the Glade property editor. Those where the MASK's you where talking about. Anyway, now it works just fine :) Thx for the information and

Re: __del__ and reference count problem

2005-04-21 Thread [EMAIL PROTECTED]
Your problem can be simplified : class A: pop = 11 def __del__(self): print A.pop if __name__ == '__main__': objA = A() Exception exceptions.AttributeError: "'NoneType' object has no attribute 'pop'" in > ignored I got the same error message, and I don't know why ? it looks like the c

Re: __del__ and reference count problem

2005-04-21 Thread [EMAIL PROTECTED]
look at this discussion: http://www.dbforums.com/archive/index.php/t-1100372.html it looks like we have to use other way, hold the data we want to preseve in an object, because it is possible the class is removed before the instance cleaned, and we can not expect __del__ 100% in handling finalizin

Re: New line

2005-04-21 Thread [EMAIL PROTECTED]
okay, you type your code in idle, and run your code by hitting the F5 key? -- http://mail.python.org/mailman/listinfo/python-list

Re: Semi-newbie, rolling my own __deepcopy__

2005-04-21 Thread [EMAIL PROTECTED]
I'm back... Thanks to Michael Spencer and Steven Bethard for their excellent help. It has taken me a few sessions of reading, and programming, and I've had to pick up the exploded fragments of my skull from time to time. But I now have succeeded in making deepcopy work for a simple class that I wr

pylab strange error message

2005-04-22 Thread [EMAIL PROTECTED]
I found this error message when I import pylab. from pylab import * Error message: Microsoft Visual C++ Runtime Library Assertion failed! Program:c\python24\python.exe File:CXX/cxx_extentions.cxx Line:1031 Expression: ob_refcnt == 0 For information on how your program can cause an assertion fail

A SOAPpy question... (Method Parameters)

2005-04-22 Thread [EMAIL PROTECTED]
I'm having difficulty sending out correctly named method parameters to a php soap server that I am running using SOAPpy. Idealy I would like to send XML that looks like this (which I cribbed from another client that works just fine) http://testuri.org";>

WHERE tiny pylibpcap example code that just uses next()???...

2005-04-22 Thread [EMAIL PROTECTED]
I'm trying to learn pylibpcap and would //really// love to see a **simple** example that just works. Can someone *please* send me any little app that just captures packets with next() command and prints bytes received?? If it only works on loopback interface that is fine. Thanks in advance.

Re: Semi-newbie, rolling my own __deepcopy__

2005-04-23 Thread [EMAIL PROTECTED]
Michael Spencer wrote: > [EMAIL PROTECTED] wrote: > > I'm back... > [wondering why copy.deepcopy barfs on array instances] > > > > http://www.python.org/doc/2.3.3/lib/module-copy.html > deepcopy: > ... > This version does not copy types like module, class,

Handling lists

2005-04-23 Thread [EMAIL PROTECTED]
I have a question on python lists. Suppose I have a 2D list list = [[10,11,12,13,14,78,79,80,81,300,301,308]] how do I convert it so that I arrange them into bins . so If i hvae a set of consecutive numbers i would like to represent them as a range in the list with max and min val of the range alo

Bounding box on clusters in a 2D list

2005-04-23 Thread [EMAIL PROTECTED]
If I have ex: x = [[1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0], [1,1,1,0,1,1,0,0,0,0,0,1,1,1,1,0,0,0], [1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,0,0,0], [0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0]] what I want is a boundingbox over the region where we find clusters of 1's.So for instance in th

Re: Handling lists

2005-04-23 Thread [EMAIL PROTECTED]
yes that makes sense.But the problem I am facing is if list= [300,301,303,305] I want to consider it as one cluster and include the range as [300,305] so this is where I am missing the ranges. so If the list has l = [300,301,302,308,401,402,403,408] i want to include it as [[300,308],[401,408]].

python sizeof ?

2005-04-24 Thread [EMAIL PROTECTED]
Hello, How can I get the size of an object in python..? analog with c sizeof? Pujo -- http://mail.python.org/mailman/listinfo/python-list

thread lock object.

2005-04-24 Thread [EMAIL PROTECTED]
Hello, I have multi thread program running together and each will increment int i. How can we make only one thread at a time be able to access and increment i ? Thanks in advance, Sincerely Yours, pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: thread lock object.

2005-04-24 Thread [EMAIL PROTECTED]
thanks. Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug?

2005-04-24 Thread [EMAIL PROTECTED]
when you use a = a + 'world' python sees it as an error because of different type. But when you use a += 'world' python will change the right into list (because a is a list). So when you're code become: a += 'world' # a += list('world') It really helpfull if you stick to use append instead of +=

Re: Is this a bug?

2005-04-24 Thread [EMAIL PROTECTED]
check this site: http://mail.python.org/pipermail/python-bugs-list/2003-November/021201.html pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling lists

2005-04-24 Thread [EMAIL PROTECTED]
That helps.Thanks much. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bounding box on clusters in a 2D list

2005-04-24 Thread [EMAIL PROTECTED]
Richter,yes what I am looking for is for cluster with rectangular bounding boxes as you explained in the first figure. -- http://mail.python.org/mailman/listinfo/python-list

Re: optparse: store callback return value

2005-04-24 Thread [EMAIL PROTECTED]
gs() - -print options, args prints when executed with or without argument: [EMAIL PROTECTED]:~$ ./test2.py --foo saw foo {} [] [EMAIL PROTECTED]:~$ ./test2.py {} [] [EMAIL PROTECTED]:~$ -- http://mail.python.org/mailman/listinfo/python-list

Re: Bounding box on clusters in a 2D list

2005-04-24 Thread [EMAIL PROTECTED]
hi Bearphile! That really gives me an idea.Thanks much for that. Yes as you said the algorithm reaches a maximium recursion depth for larger sets i tried.I still have a question. if m = [[0,0,0,0],[0,1,1,0,0],[0,0,1,0,0],[0,0,0,0]] all it does is count the number of 1's and return us the number in

Re: Python 2.4 killing commercial Windows Python development ?

2005-04-25 Thread [EMAIL PROTECTED]
It would be *really* nice if it worked for Python itself for making an RPM distribution of Python. -- http://mail.python.org/mailman/listinfo/python-list

<    6   7   8   9   10   11   12   13   14   15   >