Python vs. C++11

2012-02-12 Thread sturlamolden
There are bigsimilarities between Python and the new C++ standard. Now we can actually use our experience as Python programmers to write fantastic C++ :-) Here is a small list of similarities to consider: Iterate over any container, like Python's for loop: for (type& item: container) Pointer

Re: Python vs. C++11

2012-02-12 Thread sturlamolden
On Feb 13, 4:21 am, sturlamolden wrote: > There are bigsimilarities between Python and the new C++ standard. Now > we can actually use our experience as Python programmers to write > fantastic C++ :-) And of course the keyword 'auto', which means automatic type

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 02:43, Adam Tauno Williams wrote: > >Because RAD tools are for GUI toolkits, not for languages. If you're > >using GTK, Glade works fine. Same with QT and QTDesigner. If you're > >using WPF with IronPython, t > > These [Glade, etc...] are *NOT* RAD tools.  They are GUI designers.  A > R

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 00:50, Ivan Kljaic wrote: > Ok Guys. I know that most of us have been expiriencing the need for a > nice Gui builder tool for RAD and most of us have been googling for it > a lot of times. But seriously. Why is the not even one single RAD tool > for Python. I mean what happened to boa c

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 14:39, Ben Finney wrote: > The Unix model is: a collection of general-purpose, customisable tools, > with clear standard interfaces that work together well, and are easily > replaceable without losing the benefit of all the others. This is opposed to the "Windows model" of a one-click

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 16:10, Thorsten Kampe wrote: > And as soon as developers start developing for Unix customers (say > Komodo, for instance), they start following the "Windows model" - as you > call it. You are probably aware that Unix and Unix customers have been around since the 1970s. I would expect

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 20:28, Ivan Kljaic wrote: > To summarize it. It would be very helpfull for python to spread if > there qould be one single good rad gui builder similar to vs or > netbeAns but for python. So right now if i need to make a gui app i > need to work with an applicatio that is dicontinued f

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 21:58, sturlamolden wrote: > That's eight. Sorry, nine ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 20:28, Ivan Kljaic wrote: > The ony worthly ones mentioning as an gui builder are boa constructor > fo wx, qtDesigner with the famous licence problems why companies do > not want to work with it, sharpdevelop for ironpython and netbeans for > jython. There is wxFormBuilder for wxPytho

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 21:58, sturlamolden wrote: > http://wxformbuilder.org/ This Demo is using C++, it works the same with Python (wxPython code is generated similarly). http://zamestnanci.fai.utb.cz/~bliznak/screencast/wxfbtut1/wxFBTut1_controller.swf Sturla -- http://mail.python.org/mail

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 11 Jul, 22:35, Kevin Walzer wrote: > One reason there hasn't been much demand for a GUI builder is that, in > many cases, it's just as simpler or simpler to code a GUI by hand. Often a GUI builder is used as a bad replacement for sketch-pad and pencil. With layout managers (cf. wxWidgets, Qt

Re: perceptron feed forward neural networks in python

2011-07-11 Thread sturlamolden
On 11 Jul, 20:47, Ken Watford wrote: > On Mon, Jul 11, 2011 at 2:31 PM, Igor Begić wrote: > > Hi, > > I,m new to Python and i want to study and write programs about perceptron > > feed forward neural networks in python. Does anyone have a good book or link > > for this? > > Try Stephen Marsland's

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 12 Jul, 01:33, Dave Cook wrote: > I prefer spec-generators (almost all generate XML these days) like > QtDesigner to code-generators like Boa. I've only seen one good > argument for code generation, and that's to generate code for a layout > to "see how it's done". But code could always be ge

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread sturlamolden
On 12 Jul, 01:33, Dave Cook wrote: > I prefer spec-generators (almost all generate XML these days) like > QtDesigner to code-generators like Boa. I've only seen one good > argument for code generation, and that's to generate code for a layout > to "see how it's done".  But code could always be ge

Re: Python bug? Indexing to matrices

2011-07-12 Thread sturlamolden
On 12 Jul, 07:39, David wrote: > Should the following line work for defining a matrix with zeros? > > c= [[0]*col]*row No. The rows will be aliased. This will work: c = [[0]*col for i in range(row)] Note that Python lists are not ment to be used as matrices. We have NumPy or the array module f

Re: Python bug? Indexing to matrices

2011-07-12 Thread sturlamolden
On 12 Jul, 14:59, sturlamolden wrote: >    ma = np.matrix(a) >    mb = np.matrix(b) >    a*b ma*mb Sorry for the typo. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to write a file generator

2011-07-12 Thread sturlamolden
On 12 Jul, 16:46, Billy Mays wrote: > I know the problem lies with the StopIteration, but I'm not sure how to > tell the caller that there are no more lines for now. Try 'yield None' instead of 'raise StopIteration'. Sturla -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the difference between PyPy and Python? are there lot of differences?

2011-07-13 Thread sturlamolden
On 13 Jul, 16:06, ArrC wrote: > And they also talked about the lack of type check in python. > > So, how does it help (strongly typed) in debugging? Python is strongly typed. There are no static type checks in Python. Type checks are done at runtime. Dynamic typing does not mean that Python is

Re: subprocess & isql

2011-07-15 Thread sturlamolden
On 15 Jul, 04:47, "peterff66" wrote: > I am working on a project that retrieves data from remote Sybase. I have to > use isql and subprocess to do this. Is the following correct? > I once had to hammer a nail, but I had to use a screw driver. Didn't work. > Did anybody do similar work before?

I am fed up with Python GUI toolkits...

2011-07-19 Thread sturlamolden
What is wrong with them: 1. Designed for other languages, particularly C++, tcl and Java. 2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python has a standard library!) 3. Unpythonic memory management: Python references to deleted C++ objects (PyQt). Manual dialog destruction (w

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 11:59, Thomas Jollans wrote: > I wonder - what do you think of GTK+? PyGTK with GLADE is the easier to use, but a bit awkward looking on Windows and Mac. (Not to mention the number of dependencies that must be installed, inclusing a GTK runtime.) > Really, while Swing and Tkinter are

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 11:59, Thomas Jollans wrote: > Okay, I haven't used SWT yet: manual memory management? Java is GC! > > It is perfectly reasonable to be required to manually call some sort of > destroy() method to tell the toolkit what you no longer want the user to > see: firstly, you have the display

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 16:17, Mel wrote: > OTOH, if you intend to re-use the Dialog object, it's not a memory leak. It cannot be reused if you don't have any references pointing to it. Sure it is nice to have dialogs that can be hidden and re-displayed, but only those that can be accessed again. tp_dealloc

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 13:04, Adam Tauno Williams wrote: > > 3. Instances of extension types can clean themselves up on > > deallocation. No parent-child ownership model to mess things up. No > > manual clean-up. Python does all the reference counting we need. > > NEVER GOING TO HAPPEN.  UI's don't work that

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 13:08, Tim Chase wrote: > http://xkcd.com/927/ > > :-) Indeed. -- http://mail.python.org/mailman/listinfo/python-list

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 17:21, Thomas Jollans wrote: > Don't know about Mac, I was under the impression that GTK was fine on > Windows these days. GTK looks awful on Windows, requires a dozen of installers (non of which comes from a single source), is not properly stabile (nobody cares?), and does not work o

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 06:28, Steven D'Aprano wrote: > Have you tried Tkinter version 8.0 or better, which offers a native look and > feel? Python 2.7.2 |EPD 7.1-1 (64-bit)| (default, Jul 3 2011, 15:34:33) [MSC v.1500 64 bit (AMD64)] on win32 Type "packages", "demo" or "enthought" for more information. >>>

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 22:58, Phlip wrote: > Tkinter sucks because it looks like an enfeebled Motif 1980s dawn-of- > GUIs scratchy window with grooves and lines everywhere. The widget set is limited compared to GTK or Qt, though it has the most common GUI controls, and it does not look that bad with the rec

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 20 Jul, 22:58, Phlip wrote: > Tkinter sucks because it looks like an enfeebled Motif 1980s dawn-of- > GUIs scratchy window with grooves and lines everywhere. And using it with OpenGL has been impossible since Python 2.2 (or whatever). -- http://mail.python.org/mailman/listinfo/python-list

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread sturlamolden
On 21 Jul, 00:52, Phlip wrote: > Oh, and you can TDD it, too... No, I can't TDD with Tkinter. All my tests fail when there is no OpenGL support (Togl is gone). For TDD to work, the tests must have a chance of passing. -- http://mail.python.org/mailman/listinfo/python-list

Re: I am fed up with Python GUI toolkits...

2011-07-22 Thread sturlamolden
On 22 Jul, 02:34, Gregory Ewing wrote: > I think that's a bit of an exaggeration -- there's only > one major dependency on each platform, and it's a very > widely used one (currently PyObjC/PyGTK/PyWin32). And > I'm thinking about ways to reduce the dependencies further, Pyrex or Cython? -- ht

Re: I am fed up with Python GUI toolkits...

2011-07-22 Thread sturlamolden
On 21 Jul, 16:52, Kevin Walzer wrote: > I bet that other scripting languages would > piggyback on top of it (Lua or Ruby bindings for Python's GUI toolkit, > anyone?) because doing that is less work than writing your own toolkit > from scratch. No doubt about that. Lua has a nice GUI toolkit by

Re: Complex sort on big files

2011-08-05 Thread sturlamolden
On Aug 1, 5:33 pm, aliman wrote: > I understand that sorts are stable, so I could just repeat the whole > sort process once for each key in turn, but that would involve going > to and from disk once for each step in the sort, and I'm wondering if > there is a better way. I would consider using m

Re: Complex sort on big files

2011-08-06 Thread sturlamolden
On Aug 1, 5:33 pm, aliman wrote: > I've read the recipe at [1] and understand that the way to sort a > large file is to break it into chunks, sort each chunk and write > sorted chunks to disk, then use heapq.merge to combine the chunks as > you read them. Or just memory map the file (mmap.mmap)

Re: Extending dict (dict's) to allow for multidimensional dictionary

2011-03-07 Thread sturlamolden
On 7 Mar, 09:30, Chris Rebert wrote: > You see a tree, I see a database > (http://docs.python.org/library/sqlite3.html): > > +--+-+-+---+ > | Manufacturer | Model   | MPG | Price | > +--+-+-+---+ > | Ford         | Taurus  | ... | $...  | >

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread sturlamolden
On 5 apr, 02:05, Robert Kern wrote: > PicklingError: Can't pickle 'multiprocessing.sharedctypes.c_double_Array_10'>: attribute lookup > multiprocessing.sharedctypes.c_double_Array_10 failed Hehe :D That is why programmers should not mess with code they don't understand! Gaël and I wrote shmem

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread sturlamolden
On 4 apr, 22:20, John Ladasky wrote: > https://bitbucket.org/cleemesser/numpy-sharedmem/src/3fa526d11578/shm... > > I've added a few lines to this code which allows subclassing the > shared memory array, which I need (because my neural net objects are > more than just the array, they also contain

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread sturlamolden
On 8 apr, 02:03, sturlamolden wrote: > http://folk.uio.no/sturlamo/python/sharedmem-feb13-2009.zip > Known issues/bugs: 64-bit support is lacking, and os._exit in > multiprocessing causes a memory leak on Linux. I should probably fix it for 64-bit now. Just recompiliong with 64-bit

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread sturlamolden
On 8 apr, 02:38, sturlamolden wrote: > I should probably fix it for 64-bit now. Just recompiliong with 64-bit > integers will not work, because I intentionally hardcoded the higher > 32 bits to 0. That was easy, 64-bit support for Windows is done :-) Now I'll just have to fix

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-09 Thread sturlamolden
On 9 apr, 09:36, John Ladasky wrote: > Thanks for finding my discussion!  Yes, it's about passing numpy > arrays to multiple processors.  I'll accomplish that any way that I > can. My preferred ways of doing this are: 1. Most cases for parallel processing are covered by libraries, even for neur

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread sturlamolden
On 9 apr, 22:18, John Ladasky wrote: > So, there are limited advantages to trying to parallelize the > evaluation of ONE cascade network's weights against ONE input vector. > However, evaluating several copies of one cascade network's output, > against several different test inputs simultaneously

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread sturlamolden
On 10 apr, 18:27, John Nagle wrote: >     Unless you have a performance problem, don't bother with shared > memory. > >     If you have a performance problem, Python is probably the wrong > tool for the job anyway. Then why does Python have a multiprocessing module? In my opinion, if Python has

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread sturlamolden
On 8 apr, 03:10, sturlamolden wrote: > That was easy, 64-bit support for Windows is done :-) > > Now I'll just have to fix the Linux code, and figure out what to do > with os._exit preventing clean-up on exit... :-( Now it feel dumb, it's not worse than monkey patching os

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-11 Thread sturlamolden
On 11 apr, 09:21, John Nagle wrote: >      Because nobody can fix the Global Interpreter Lock problem in CPython. > >      The multiprocessing module is a hack to get around the fact > that Python threads don't run concurrently, and thus, threaded > programs don't effectively use multi-core CPUs.

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-11 Thread sturlamolden
On 11 apr, 21:11, sturlamolden wrote: > import numpy as np > import sharedmem as sm > private_array = np.zeros((10,10)) > shared_array  = sm.zeros((10,10)) I am also using this to implement synchronization primitives (barrier, lock, semaphore, event) that can be sent over an

Re: Free software versus software idea patents (was: Python benefits over Cobra)

2011-04-12 Thread sturlamolden
On 7 apr, 09:39, Steven D'Aprano wrote: > It's astonishing how anti-Mono FUD just won't die. (Something can be > true, and still FUD. "Oh no, people might *choke* on a peanut, or have an > allergic reaction, we must label every piece of food May Contain Nuts > just in case, because you never know

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 15, 6:33 pm, Chris H wrote: > 1. Are you sure you want to use python because threading is not good due > to the Global Lock (GIL)?  Is this really an issue for multi-threaded > web services as seems to be indicated by the articles from a Google > search?  If not, how do you avoid this issu

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 16, 4:59 am, David Cournapeau wrote: > My experience is that if you are CPU bound, asynchronous programming > in python can be  more a curse than a blessing, mostly because the > need to insert "scheduling points" at the right points to avoid > blocking and because profiling becomes that m

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 17, 12:10 am, Michael Torrie wrote: > Many GUI toolkits are single-threaded.  And in fact with GTK and MFC you > can't (or shouldn't) call GUI calls from a thread other than the main > GUI thread. Most of them (if not all?) have a single GUI thread, and a mechanism by which to synchronize

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 15, 6:33 pm, Chris H wrote: > 1. Are you sure you want to use python because threading is not good due > to the Global Lock (GIL)?  Is this really an issue for multi-threaded > web services as seems to be indicated by the articles from a Google > search?  If not, how do you avoid this issu

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 17, 5:15 pm, Ian wrote: > > 5) Even in CPython, I/O-bound processes are not slowed significantly > > by the GIL.  It's really CPU-bound processes that are. > > Its ONLY when you have two or more CPU bound threads that you may have > issues. And when you have a CPU bound thread, it's time

