SWIG for Python - returning 64 bit value

2005-04-07 Thread akineko
Hello everyone, I'm very new to SWIG and I'm trying to use SWIG to interface my Python program to routines written in C. Only catch is it has to pass 40 bit data both ways. I found several postings in the Internet newsgroup related to such. My swig interface file is: %module ipc_msg %{ %}

multiprocessing and Tk GUI program (won't work under Linux)

2009-03-19 Thread akineko
Hello everyone, I have started using multiprocessing module, which is now available with Python 2.6. It definitely opens up new possibilities. Now, I developed a small GUI package, which is to be used from other programs. It uses multiprocessing and Pipes are used to pump image data/command to

Re: multiprocessing and Tk GUI program (won't work under Linux)

2009-03-20 Thread akineko
Hello FB, Thank you for responding to my posting. I have tried your suggestion, making a function rather than a method in a class. The result is still the same. According to the documentation, objects to be sent through 'Connection' must be pickable. But I couldn't find anything that explain the

named pipe and Linux

2009-04-07 Thread akineko
Hello everyone, I'm trying to use named pipes to fuse a Python program and a C program. One side creates pipes using os.mkfifo() and both sides use the same named pipes (one side reads, another side writes). The read side uses select.select() to wait for incoming messages and read the message

Re: named pipe and Linux

2009-04-07 Thread akineko
. Thank you for providing me directions to solve this problem. Best regards, Aki Niimura On Apr 7, 3:26 pm, Cameron Simpson c...@zip.com.au wrote: On 07Apr2009 10:08, akineko akin...@gmail.com wrote: | I'm trying to use named pipes to fuse a Python program and a C | program. | One side

Re: A unique instance of Python GUI program

2008-09-16 Thread akineko
On Sep 16, 1:58 am, Tim Golden [EMAIL PROTECTED] wrote: I swear this question's been asked twice this month already. Thank you very much for many pointers. I'm awfully sorry for posting something that is already answered in the past. I tried to find answers to my problem using unique instance

Re: A unique instance of Python GUI program

2008-09-17 Thread akineko
Again, thank you for many postings to my question. I have reviewed solutions provided. Well, I like the named Mutex solution under Windows. That is a clean and straight-forward approach to the challenge. (I cannot believe that I'm saying good thing about Windows ;-) ) Unfortunately, I'm living in

What happened to _tkinter.so?

2008-06-26 Thread akineko
Hello Python developers, I have noticed something curious while I was investigating a problem with the PyInstaller. In my environment, the PyInstaller couldn't find TCL/TK installation path even I have it. I found the PyInstaller uses output from ldd dynamic link libary to find the a path to

Re: What happened to _tkinter.so?

2008-06-28 Thread akineko
an issue unless you install Python by yourself. Aki- On Jun 26, 6:00 pm, akineko [EMAIL PROTECTED] wrote: Hello Python developers, I have noticed something curious while I was investigating a problem with the PyInstaller. In my environment, the PyInstaller couldn't find TCL/TK installation path

Python XML-RPC Server with clientside Javascript

2008-07-04 Thread akineko
Hello everyone, I have used Python SimpleXMLRPCServer to expose several methods to be used. My Python script creates a free-standing server and not a CGI script. I have tested its exposed methods using the following Python script: import xmlrpclib s =

Re: Python XML-RPC Server with clientside Javascript

2008-07-05 Thread akineko
Hello Paul, Thank you very much for your prompt and clear answer. I didn't know the same origin javascript security policy (as I'm not familiar with javascript). After reading the description of the same origin javascript policy, I think you are absolutely correct. The security policy does make

tkinter: Round Button - Any idea?

2008-08-25 Thread akineko
Hello everyone, I'm trying to implement a virtual instrument, which has buttons and displays, using Tkinter+Pmw. One of items on the virtual instrument is a round button. This is imitating a tact switch. Tkinter has a Button class, which I can assign a button image. However, when the button is

Tkinter Unix and Windows incompatibility

2008-08-26 Thread akineko
Hello everyone, I'm trying to create custom Tkinter/Pmw widgets for my project. After testing my widgets under Unix (Solaris), I have tried them under Windows and I got a surprise. The widgets came out differently. The following simple code snippet demonstrates the difference: root = Tk()

Tkinter: tkButtonDown, tkButtonEnter, tkButtonInvoke, tkButtonLeave, tkButtonUp

2008-09-01 Thread akineko
Hi everyone, This is a memorandum so that other people can share the info. The following methods are declared in the Tkinter Button class. tkButtonDown(), tkButtonEnter(), tkButtonInvoke(), tkButtonLeave(), tkButtonUp() However, they are not working, when you try, you will get:

Tkinter after() under VMware player

2008-09-01 Thread akineko
Hi everyone, I wrote a Tkinter program that has a blinking widget. The blinking is controlled by the after() method available in the Tkinter. It worked very nicely. However, when I tried the program with a Unix OS that is running under VMware (hosted OS), I noticed the blinking rate is greatly

Re: Tkinter: tkButtonDown, tkButtonEnter, tkButtonInvoke, tkButtonLeave, tkButtonUp

2008-09-01 Thread akineko
On Sep 1, 5:52 pm, Guilherme Polo [EMAIL PROTECTED] wrote: Are you trying to simulate clicks ? You should be doing it using event_generate, more below. Actually, I was trying to implement a sticky button. (Button Release is done later by another event) I already tried event_generate. It

Re: Tkinter: tkButtonDown, tkButtonEnter, tkButtonInvoke, tkButtonLeave, tkButtonUp

2008-09-01 Thread akineko
On Sep 1, 6:34 pm, Guilherme Polo [EMAIL PROTECTED] wrote: This is an illusion you have, calling those methods are not the way for explicitly controlling button's behavior, not more than generating proper events. The explicit way is to not use a button, instead (ab)use Canvas. Some of my

Re: Tkinter: tkButtonDown, tkButtonEnter, tkButtonInvoke, tkButtonLeave, tkButtonUp

2008-09-01 Thread akineko
On Sep 1, 8:28 pm, Guilherme Polo [EMAIL PROTECTED] wrote: Can you clarify what is this sticky behavior ? Are you referring to a toggle button ? If yes, then you might be after a simple Checkbutton: checkbutton = Tkinter.Checkbutton(indicatoron=False, text='test') I wouldn't spend days to

Re: Tkinter: tkButtonDown, tkButtonEnter, tkButtonInvoke, tkButtonLeave, tkButtonUp

2008-09-02 Thread akineko
On Sep 2, 5:46 am, Guilherme Polo [EMAIL PROTECTED] wrote: Did you even try creating a checkbutton with indicatoron=False ? You could get surprised. I didn't. My perception of checkbutton was a button with a check. So, I tried as you suggested. Yes, you are right. It is almost what I wanted

64-bit / 128-bit data element type for array?

2008-12-22 Thread akineko
Hello everyone, I need to handle binary files that contain 64-bit (or 128-bit in the furture) unsigned int data. Python's array seems not supporting unsigned int type beyond 32-bit ('L'). I would like to use Python array as I need to make my program work on both big-endian machines as well as on

Re: 64-bit / 128-bit data element type for array?

2008-12-22 Thread akineko
: akineko wrote: Hello everyone, I need to handle binary files that contain 64-bit (or 128-bit in the furture) unsigned int data. Python's array seems not supporting unsigned int type beyond 32-bit ('L'). I would like to use Python array as I need to make my program work on both big-endian

Re: 64-bit / 128-bit data element type for array?

2008-12-22 Thread akineko
...@gmail.com wrote: akineko wrote: Hello, bearophile and Robert, thank you for your prompt response. I will try NumPy (this is a good execuse to learn and to use a new package). I haven't seen uint128 in the wild, though. Of course, not many applications require uinit128 as a scalar

Re: 64-bit / 128-bit data element type for array?

2008-12-22 Thread akineko
Robert wrote: Ah, good. numpy lets you construct your own data types from the primitives. Since you don't actually need uint128 arithmetic, you don't need a uint128 primitive. You can just use dtype('V16') (meaning void, 16 bytes long) ... Impressive. I installed NumPy and it worked like a

tkInter constraining the width only

2008-12-29 Thread akineko
Hello everyone, I'm writing a Tkinter program and trying to constraint the window size. I want to set the minimum of the width and the height and the maximum of the width, but not the height. I can use minsize(width=min_width, height=min_height) from Wm method to limit the minimum sizes.

Re: Python in C

2008-12-29 Thread akineko
Although this is not what you are asking but I'm wondering why you need to read CPython implementation. I have been using Python for 7 or 8 years but I've never encountered any situations where I need to read CPython implementation. I needed to read library implementations and installer codes,

Re: Python in C

2008-12-30 Thread akineko
Hello Skip, Thank you for your response. Your posting reminds me that we, Python community as a whole, owe a great deal to Python developers. The problem is ... The more you work on Python, the harder you can go back to C or C++ world. I use SWIG, instead. I think SWIG is a good way to mix two

Re: tkInter constraining the width only

2009-01-06 Thread akineko
Hello Roger, Thank you for your prompt response to my posting. Yes, it worked. I never thought of putting 0! A special trick not mentioned in the documentation. Thanks! Aki- On Dec 29, 1:01 pm, Roger rdcol...@gmail.com wrote: You want to set the max height to 0. I know this is counter-

subclassing 'list'

2009-01-06 Thread akineko
Hello everyone, I'm creating a class which is subclassed from list (Bulit-in type). It works great. However, I'm having a hard time finding a way to set a new value to the object (within the class). There are methods that alter a part of the object (ex. __setitem__()). But I couldn't find any

Re: subclassing 'list'

2009-01-06 Thread akineko
Hello Chris and James, Thank you for you guys' prompt response. Yes, that is what I wanted to do. I, somehow, didn't think of using those list methods. Instead, I was looking for a single method to override. Big Thanks! Aki- On Jan 6, 12:43 pm, Chris Rebert c...@rebertia.com wrote: If you

multiprocessing and SIGINT

2009-01-07 Thread akineko
Hello everyone, I'm trying to use multiprocessing module, which is now available with Python 2.6. It is a nice enhancement and it worked great. However, I have a situation and I couldn't figure out how to deal with. My Python program spawns another process to take care of GUI house- keeping.

Re: multiprocessing and SIGINT

2009-01-08 Thread akineko
It is a bit awkward to respond to my posting but I have some updates. I created two simple test programs, one uses threading and another uses multiprocessing. What I found was: (1) test program with threading Only main thread receives SIGINT (generated thread won't receive SIGINT) (2) test

Terminating a Python program that uses multi-process, multi-threading

2009-01-28 Thread akineko
Hello Python experts, I have a program that uses three processes (invoked by multiprocessing) and several threads. The program is terminated when ^C is typed (KeyboardInterrupt). The main process takes the KeyboardInterrupt Exception and it orderly shutdown the program. It works fine in normal

Re: Terminating a Python program that uses multi-process, multi-threading

2009-01-28 Thread akineko
On Jan 28, 1:11 pm, MRAB goo...@mrabarnett.plus.com wrote: A hacky way of killing the processes would be for the processes to write their process IDs to the log and then you can write another script which will parse the log to get the process IDs and then kill the processes with those IDs.