Re: Questions about extending Python...
Redefined Horizons wrote: I've got a third-part application that exposes a C API. I'd like to wrap it in Python. Is there a specific forum that covers extending and embedding Python, or are those type of questions O.K. on this list? Scott Huey Over the years, many posts (and questions) have come up on dynamically importing and reloading modules and the inadequacy of the now available import and reload() features. This should enable one to modify or add code at runtime without having to restart the application. Unfortunately, few respondents understand the implications of this possibility. Regrettably also some display their ignorance by swinging their self perceived weight around. James Coplien, a Bell Laboratories Scientist, published Advanced C++ Programming Styles and Idioms. Although now 15 years old, this book still has today quite some impact. Of particular interest for the problem at hand is Chapter 9 which presents idioms supporting incremental run-time update. Further Coplien illustrates in this chapter the major advantage gained by languages like Smalltalk and Lisp in this matter by having incremental run-time update as a built-in feature. Reading Coplien may further the cause of this very basic missing requirement in Python, -- http://mail.python.org/mailman/listinfo/python-list
Re: using import * with GUIs?
John Salerno wrote: Terry Reedy wrote: If I were to use Tkinter, I would 'import Tkinter as tk'. Good idea! I was kind of excited about Tkinter for a little while...seems very easy, and it has an event delegation system that I understand! But then I saw that for a toolbar you use a Frame? And for a status bar you use a Label? Ick! I guess if I'm going to learn a GUI, I might as well jump right into wxPython from the beginning. Better first look at Qt/PyQt before jumping right into wxPython. You will at least know what you will be jumping into. -- http://mail.python.org/mailman/listinfo/python-list
Re: Programming language productivity
John Bokma wrote: Connelly Barnes [EMAIL PROTECTED] wrote: http://barnesc.blogspot.com/2006/05/programming-language-productivity.h tml C:3 hours to write the program, 5 hours to track down the memory leaks Java: 4 hours to write the program, 6 hours to get all the exception handling right C++ 5 hours to write the program after reading Stroustrup for 6 hours Just kidding, of course. Also note that Python programmers write more lines/hour which they need to finish in the same time as Perl programmers :-D. -- John MexIT: http://johnbokma.com/mexit/ personal page: http://johnbokma.com/ Experienced programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html I am not shure whether your criterion is very valid. OK if you have to write only one compact piece of code like in your example. Sometimes I think that most python users fall within this category. Once you get involved in larger projects, the dynamic nature of the programming tool becomes much more important. I mean by this, the ability to stop running code, modify or add to it and continue without having to re-establish the state of the program. This may sound trivial to many, but in major applications setting up the state again can take a considerable processing time. Such feature should be available from within the debugging tools. In fact, languages like Smalltalk, Lisp and even VB offer this possibility. Ruby coming up strongly these days also has this dynamic reload capability. To sum up, I like Python very much but I don't understand how come this basic flaw has not been taken care of. It is sufficient to search for reload to see how many people have struggled with it over the years. I hate the idea of having to take up Ruby to really find out how it could serve me better in this most critical productivity area. -- http://mail.python.org/mailman/listinfo/python-list
Re: interactive shell -- reload definitions?
This is a question that comes up almost continuously for at least six years now. For Python users having to deal with major real-life applications, this may make them think twice about the future suitability of Python as a competitive development tool. Ruby is featuring a software modify and go feature. Lisp is, even VB does. In the design of Smalltalk this used to be one of the major considerations. Plenty of posts will turn up doing a search on reload. The following references summarize some of these problems: http://groups.google.com/group/comp.lang.python/browse_frm/thread/efba62d227ba4794/41f57f366affd057?q=Hung+Jung+Lu+reloadrnum=2#41f57f366affd057 http://groups.google.com/group/comp.lang.python/browse_frm/thread/efba62d227ba4794/41f57f366affd057?q=Hung+Jung+Lu+reloadrnum=2#41f57f366affd057 In fact, doing a reload usually will not accomplish what one is looking for. Class instances should also be upgraded on reload(), preferably automatically. This can be accomplished as shown by Michael Hudson in: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/160164 Variants on this theme exist which seem to be broken. Given the persistent push of Ruby, I would strongly recommend that a workable integrated solution will be found for Reload Go in Python, taking priority on many way out features of rather low practicality for many programmers. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python editor recommendation.
Look at eric: http://www.die-offenbachs.de/detlev/eric3.html Editor is QScintalla I tried everithing and prefer eric. (it's free) malv -- http://mail.python.org/mailman/listinfo/python-list
Upgrading Class Instances Automatically on Reload
Upgrading Class Instances Automatically on Reload: Recipe 20.15 out of Python Cookbook #2. Did anybody get this recipe to work? The original example by Michael Hudson works without problems. I'm using Python 2.4.1 malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Upgrading Class Instances Automatically on Reload
Rene, No, I couldn't get it to work. Sorry, I should have included that information. At the statement b = Bar(), the following error occurs: The debugged program raised the exception unhandled AttributeError type object 'Bar' has no attribute '__instance_refs__' malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Can Python installation be as clean as PHP?
If this bothers you, why don't you stick to a linux distro with Python installed. Very few don't. -- http://mail.python.org/mailman/listinfo/python-list
Re: Upgrading Class Instances Automatically on Reload
Indeed, as I indicated the old recipe/160164 by Michael Hudson works flawlessly for me. I am referring here to the latest edition: cookbook #2 which features an upgraded version. You find the examples in: http://examples.oreilly.com/pythoncook2/cb2_examples.zip The files are named cb2_6_21_*.py, but the book has the recipe in chapter 20.15. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Binary File Reading : Metastock
Jack wrote: Hi I am having a little trouble trying to read a binary file, I would like to write an ascii to Metastock converter in python but am not having a lot of success. The file formats are http://sf.gds.tuwien.ac.at/00-pdf/m/mstockfl/MetaStock.pdf If any one can point me in the right direction it would be much appreciated. So far I have tried opening file rb then trying to use struct and then binascii but I am not too sure what I should be doing and fuction I should be using in binascii ? TIA Jack, What you may not realize is that Metastock is using an oddball floating point format. I have not looked at this for many years now but remember using a small VB-callable dll with functions BasicToIEEE and IEEEToBasic. This may help you in recoding conversions into Python. float BasicToIEEE (unsigned char *value) { float result; unsigned char *msbin = (unsigned char *) value; unsigned char *ieee =(unsigned char *) result; unsigned char sign = 0x00; unsigned char ieee_exp = 0x00; int i; /* MS Binary Format */ /* byte order =m3 | m2 | m1 | exponent */ /* m1 is most significant byte = sbbb| */ /* m3 is the least significant byte */ /* m = mantissa byte */ /* s = sign bit*/ /* b = bit */ sign = msbin[2] 0x80; /* 1000|b */ /* IEEE Single Precision Float Format */ /*m3m2m1 exponent */ /* | | emmm| seee| */ /* s = sign bit*/ /* e = exponent bit*/ /* m = mantissa bit*/ for (i=0; i4; i++) ieee[i] = 0; /* any msbin w/ exponent of zero = zero */ if (msbin[3] == 0) return 0; ieee[3] |= sign; /* MBF is bias 128 and IEEE is bias 127. ALSO, MBF places */ /* the decimal point before the assumed bit, while */ /* IEEE places the decimal point after the assumed bit. */ ieee_exp = msbin[3] - 2;/* actually, msbin[3]-1-128+127 */ /* the first 7 bits of the exponent in ieee[3] */ ieee[3] |= ieee_exp 1; /* the one remaining bit in first bin of ieee[2] */ ieee[2] |= ieee_exp 7; /* 0111|b : mask out the msbin sign bit */ ieee[2] |= msbin[2] 0x7f; ieee[1] = msbin[1]; ieee[0] = msbin[0]; return (result); } bool IEEEToBasic (float *value, unsigned char *result) { unsigned char *ieee = (unsigned char *) value; unsigned char *msbin= (unsigned char *) result; unsigned char sign = 0x00; unsigned char msbin_exp = 0x00; int i; /* See _fmsbintoieee() for details of formats */ sign = ieee[3] 0x80; msbin_exp |= ieee[3] 1; msbin_exp |= ieee[2] 7; /* An ieee exponent of 0xfe overflows in MBF*/ if (msbin_exp == 0xfe) return (FALSE); msbin_exp += 2; /* actually, -127 + 128 + 1 */ for (i=0; i4; i++) msbin[i] = 0; msbin[3] = msbin_exp; msbin[2] |= sign; msbin[2] |= ieee[2] 0x7f; msbin[1] = ieee[1]; msbin[0] = ieee[0]; return (TRUE); } Good luck, malv -- http://mail.python.org/mailman/listinfo/python-list
Re: UDP max datagram size
I seem to recall from UDP datagram tests between linux and XP I ran a few years ago that XP maximum datagram sizes are indeed smaller than linux. -- http://mail.python.org/mailman/listinfo/python-list
Re: Programming Tutorial for absolute beginners
Looks pretty good, except for your difficult to read examples. Don't use black backrounds with green characters. A plain white background with black text would be a major improvement. -- http://mail.python.org/mailman/listinfo/python-list
Re: Difference in Python and Ruby interactive shells
I think reload should be preceded by import. Example: Online code modification: upon modifying and saving mytest.py issue on the interactive shell: import mytest reload(mytest) The shell should respond with module 'mytest' from '/root/mytest.py' (NOT:mytest.pyc) Note that modules importing mytest should not use 'import * from mytest' but 'import mytest'; This requires qualifying all objects as mytest.obj -- http://mail.python.org/mailman/listinfo/python-list
Re: Tracking down memory leaks?
Hi Steven, Is there any way for making Python return memory no longer needed to the OS? Cases may arise where you indeed need a big memory block temporarily without being able to split it up into smaller chunks. Thank you. malv Steven D'Aprano wrote: Objects return memory to Python when they are garbage collected, but not the OS. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is python very slow compared to C
That's why Microsoft is bringing IronPython on board to have something more decent available with .NET -- http://mail.python.org/mailman/listinfo/python-list
Re: Dual Core outlook
Hi All, Thank you for your commentaries. In the meantime, I read up in Python-Dev and came across a post by Johnatan LaCour which kind of nicely sums up the state of affairs: Its really a shame. There seems to be some consensus about multi-processing, but not a whole lot of interest in making it easier out of the box. When it comes to multi-processing, batteries really _aren't_ included. Sure, you have lead dioxide and some sulphuric acid, but you have to put them together to make your battery. This isn't the end of the world, but I find it tedious, and I am sure it confuses and frustrates people new to Python. Possibly things are not much brighter for other languages. I'll keep on trying malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Accessing Windows Serial Port
Hi All, Would anybody know whether PySerial would work over an usb/serial adapter? (what about usb/parallel adapters?) Thx. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Numeric and matlab
A convincing experience is to 'translate' some substantial matlab matrix code into python. You will at once see the difference between a true programming language and matlab Further, also look at matplotlib. malv -- http://mail.python.org/mailman/listinfo/python-list
Dual Core outlook
Multiprocessing has been pushed into the field as the chip manufacturers can no longer deliver as they were used to for many years. The general public has been conditioned to believe that 1 + 1 = 2 but this is in fact not that simple. Although software manufacturers can with some effort adapt packages to exploit these dual core architectures, the same is not true for other development work were no large distribution of the application is to take place. What is the outlook for programming languages in general? Of course, multiprocessing has been used for many years but this always involved a much higher level of sophistication on the part of the designers. This point seems to be largely hidden from the public, ignorant and semi-ignorant, by the chip manufacturers. Will new languages see the light rendering the spreading of applications over many processors quasi transparent? What is the outlook for Python? Would Ironpython with .net do better? What about talk by the Java lobby that Java would be very much suited for taking advantage of dual-core? Is there any thruth to this? These are questions that many Python users like myself would like to find some answers for. One thing is clear. The old days will never come back and the processor multiplication is likely to increase. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Dual Core outlook
Thank you Xavier. Maybe this is too simplistic, but given two programs, one in Python the other in Java or C#. Would this mean that running the latter on a dual core processor would significantly increase execution speed, whereas the Python program would be running in one processor only without any speed up? Is a Java program capable of this out of the box or does this require specific additional code? malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Copying files between different linux machines
Sorry, the above link should read: http://shfs.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list
Re: Copying files between different linux machines
Best is shfs. This uses the safety of ssh and allows you to mount filesystems on an external computer locally with commands like mount umount: shfsmount shfsumount. http://shfs.sourceforge.net/ malv -- http://mail.python.org/mailman/listinfo/python-list
BUG trace realtime
How would you approach the following? In a multithreaded realtime data acquisition system (all python v2.4), after hours of running without a snag, without warning python hangs at once without leaving any error message or error traceback at all. After the incident, the OS itself (linux) appears to remain fully functional. Thank you! malv -- http://mail.python.org/mailman/listinfo/python-list
Re: BUG trace realtime
Hi Peter, Thank you for your extensive reply. In the meantime, I solved the problem. I had started out to trace the path of the randomly arriving external data through the different threaded processing stages. After one of those 'hangs', with some luck, I was able to spot the cause of the trouble: a piece of old code that wasn't supposed to be out there! Really dumb. FYI, to my surprise, Python really quit. No more CPU time, no message, nothing. I can't recall having seen this before. You are quite right about queues. I use these extensively and carefully. This kind of enabled me to trace the path of the externally triggered events without too much of a hassle. Thanks again, malv -- http://mail.python.org/mailman/listinfo/python-list
Re: BUG trace realtime
What happened in fact was that a graphics plotting function for monitoring got called twice frorm a different thread, due to an 'old' instruction inadvertently left. Due to the quasi random nature of the incoming data streams, this happened rather very sparingly. As the plotting itself involves quite a bit of code, there are probably several if not many reasons why problems could arise. It was never my intention to reenter this function and make it thread safe. Problem solved. I was indeed a surprise for me to see Python quit this way. Thanks again for your commentary. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Wingide is a beautiful application
Good idea. Try several. I did. Many of the above don't have either no gui designer or a rather poor one. eric is by far the best! http://www.die-offenbachs.de/detlev/eric3.html malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Robotics and parallel ports
Hi, Thank you for the info. The dlp usb solution looks like a terrific gadget, especially since parallel ports have almost disppeared, at least on portables. In fact, would in linux not any py software capable of dealing with a usb connection (almost) suffice? Any further comments would be much appreciated. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Visual Python, really Visual?
Look at eric3. Has the QtDesigner. In my view Qt beats anything. http://www.die-offenbachs.de/detlev/eric3.html -- http://mail.python.org/mailman/listinfo/python-list
Rpy: displaying multivariate data with pairs() and coplot()
Did anybody manage to use pairs() or coplot() from python using the rpy module? In fact any information going a bit beyond Tim Churches' very useful examples on plot() usage in rpy would be highly welcome. Thx. malv -- http://mail.python.org/mailman/listinfo/python-list
Rpy: displaying multivariate data with pairs() and coplot()
Did anybody manage to use pairs() or coplot() from python using the rpy module? In fact any information going a bit beyond Tim Churches' very useful examples on plot() usage in rpy would be highly welcome. Thx. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: pygene - genetic algorithms package
Thank you kindly, Erik. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Calculating Elapsed Time
Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. says the doc. Can anything be said about precision if indeed your system returns figures after the decimal point? Thx. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Favorite flavor of Linux? (for python or anything else)
Where did I suggest that [distros should] come with nearly everything installed? This is utterly ridiculous. Common sense could helped you with that one. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: pygene - genetic algorithms package
How is your package different from a nn package? Is this an addon for genetic programming or does it include the standard nn components as well, such as backprop etc? Not being very familiar with genetic programming, forgive me my naive question, I could not immediately find the answer. Thank you, malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Installing Eric?
Kenneth McDonald wrote: I'm wondering if anyone has experience/tips to offer on installing Eric on OS X and XP. Installation on both seems to require a number of steps, some of them seeming potentially fragile, and I'm wondering if I'm looking at a job of perhaps hours (days?), or if everyone manages in just a few minutes. Thanks, Ken Basic reference: http://www.die-offenbachs.de/detlev/eric3.html. Install of course Python-2.4.1: http://python.org/ftp/python/2.4.1/python-2.4.1.msi You need to install Qt, Sip, QScintilla and PyQt. For linux things are easy. Install KDE (along with gnome if you want) and everything will be there ready for eric3 installation. On Windows, you need to somehow get Qt. Besides a commercial license or an educational license (check with university) there exist 2 possibilitees for Qt free: (1) Qt4 free but I'm not sure about the status of the announced PyQt; and (2) Qt3 GPL. PyQt has everything you need for these possibilities, except for the GPL. For the free GPL download: http://www.quadgames.com/download/pythonqt/PyQtGPL10.exe. This will give you everything at once: Qt 3.3.4 (derived from http://kde-cygwin.sourceforge.net/) Sip 4.1.1 QScintilla 1.62 PyQt 3.13 After this get http://prdownloads.sourceforge.net/eric-ide/eric-3.8.0.tar.gz?download Unpack into a directory under your python2.4 directory. Then issue 'python install.py' and you should be ready to go (eric will set itself up under site-packages) malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Eclipse best/good or bad IDE for Python?
As bicycle repair man integration keeps popping up as a distinct feature of jave-based PyDev, let it be known that other IDE's also have this. For example, non-java Eric has had bicycle repair man integration for a very long time. Personally, in spite of intense programming in python, I've never encountered a real need for the bicycle gimmick. -- http://mail.python.org/mailman/listinfo/python-list
Re: Favorite flavor of Linux? (for python or anything else)
Any popular distro would. No one is really superior from this angle. You will always find that you will from time to time have to download software and/or versions that didn't come with your distro. This is mostly no problem, especially not with python related software. -- http://mail.python.org/mailman/listinfo/python-list
Re: Eclipse best/good or bad IDE for Python?
It would not be misplaced in a python forum to draw your attention to Bruce A. Tate's book: Beyond Java, publ O'Reilly Sep. 2005, ISBN 0-596-10094-9. Bruce explains why: ... Java is abandoning its base, and conditions are ripe for an alternative to emerge. Personally, I have never felt any need in Python to have to fall back on Java tools in order to program in a more efficient manner. The less clutter, the better! malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Installing Eric?
Thanks Scott. I missed that doing cut paste. -- http://mail.python.org/mailman/listinfo/python-list
Re: Favorite flavor of Linux? (for python or anything else)
It depends what you are looking for in Python. Many new features have been introduced in Python2.4 It would seem that you don't have any use for these. As I am still relatively young in Python, I am very eager to keep up. If you would have followed the posts on this board over last year or so, you should have been informed about this. Python2.3 didn't become worthless. It simply can't do what Python2.4 can. -- http://mail.python.org/mailman/listinfo/python-list
Re: Eclipse best/good or bad IDE for Python?
This is probably a fair answer. My experience: Two years ago I started with Boa till I discovered eric. I have been with eric ever since. Eric uses Qt as GUI. I think both Qt and wx enable you to do pretty much the same thing. I like the work F.Lundh did on Tkinter, but every time I try, I get bogged down in the tcl mess that it builds on. Take the example of the indispensible datagrid: a piece of cake in both Qt and wxWidgets, a nightmare otherwise. Since a couple of weeks I made the tour of wing-ide, komodo and PyDev. PyDev appears really to be a top heavy kludge. Perhaps OK for java lovers but very laborious to set up and work with, this in spite of the abundant hype spam on this board. Wing-ide's debugger stops on imagined errors where eric and komodo do allright. I could not get the designer to run on komodo. So I'm back at eric. On eric you use the superb Qt designer. If you run linux, you get Qt and PyQt with KDE. You can keep on running gnome if you want. For windows, Qt4 is supposed to be free. Further, very extensive and attractive extensions exist: qwt and qwt3d for graphics. This is my experience. If I find better, I'll change. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Favorite flavor of Linux? (for python or anything else)
I have been around quite a bit. The best are Gentoo and Debian. However, Python being very much an essential component of your distro, not having Python2.4 as standard kind of eliminates Debian. Running two versions in parallel is not the way to go. Gentoo requires quite a bit of work though. As I have to support several architectures, I looked around at Novell Suse and Ubuntu. Especially if you want flawless notebooks on linux, these two seemed best to me. I kind of discarded Ububtu because of the incompatibility between the compiler coming with the latest version and the kernel. You discover this quickly when trying to compile some kernel modules. Ubuntu is quite nice if your technical demands don't require much. If you're in python, you may one day run into some problem with addons. So Suse is what I use right now. Besides their YAST they now feature Synaptic. Overall, as nice as Ubuntu, somewhat easier with linux system work. I often wonder though whether I should not go back to Gentoo after all. More work, but you never seem to run into problems like with Suse or Ubuntu. Gentoo also has a very nice community always willing to help. Documentation is also very nice at Gentoo. Novell is kind of a mess. FWIW, that's my honest opinion. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Favorite flavor of Linux? (for python or anything else)
Being a fan of linux and python and granting money doesn't make your OS better or worse. I believe that shipping a linux with a compiler DIFFERENT from the one that was used to build the kernel is not very bright. It may never bother some users, but few software developpers will like this idea. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Favorite flavor of Linux? (for python or anything else)
In theory, this would do. I have tried this several times in the past and found it very impractical to have to live with two Python versions on the same system, given that Python, like also Perl, is used by so many components. I may have done many things wrong but experience taught me to better simplify things and live with one python version only. It mainly depends on the (huge amount of) time you can afford to straighten out avoidable problems. I must say that since python 2.3 and 2.4 I never tried dual setups anymore. Indeed, Debian would be my preferred distro if it weren't for python 2.3. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: something wrong in wx
Sorry to be of no help and to raise another question. How did you manage to get fann going under python? I can install fann 1.2.0 allright but something doesn't go with the python setup. (I run Python 2.4.1 under linux 2.6.13) When trying to run a small example in python I always get error messages about missing definitions in _libfann. I have read about supposed disultils problems and workarounds, but I didn't manage yet. Thank you for any suggestion, malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Computer Language Shootout
Hi bearophileH, Thank you for the code example. Could you post some more information about ShedSkink? malv -- http://mail.python.org/mailman/listinfo/python-list
Re: exception KeyboardInterrupt and os.system command
Indeed, I did the experiment again with while 1: y = os.system(sleep 1) print y and it ALWAYS returns 0, with control-c or without. From past experience, I am pretty sure that in other cases I have been getting non-zero return values. So I would hesitate to believe that what you observe is due to something within your application package. Maybe as Don Cave suggests, one should try spawnv although it seems to be more complicated to use it with sleep 1. -- http://mail.python.org/mailman/listinfo/python-list
Re: exception KeyboardInterrupt and os.system command
That's also kind of what I expected. However, I quickly tried: import os while 1: y = os.system(sleep 1) z = (y 8) 0xFF print z I never get anything in return but 0, hitting c-C or not. I have uset the above code to get exit code returns in the past though. Would there be anything special with sleep? Regards, malv -- http://mail.python.org/mailman/listinfo/python-list
Tablelist-tcl-tk-tile
Wanting to explore tk under python, I must say that it seems to be very difficult to find the required information in one single place. I would like to give tk a try but as I need as a test something equivalent of the Qt datagrid, I don't seem manage yet to get the latest releases of tablelist, tcl, tk and tile going. Did anybody manage to make the recent releases work in Python 2.4? I manged to do some things with tablelist v4.2 but with the 8.4 versions of tcl/tk. However, for future work including tile, it would seem wise to start out from 8.5. In order to make tcl8.5, tk8.5 go, I suppose the 8.4 versions have to be removed. Do I have to remove and recompile python 2.4 as well? Is there any compact writup on how to get going without having to delve into the inner workings and wrapping of tcl? Thx. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: How to get started in GUI Programming?
I suggest you take a look at Qt3, much superior to Tkinter or PyGtk. With Python, you have to use PyQt bindings. [EMAIL PROTECTED] wrote: I am trying to learn GUI programming in Python, but have to confess I am finding it difficult. I am not an experienced programmer - just someone who from time to time writes small programs for my use. Over the years I have moved from GWBASIC to QBASIC to Visual Basic, and now trying to move across to a Linux platform. Python seems to be the best compromise between the limitations of command line basic programming and the total incomprehensibility of C. Googling around it seems the best GUI is either Tkinter or PyGtk. I found a book which recommended PyGtk, as it had a graphical design option, Glade. Coming from a VB background I latched onto that and bought the book (Beginning Python, Wrox), but it was a disappointment (or more accurately a complete waste of money) - there was insufficient detail in the text. I've found the tutorial and reference manual on the PyGtk web site, but although I've made some progress, I keep reaching points where I have insufficient background to understand them. Currently I'm stuck on dialog boxes (the code seems immensely complex for the equivalent of MsgBox(Do you really want to do this ,vbYesNo) and I haven't got it to work properly yet) and loading graphical images in anything other than their original size, but every new step brings another struggle I've seen reference to a Tkinter book - something like 'Python and Tkinter Programming' but it seems to be out of print and unavailable. Can anyone offer any suggestions as to the least painful way forwards? (Email address was valid once but has long since been abandoned to spam. Please rely via newsgroup) -- http://mail.python.org/mailman/listinfo/python-list
Re: Using Which Version of Linux
[EMAIL PROTECTED] wrote: ok, i m going to use Linux for my Python Programs, mainly because i need to see what will these fork() and exec() do. So, can anyone tell me which flavour of linux i should use, some say that Debian is more programmer friendly, or shold i use fedora, or Solaris. Because these three are the only ones i know of that are popular and free. -- * Posted with NewsLeecher v3.0 Beta 7 * http://www.newsleecher.com/?usenet You have to look out for the version of Python the distro comes with 2.4. Some don't and it may be nasty having to deal with different versions installed next to one another. (You will probably not be able to safely remove the original version as the distro uses it for many things.) Another point to watch for is things like Python bindings and easyness of gui (free) installation. FWIW, I like Suse10.0 (Novell). It has kde-Python bindings to Qt installed. It also has eric3 available. So without any additional cost or trouble, you'll have a powerful, dream developer's system. malv -- http://mail.python.org/mailman/listinfo/python-list
Re: searching python/gui developper in germany
Hans Georg Krauthaeuser wrote: Dear all, for the measurements in our labs we have developed python scripts that are pretty fine for our needs. Basically, we have classes and call the appropriate methods from the command line (or by other scripts). So, we don't have any GUI. Now, an external customer want to use our software and -- as you can imagine -- we want a pretty GUI. So, we are looking for someone who can develop such a pretty GUI for us (of course for money). OS is Windows (XP). We are not fixed to a special toolkit -- it just should look nice and do the job. Best would be someone from our region (Magdeburg, Germany). If someone is interested: contact me by email, please. Best regards Hans Georg Krauthaeuser http://www.die-offenbachs.de/detlev/eric3.html If you run SuSE9.3 or SuSE 10.0, everything is there. Simply install eric or eric3. There is also a great gui design utility in the installation. You'll be going in no time. malv -- http://mail.python.org/mailman/listinfo/python-list
How to program efficient pattern searches in a list of float numbers?
Simple case: In this list, how to find all occurences of intervals of n adjacent indexes having at least one list-member with a value between given limits. Visualizing the list as a two-dimensional curve, this is like horizontally dragging a given rectangle over the curve and finding the x coordinates where the curve passes through the rectangle.(Define such a x-index coordinate as the left corner of the rectangle.) More complicated case: Given a pair of rectangles spaced relatively to each other in a fixed manner. Drag this rectangle pair horizontally over the above two-dimensional curve and list the indexes of the occurences where the curve passes simultaneously through both rectangles. (Define such a x-index coordinate as the leftmost corner of the rectangle pair). These problems can be solved by programming a naive search advancing index by index. It seems obvious that due to the localized properties searched for, much more efficient searches should be possible. After having found the occurence-indexes for one particular rectangle set, how to find the pattern occurences after changing one or more rectangle parameters? -- http://mail.python.org/mailman/listinfo/python-list
Re: some advice about Python GUI apps
Hi Kris, I used several GUI's, also wx. You should look at eric3, it's by far the best of all. http://www.die-offenbachs.de/detlev/eric3.html Eric3 uses Qt. Qt is also great with C++. I ported a major Python project from Windows to Linux under Python-Qt and encountered no problem whatsoever. I use eric3 with Novell/SuSE Pro 9.3. All you need is already there. Good luck, malv -- http://mail.python.org/mailman/listinfo/python-list
Re: Installation question
I can't give you an exact answer, but maybe this helps a bit: I tried running both Python 2.3 and 2.4 (both 32) with Qt3 on two other distros. It never really worked and gave me lots of problems. It certainly messed up a few things here and there. I never managed to get things straightened out. I later installed Suse 9.3 Pro with both Gnome KDE. When installing the eric3 IDE, I found that everything I needed, Python 2.4, Qt3.3, PyQt, Sip, QScintilla was there already. (If I recall, I had only to add in one or two development libraries for Qt). -- http://mail.python.org/mailman/listinfo/python-list
Re: Online Modification of Python Code
Your algoreload() is of the hand of a master. I'll give it a try. Thank you Bengt! -- http://mail.python.org/mailman/listinfo/python-list
Re: Online Modification of Python Code
I wrote a module testalgo.py with some functions to be modified. After modification I typed to the interactive shell: import testalgo reload(testalgo) ... and things seem to workout as you suggested. At least I modified some quickie print statements to check. I use eric3 and nothing in this IDE seems to interfere with the process. I hadn't thought about doing it this way. (I have in fact an extensive driver/command infrastructure in place) I seem to recall a post by Diez Roggish that reload() doesn't always work as it should. Any news on this? At least im my preliminary test it works. Thank you Dennis! -- http://mail.python.org/mailman/listinfo/python-list
Re: Online Modification of Python Code
Hi Robert: (1) Things are not that simple. In fact in setting up a run, extensive database backup is already involved. Subsequently, data structures are built at runtime of typically 0.5Gbytes. Although saving this should work, it would require quite some debug/verification to check out the validity. Many data structures intervene. Dennis' suggestion worked fine so I'm happy to be able to leave everything else 'untouched'. (2) As to your VB question. I have been 'forced' to do a lot of VB related to M$ Access db work. VB is 100% integrated in M$'s Visual IDE and allows you to change 'on the fly' almost anything in the code, even in the midst of a debug breakpoint stop. This is very, very handy. It would be a very valuable addition to Python, though it's not very clear to me how this could be implemented without a specific IDE. (Don't switch to VB for this though. Python is much cooler). -- http://mail.python.org/mailman/listinfo/python-list
Re: Online Modification of Python Code
Diez, You are quite right on using module.name when importing module objects. This happened to be the way I ran my initial successful tests. Later I modified things by using 'import * from algotest' and my modifications stopped from coming through. In my case reload comes in very handy. I can see your point about testscripts in software development. However this particular project is in a stage where code writing became now somewhat insignificant relative to mathematical algorithm development and simultion. Very quick turnaroud is of prime importance. A testscript wouldn't test anything without going through a complete setup cycle involving several stage chains. So online localized modification comes in very handy (of course you could always goof up in syntax in a modifying a statement - too bad!) Diez, thank you very much! -- http://mail.python.org/mailman/listinfo/python-list
Re: Considering moving from PowerBuilder to Python
Norm Goertzen wrote: I've posted a previous question about IDEs and got some good feedback, thanks, but it does seem that everyone has their own favourite IDE -- in other words, no IDE was repeatedly recommended. So, is there any data on the popularity of IDEs (most users), or is there a chart comparing the most popular versions. I'M NOT AFRAID TO SPEND SOME MONEY TO GET THE RIGHT IDE (but I don't want to change products once I've chosen). Also, can I use Sybase's SQL Anywhere with Python? I'm really only interested in programming for Windows XP. But I also really would like to find something very close to Sybase's patented datawindow technology -- it's a real time-saver. Finally, is there any (realistic) way to mix PowerBuilder and Python? For instance write a Python shell that calls PowerBuilder methods (or vice versa). Thanks again, Norm Hi Norm, I was kind of in your situation wherby I had to do a lot of python programming under XP. This was in a major porting project to linux. Although you have a choice of IDE's, a good one is very important. I finally settled for eric3. This one is Qt based making use of PyQt bindings (also SIP and Qscintilla). You have to realize that all IDE's practically bind you to one framework or another. I must say that being first rather gnome based, Qt turned out to be a superb environment, both under XP as under linux. In fact going from one to the other was absolutely effortless. You still will have to buy a Qt3 license for windows. A Qt4 free version is now available for windows, but I don't think that PyQt is ready for it. As of late, I installed eric3 on linux Suse 9.3 and was happily surprised to find out that I didn't have to bother with installing Qt, PyQt, etc. It was all there. Qt3 also turned out to be great with C/C++, which I'm not really using much, I admit. They also have an SQL module, includinc Sybase drivers. I have been using MySQL without Qt support using MySQLdb. -- http://mail.python.org/mailman/listinfo/python-list