Re: An unusual question...

2011-04-17 Thread sturlamolden
On Apr 17, 2:15 pm, wrote: > I can also find out where it is EXACTLY just as > easily so this is not my problem. > > The problem is calling it! You'll need to mmap or valloc a page-alligned memory buffer (for which the size must be a multiple of the system page size), and call mprotect to make i

Re: An unusual question...

2011-04-17 Thread sturlamolden
On Apr 17, 7:25 pm, Chris Angelico wrote: > It sounds to me like you're trying to pull off a classic buffer > overrun and remote code execution exploit, in someone else's Python > program. And all I have to say is Good luck to you. He might. But this also has reputable use, such as implement

Re: About threads in python

2011-04-22 Thread sturlamolden
On Apr 21, 3:19 pm, dutche wrote: > My question is about the efficiency of threads in python, does anybody > has something to share? Never mind all the FUD about the GIL. Most of it is ill-informed and plain wrong. The GIL prevents you from doing one thing, which is parallel compute-bound code

Re: Vectors

2011-04-22 Thread sturlamolden
On Apr 20, 9:47 am, Algis Kabaila wrote: > Are there any modules for vector algebra (three dimensional > vectors, vector addition, subtraction, multiplication [scalar > and vector]. Could you give me a reference to such module? NumPy Or one of these libraries (ctypes or Cython): BLAS (Intel MK

Re: Vectors

2011-04-22 Thread sturlamolden
On Apr 23, 2:32 am, Algis Kabaila wrote: > Thanks for that.  Last time I looked at numpy (for Python3) it > was available in source only.  I know, real men do compile, but > I am an old man...  I will compile if it is unavoidable, but in > case of numpy it does not seem  a simple matter. Am I bad

Re: Vectors

2011-04-23 Thread sturlamolden
On Apr 23, 2:26 pm, Algis Kabaila wrote: > I do understand that many people prefer Win32 and > appreciate their right to use what they want.  I just am at a > loss to understand *why* ... For the same reason some people prefered OS/2 or DEC to SunOS or BSD. For the same reason some people prefe

Re: What other languages use the same data model as Python?

2011-05-04 Thread sturlamolden
On May 3, 3:50 pm, Hrvoje Niksic wrote: > I would say that, considering currently most popular languages and > platforms, Python's data model is in the majority.  It is only the > people coming from a C++ background that tend to be confused by it. In C++, one will ususally put class variables (o

Re: What other languages use the same data model as Python?

2011-05-04 Thread sturlamolden
On May 3, 6:33 pm, Mel wrote: > def identify_call (a_list): > a_list[0] = "If you can see this, you don't have call-by-value" > a_list = ["If you can see this, you have call-by-reference"] The first one is a mistake. If it were pass-by-value, it would assign the string to a list unseen by t

Re: What other languages use the same data model as Python?

2011-05-04 Thread sturlamolden
On May 4, 5:40 pm, Michael Torrie wrote: > Which is exactly what the code showed.  The first one isn't a mistake. > You just read it wrong. No, I read "call-by-value" but it does not make a copy. Call-by-value dictates a deep copy or copy-on-write. Python does neither. Python pass a handle to th

Re: Hooking into Python's memory management

2011-05-04 Thread sturlamolden
On May 4, 6:51 pm, Daniel Neilson wrote: >   In either case, if such a module is possible, any pointers you could > provide regarding how to implement such a module would be appreciated. The gc module will hook into the garbage collector. The del statement will remove an object from the curren

Re: What other languages use the same data model as Python?

2011-05-04 Thread sturlamolden
On May 4, 7:15 pm, Benjamin Kaplan wrote: > You missed a word in the sentence. > > "If you can see this, you DON'T have call-by-value" Indeed I did, sorry! Then we agree :) Sturla -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 26 Mai, 18:31, Raymond Hettinger wrote: > I just posted a tutorial and how-to guide for making effective use of > super(). > > One of the reviewers, David Beazley, said, "Wow,  that's really > great!    I see this becoming the definitive post on the subject" > > The direct link is: > >  http://

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 16:27, sturlamolden wrote: > Assuming that 'self' will always be named > 'self' in my code, I tend to patch __builtins__.super like this: > > import sys > def super(): >     self = sys._getframe().f_back.f_locals['self'] >     re

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 17:05, Duncan Booth wrote: > >>> class C(B): pass > >>> C().foo() > > ... infinite recursion follows ... That's true :( -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 17:05, Duncan Booth wrote: > Oops. There's a reason why Python 2 requires you to be explicit about > the class; you simply cannot work it out automatically at run time. > Python 3 fixes this by working it out at compile time, but for Python 2 > there is no way around it. Then it shoul

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 23:49, Stefan Behnel wrote: > I think Sturla is referring to the "compile time" bit. CPython cannot know > that the builtin super() will be called at runtime, even if it sees a > "super()" function call. Yes. And opposite: CPython cannot know that builtin super() is not called, even i

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 18:06, Steven D'Aprano wrote: > Why? The fault is not that super is a function, or that you monkey- > patched it, or that you used a private function to do that monkey- > patching. The fault was that you made a common, but silly, mistake when > reasoning about type(self) inside a class

Re: Data Plotting Library Dislin 10.2

2011-11-18 Thread sturlamolden
On 18 Nov, 22:16, Tony the Tiger wrote: > Ya, but apparently no source unless you dig deep into your pockets. > Really, why would we need this when we already have gnuplot? > Just wondering... Dislin is a very nice plotting library for scientific data, particularly for scientists and engineers u

Re: Threads vs Processes

2006-07-28 Thread sturlamolden
Chance Ginger wrote: > Not quite that simple. In most modern OS's today there is something > called COW - copy on write. What happens is when you fork a process > it will make an identical copy. Whenever the forked process does > write will it make a copy of the memory. So it isn't quite as bad.

Re: switching to numpy and failing, a user story

2006-10-06 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Given the quality of python's (free) documentation and how good it's > been for a very long time, it's bit ironic to be using the phrase > "normal open-source documentation" on this mailing list. Numeric > python, which numpy aspires to be a replacement for, has perfect

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-21 Thread sturlamolden
Christophe wrote: > Nobody mentionned it, but I think you should try PyQT and PyGTK before > wxPython. Myself, I do not like wx : it looks too much like the MFC. > > PyGTK is good, but GTK doesn't work that well on windows. GTK and PyGTK works well on Windows now. GTK used to be unstable on Wind

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-21 Thread sturlamolden
Kevin Walzer wrote: > I'm a Mac developer--Gtk does not run natively on the Mac (i.e. as an > Aqua framework), only under X11. So that's a non-starter for me. GTK is skinnable and can look a lot like Aqua. Qt is also just pretending to be a native Aqua toolkit (or used to), but it is very good a

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-21 Thread sturlamolden
Wektor wrote: > wx has also graphical editors like Glade (there is a wxGlade project) > giving a xml description of a window and its cross platform. If you are thinking about XRC, then beware that this XML don't solve any problems, it just creates another. XRC and libglade do not compare. libgla

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-21 Thread sturlamolden
Wektor wrote: > wx has also graphical editors like Glade (there is a wxGlade project) > giving a xml description of a window and its cross platform. If you are thinking about XRC, then beware that this XML don't solve any problems, it just creates another. XRC and libglade do not compare. libgla

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-21 Thread sturlamolden
[EMAIL PROTECTED] wrote: > pygtk can be a pain to install and some of the librarys that are built > on top of it have copyrights and such. apple for the fonts and there > is one for the images. It also can be a pain to install.. It would be > nice to see it as a low cost comercial package that

Re: A Comparison Of Dynamic and Static Languiges

2006-10-21 Thread sturlamolden
[EMAIL PROTECTED] wrote: > c#: mono 1.1.13.7 > perl: perl 5.8.8 > python: python 2.4.2 > ruby: ruby 1.8.4 And why would any of this tell you anything about static versus dynamic languages? The languages you list are all dependent on different runtimes, and your results will simply reflect that.

Re: A Comparison Of Dynamic and Static Languiges

2006-10-21 Thread sturlamolden
Gerrit Holl wrote: > This newsgroup is mirrored by a mailing-list, so many people use their real > address. The solution to spam is spamfiltering (spambayes), not hiding ones > address on the internet. The answer to spam here in Norway is incredibly simple. It seems that all spam originates in t

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-22 Thread sturlamolden
Wektor wrote: > I ment in the GUI context , a widget-based api where you can put > buttons, labels etc. on a form. You mean GTK? GTK 2.8 uses an abstraction layer for drawing widgets called "Cairo". Cairo can use OpenGL or Quartz as backends (still experimental). Thus, you can get a hardware-ac

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Anyone ever done this? It looks like Python2.4 won't take a length arg http://docs.python.org/lib/module-mmap.html It seems that Python does take a length argument, but not an offset argument (unlike the Windows' CreateFileMapping/MapViewOfFile and UNIX' mmap), so you

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
Martin v. Löwis wrote: > What architecture are you on? On a 32-bit architecture, it's likely > impossible to map in 2GiB, anyway (since it likely won't fit into the > available address space). Indeed. But why does Python's memory mapping need to be flushed? And why doesn't Python's mmap take an

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Hi > Anyone ever done this? It looks like Python2.4 won't take a length arg > > 2 Gig since its not seen as an int. Lookin at Python's source (mmapmodule.c), it seems that "mmap.mmap" always sets the offset argument in Windows MapViewOfFile and UNIX to 0. This means tha

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Hi > Anyone ever done this? It looks like Python2.4 won't take a length arg > > 2 Gig since its not seen as an int. Looking at Python's source (mmapmodule.c), it seems that "mmap.mmap" always sets the offset argument in Windows MapViewOfFile and UNIX to 0. This means th

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Hi > Anyone ever done this? It looks like Python2.4 won't take a length arg > > 2 Gig since its not seen as an int. Looking at Python's source (mmapmodule.c), it seems that "mmap.mmap" always sets the offset argument in Windows' MapViewOfFile and UNIX' mmap to 0. This m

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread sturlamolden
Fredrik Lundh wrote: > > to large to fit in a 32 address space. Thus, mmapmodule.c needs to be > > fixed before it can be used for large files. > > if you've gotten that far, maybe you could come up with a patch, instead > of stating that someone else "needs to fix it" ? I did not say "someone e

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread sturlamolden
Martin v. Löwis wrote: > You know this isn't true in general. It is true for a 32-bit address > space only. Yes, but there are two other aspects: 1. Many of us use 32-bit architectures. The one who wrote the module should have considered why UNIX' mmap and Windows' MapViewOfFile takes an offset

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread sturlamolden
Donn Cave wrote: > Wow, you're sure a wizard! Most people would need to look before > making statements like that. I know, but your news-server doesn't honour cancel messages. :) Python's mmap does indeed memory map the file into the process image. It does not fake memory mapping by means of fi

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread sturlamolden
Martin v. Löwis wrote: Your news server doesn't honour cancel as well... > It doesn't need to, why do you think it does? This was an extremely stupid question on my side. It needs to be flushed after a write because that's how the memory pages mapping the file is synchronized with the file. Wri

Python's CRT licensing on Windows

2006-10-25 Thread sturlamolden
On Windows, the standard Python 2.4 distro is compiled with Microsoft Visual C++ 2003 and is shipped with msvcr71.dll as a part of the binary installer. That is ok, as those who has a license for Microsoft Visual C++ 2003 is allowed to redistribute msvcr71.dll. Without a license for Microsoft Visu

Re: Python's CRT licensing on Windows <-- FUD

2006-10-25 Thread sturlamolden
Fredrik Lundh wrote: I am not intentionally posting FUD. >"As long as you're using a standard Python build, you don't need to >buy VC7 to [legally redistribute the C runtime]. The python.org team >use a properly licensed VC7 to build Python, which turns Python into >"licensee sof

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread sturlamolden
Robin Becker wrote: > > > ULONG CalcTableChecksum(ULONG *Table, ULONG Length) > > { > > ULONG Sum = 0L; > > ULONG *Endptr = Table+((Length+3) & ~3) / sizeof(ULONG); > > > > while (Table < EndPtr) > > Sum += *Table++; > > return Sum; > > } Is this what you want? import numpy def CalcTableChec

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread sturlamolden
Robin Becker wrote: > > ULONG CalcTableChecksum(ULONG *Table, ULONG Length) > > { > > ULONG Sum = 0L; > > ULONG *Endptr = Table+((Length+3) & ~3) / sizeof(ULONG); > > > > while (Table < EndPtr) > > Sum += *Table++; > > return Sum; > > } Is this what you want? import numpy def CalcTableCheck

Re: Python's CRT licensing on Windows <-- FUD

2006-10-25 Thread sturlamolden
Martin v. Löwis wrote: > As Fredrik Lundh says: Ask your lawyer. We cannot really interpret the > Microsoft license for you (I can only give it to you in case you don't > have it), and I can't formally give you permission to do copy something > that Microsoft has the copyright to. I wasn't askin

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread sturlamolden
Robin Becker wrote: > it's probably wonderful, but I don't think I can ask people to add numpy to > the > list of requirements for reportlab :) Maybe NumPy makes it into the core Python tree one day. At some point other Python users than die-hard scientists and mathematicans will realise that f

Re: NumPy 1.0 release

2006-10-27 Thread sturlamolden
Travis E. Oliphant wrote: > We are very pleased to announce the release of NumPy 1.0 available for > download at http://www.numpy.org Congratulations to you and the other NumPy developers for completing this major undertaking. I would also like to express my sincere gratitude for making this mak

Re: RAW network programming under Windows

2006-11-05 Thread sturlamolden
billie wrote: > RAW network programming under Windows it's not always possible because > of the security limitations that microsoft introduced in the latest > Windows versions and that affects WinSocket API. > On UNIX systems I'm able to freely send raw packets (for example I'm > able to compile

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-08 Thread sturlamolden
robert wrote: > I'd like to use multiple CPU cores for selected time consuming Python > computations (incl. numpy/scipy) in a frictionless manner. Threading is not the best way to exploit multiprocessors in this context. Threads are not the preferred way of exploiting multiple processors in scie

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-08 Thread sturlamolden
sturlamolden wrote: > 3. One often uses cluster architectures (e.g. Beowulf) instead of SMPs > for scientific computing. MPI works on SMP and clusters. Threads only > work on SMPs. Following up on my previous post, there is a simple Python MPI wrapper that can be used to exploit

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-08 Thread sturlamolden
sturlamolden wrote: > http://www-unix.mcs.anl.gov/mpi/mpich1/mpich-nt/ One should probably use this instead: http://www-unix.mcs.anl.gov/mpi/mpich2/index.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Python deployment options.

2006-11-08 Thread sturlamolden
Fuzzyman wrote: > I think that is an incorrect reading of the thread. > > The *Python* developers need a valid Visual Studio license to > redistribute msvcr71.dll. > > When you build an app with py2exe you are just bundling Python with > your application and so don't need the license. Here is a

  1   2   3   4   5   6   7   8   >