Re: How can I create a linked list in Python?

2007-01-16 Thread sturlamolden
Bruno Desthuilliers wrote: > Implementing linked lists in Python is not a great deal - it just > doesn't make much sens. It does make sence, as there are memory constraints related to it. Python lists are arrays under the hood. This is deliberately. Dynamic arrays grows faster than lists for the

Re: How can I create a linked list in Python?

2007-01-17 Thread sturlamolden
Bruno Desthuilliers wrote: > Have you considered using tuples ? If you go the FP way, why not use an > immutable type ? Well, good question. Tuples are immutable, which means they are immutable. So you cannot use a cursor to change an element inside the list. So instead of changing the original

Re: How can I create a linked list in Python?

2007-01-18 Thread sturlamolden
Paul Rubin wrote: > But that's what Lisp does too. Ok, I may have to reread Paul Graham's book on ANSI Common Lisp then. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to mimik a main() function to start a program with entry point?

2007-01-19 Thread sturlamolden
krishnakant Mane wrote: > I have a set of modules in my package and out if which one is my > actual starting point to my entire program. say for example I have an > entire database application ready and I want a main (as in java or c) > to initiate the program and may be bring up a login screen

A solution to the MSVCRT vs MSVCR71 problem?

2007-01-20 Thread sturlamolden
This question has been asked many times, and last time I was accused of spreading FUD. So now I will rather propose a solution. The reason for the problem is as follows: The binary installer for Python built by te python.org team is compiled with Microsoft Visual Studio 2003. It is linked with t

Re: A solution to the MSVCRT vs MSVCR71 problem?

2007-01-21 Thread sturlamolden
Gabriel Genellina wrote: > This would only work, if runtime dll's were compatibles between them, > and they are not. It is standard C, defined by ANSI and ISO. -- http://mail.python.org/mailman/listinfo/python-list

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread sturlamolden
On Jan 29, 4:08 pm, Paul Rubin wrote: > "Szabolcs Nagy" <[EMAIL PROTECTED]> writes: > > file('/dev/urandom').read(6).encode('base64') > > (oneliner and without import sa op requested)Nice, though Un*x dependent > > (os.urandom is supposed to be portable). Is os.urando

Re: multithreading concept

2007-02-07 Thread sturlamolden
On Feb 7, 2:53 am, "S.Mohideen" <[EMAIL PROTECTED]> wrote: > Python is praised about - me too. But at one instance it fails. It fails to > behave as a true multi-threaded application. That means utilizing all the > CPUs parallely in the SMP efficiently stays as a dream for a Python > Programmer.

Re: multithreading concept

2007-02-07 Thread sturlamolden
On Feb 7, 6:17 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Multithread compute-bound programs on multiple CPUs are > how you get heavy number-crunching work done on multiprocessors. In the scientific community, heavy CPU-bound tasks are either parallelized using MPI and/or written in Fortran

Re: multithreading concept

2007-02-07 Thread sturlamolden
On Feb 7, 8:03 pm, Sergei Organov <[EMAIL PROTECTED]> wrote: > I fail to see how threads in general could perform worse than > processes. I do understand that processes are inherently more > safe/secure, but when it comes to speed I really can't imagine why it > could happen that threads perform w

Re: Does the world need another v0.1 python compiler?

2007-02-08 Thread sturlamolden
On Feb 8, 8:03 am, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: > This code generation for an arbitrary backend sounds more like an > appropriate task for PyPy. I think Grant's or anyone elses compiler > could be a viable tool for augmenting the CPython interpreter in > particular in the presence of

Re: Does the world need another v0.1 python compiler?

2007-02-08 Thread sturlamolden
On Feb 8, 7:02 pm, [EMAIL PROTECTED] wrote: > At the moment I think this approach can't improve much the speed of > Python programs compared to what Psyco is already able to do. Pyrex generates code that competes with hand-written C. It is as close to statically typed Python as it gets. http://w

Re: multithreading concept

2007-02-09 Thread sturlamolden
On Feb 9, 4:00 pm, "S.Mohideen" <[EMAIL PROTECTED]> wrote: > I am sorry if I sound foolish. > Suppose I split my Net application code using parallel python into several > processes based upon the number of CPU available. That means a single socket > descriptor is distributed across all processes.

Re: Help Required for Choosing Programming Language

2007-02-19 Thread sturlamolden
On Feb 17, 1:34 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > - designing the GUI will cost me about 2 .. 3 times as much in Python Use a design tool like GLADE for PyGTK, wxGlade for wxPython or Komodo for tkinter. The more of the GUI code you can remove from your functional code the better. GUI

Re: Help Required for Choosing Programming Language

2007-02-19 Thread sturlamolden
On Feb 16, 11:12 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > "GUI based programming languages" ? What's that ? LabView -- http://mail.python.org/mailman/listinfo/python-list

Re: Choices: scipy, matplot ...

2007-02-19 Thread sturlamolden
On Feb 19, 11:34 am, "dug" <[EMAIL PROTECTED]> wrote: > I would like to do some real time signal processing with a graphical > display and I would like your advice as to what I should use. I would > like to be able to view the results and to change parameters of some > signal processing in 'real

Re: export an array of floats to python

2007-02-22 Thread sturlamolden
On Feb 22, 5:40 pm, Peter Wuertz <[EMAIL PROTECTED]> wrote: > I'm writing a C module for python, that accesses a special usb camera. > This module is supposed to provide python with data (alot of data). Then > SciPy is used to fit the data. > > My question is, how to make python read from a C arra

Re: export an array of floats to python

2007-02-22 Thread sturlamolden
On Feb 22, 7:36 pm, "sturlamolden" <[EMAIL PROTECTED]> wrote: > npy_int dim = {480, 640}; /* whatever the size of your data, in C- > order */ oops... npy_int dim[] = {480, 640}; -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Required for Choosing Programming Language

2007-02-26 Thread sturlamolden
On Feb 24, 7:04 pm, Thomas Bartkus <[EMAIL PROTECTED]> wrote: > Most user apps. require 95% of coding effort to provide a usable user > interface and 5% effort on the algorithmic meat. The "afterwards" you > allude to. So why do we still endure so much programming effort on the > unimportant part

Re: pyopengl vs directpython

2007-02-28 Thread sturlamolden
On Feb 28, 2:59 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > OpenGL is platform-agnostic. If you ever want to reach people on linux or > macs, use that. > > Beyond that I've got no idea which is technically superior - but John > Carmack seems to favor OpenGL :) To ask which is better, Open

Re: Creating Installer or Executable in Python

2007-11-14 Thread sturlamolden
On 14 Nov, 16:17, DanielJohnson <[EMAIL PROTECTED]> wrote: > Thanks for telling about py2exe. Also note that you should build an MSI installer e.g. using InnoSetup after applying py2exe. You could skip the py2exe part and only use InnoSetup to create an MSI. Most likely your client will not care

Re: Using python as primary language

2007-11-14 Thread sturlamolden
On 13 Nov, 22:39, [EMAIL PROTECTED] wrote: > The wxPython user's group mentions charting quite a bit. I think they > use matplotlib among others. You might contact them for suggestions as > well. Indeed, use NumPy/SciPy and matplotlib if you are using Python for numerical computing and data visua

Re: Using python as primary language

2007-11-14 Thread sturlamolden
On 14 Nov, 01:07, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > I'm not sure if you mean both above "compared to Java" - but I won't > call Swing/AWT "good" - eclipse doesn't come with SWT for nothing. Swing vs. SWT is a matter of taste and religion. The main complaint against Swing was how it

Re: Using python as primary language

2007-11-14 Thread sturlamolden
On 8 Nov, 08:52, Michel Albert <[EMAIL PROTECTED]> wrote: > In our company we are looking for one language to be used as default > language. So far Python looks like a good choice (slacking behind > Java). A few requirements that the language should be able cope with > are: > > * Database access

Re: Any idea how to open Matlab and run M-files by using Python?

2007-12-03 Thread sturlamolden
On 3 Des, 05:02, itcecsa <[EMAIL PROTECTED]> wrote: > I am implementing a small Python project, what I am going to do is to > open Matlab and run some M-files, and get some output from Matlab > command prompt. > > I have no idea how to open Matlab from Python! Do you really want to do that? NumPy

Re: Python Profiler GUI like Matlab?

2007-12-06 Thread sturlamolden
On 7 Des, 02:58, Davy <[EMAIL PROTECTED]> wrote: > Is there any Python Profiler GUI like Matlab? I found the Matlab > Profiler is very intuitive and easy to use. There is a Python profiler. But is does not have a GUI. -- http://mail.python.org/mailman/listinfo/python-list

Re: Capturing global input?

2007-12-06 Thread sturlamolden
On 6 Des, 22:51, nomihn0 <[EMAIL PROTECTED]> wrote: > I'd like to accept mouse gestures and keyboard shortcuts as input to a > program. It depends on which GUI toolkit you use. Look in the wxPython, PyGTK, tkinter or pygame documentation. > The nature of this program requires that these command

Re: Can I embed Windows Python in C# or VC++?

2007-12-07 Thread sturlamolden
On 7 Des, 08:07, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > Does it mean, I can embed Python in C# as well with the same APIs? > > No; you can use the Python API in a native C++ application (the Python > code is plain C, but all the include files have the 'extern "C" {}' > declarations). F

Re: Securely distributing python source code as an application?

2007-12-07 Thread sturlamolden
On 7 Des, 23:37, xkenneth <[EMAIL PROTECTED]> wrote: > I'll shortly be distributing a number of python applications that > use proprietary. The software is part of a much larger system and it > will need to be distributed securely. How can i achieve this? If you provide the application as a

Re: Securely distributing python source code as an application?

2007-12-07 Thread sturlamolden
So for example one could: 1. Put all the compiled Python bytecode in an encrypted binary file. 2. Build a small binary executable (.exe file) that: 2a. Reads the binary file. 2b. Decrypts it to conventional Python byte code. 2c. Embeds a Python interpreter. 2d. Executes the byte

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 9 Des, 22:14, "Jack" <[EMAIL PROTECTED]> wrote: > I understand that the standard Python distribution is considered > the C-Python. Howerver, the current C-Python is really a combination > of C and Python implementation. There are about 2000 Python files > included in the Windows version of Pyth

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 9 Des, 23:34, Christian Heimes <[EMAIL PROTECTED]> wrote: > Nevertheless it is just one algorithm that beats Python in an area that > is well known to be slow. Python's numbers are several factors slower > than C code because the overhead of the dynamic language throws lots of > data out of the

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 10 Des, 23:54, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Or a lack of time and money. Lisp is one of the older programming > languages around, and at a time had BigBucks(tm) invested on it to try > and make it practically usable. Yes. But strangely enough, the two Lisp implementations t

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 10 Des, 23:49, [EMAIL PROTECTED] (Aahz) wrote: > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare (often misattributed to Knuth, who was himself quoting > Hoare) Oh, I was Hoare? Thanks. Anyway, it doesn't change the argument that optimizing in wrong places is

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 9 Des, 23:34, Christian Heimes <[EMAIL PROTECTED]> wrote: > >http://antoniocangiano.com/2007/11/28/holy-shmoly-ruby-19-smokes-pyth... > > The Ruby developers are allowed to be proud. They were able to optimize > some aspects of the implementation to get one algorithm about 14 times > faster. Th

Re: GUI development with 3D view

2007-12-10 Thread sturlamolden
On 10 Des, 13:33, Achim Domma <[EMAIL PROTECTED]> wrote: > I'm looking for quite some time now for a gui library for python, > which allows me to display 3D graphics. Main OS is windows, Mac OS X > and Linux would be nice to have. I want to use python 2.5. My first > try was wx + pyOpenGL but ther

Re: Best way to protect my new commercial software.

2007-12-10 Thread sturlamolden
On 10 Des, 08:15, farsheed <[EMAIL PROTECTED]> wrote: > I wrote a software and I want to protect it so can not be cracked > easily. I wrote it in python and compile it using py2exe. what is the > best way in your opinion? I wrote this in another thread, 1. Put all the compiled Python bytecode in

Re: Any way to program custom syntax to python prompt? >> I want to edit matrices.

2007-12-10 Thread sturlamolden
On 11 Des, 01:54, mosi <[EMAIL PROTECTED]> wrote: > Python matrices are usually defined with numpy scipy array or similar. > e.g.>>> matrix1 = [[1, 2], [3, 4], [5, 6]] That is a list of Python lists, not a NumPy array or matrix. > For example:>>> matrix + 2 > > [ 3, 4; > 5, 6; > 7, 8;] > >

Re: Is a "real" C-Python possible?

2007-12-11 Thread sturlamolden
On 11 Des, 10:10, Duncan Booth <[EMAIL PROTECTED]> wrote: > @memoize(3) > def fib(n): >if n == 0 or n == 1: > return n >else: > return fib(n-1) + fib(n-2) The thing I would do is: def fibo(n): while 1: try: return fibo.seq[n] except AttributeE

Re: Is a "real" C-Python possible?

2007-12-11 Thread sturlamolden
On 11 Des, 20:25, John Nagle <[EMAIL PROTECTED]> wrote: > Shed Skin effort. Its author writes "Am I the only one seeing the potential > of an implicitly statically typed Python-like-language that runs at > practically the same speed as C++?" Don't forget about Pyrex and PyPy's RPython. By the wa

Re: Is a "real" C-Python possible?

2007-12-11 Thread sturlamolden
On 12 Des, 04:45, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > Python 3 will have optional 'type' annotations, where 'type' includes > abstract base classes defined by the interface (methods). So parameters > could be annotated as a Number or Sequence, for instance, which is more > useful often tha

Re: Is a "real" C-Python possible?

2007-12-12 Thread sturlamolden
On 12 Des, 12:56, George Sakkis <[EMAIL PROTECTED]> wrote: > Ah, the 'make' statement.. I liked (and still do) that PEP, I think it > would have an impact comparable to the decorator syntax sugar, if not > more. I think it is one step closer to Lisp. I believe that it would be worth considering a

Re: Is a "real" C-Python possible?

2007-12-12 Thread sturlamolden
On 12 Des, 17:44, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: > Programmable syntax is a very powerful concept. You don't have to use the programmable syntax just because it's there. But I do realize it would be a misfeature if it is abused. Two points: * Programmable syntax would make it eas

Re: Is a "real" C-Python possible?

2007-12-12 Thread sturlamolden
On 12 Des, 17:00, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > Python has not become what it is, and achieved the success it has, > because a bunch of people really wanted to use Lisp but didn't think > other people could handle it. > > The goal of these sorts of discussions should be to make Pytho

Re: Is Python really a scripting language?

2007-12-13 Thread sturlamolden
On 13 Des, 02:19, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I have repeatedly argued in the past that we do ourselves a disservice by > describing Python as an interpreted language. Python is compiled. It has > a compiler. It even has a built-in function "compile". Python is

Re: Is a "real" C-Python possible?

2007-12-13 Thread sturlamolden
On 13 Des, 19:16, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > I don't feel that it's especially inconsistent, and I like decorators. > Having to write foo everywhere isn't that nice, but it's only mildly > worse than C# to me - I find the extra block levels really atrocious. Personally I find pro

Re: Best way to protect my new commercial software.

2007-12-14 Thread sturlamolden
On 14 Des, 11:42, Wolfgang Draxinger <[EMAIL PROTECTED]> wrote: > > I will not make reverse engineering impossible, but it will be > > extremely difficult. > > No. It's just a matter of reading the decrypted bytecode from > memory. Ok, let med rephrase that: It may not be difficult to you. But th

Re: Is Python really a scripting language?

2007-12-14 Thread sturlamolden
On 15 Des, 02:59, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > oowriter --print some.doc | ps2pdf > encapsulate, encapsulate. Unfortunately, apps using inter-app > communication tend to do the opposite. That pipe is a form of IPC as well. -- http://mail.python.org/mailma

More than one interpreter per process?

2007-12-17 Thread sturlamolden
Python has a GIL that impairs scalability on computers with more than one processor. The problem seems to be that there is only one GIL per process. Solutions to removing the GIL has always stranded on the need for 'fine grained locking' on reference counts. I believe there is a second way, which h

Re: More than one interpreter per process?

2007-12-18 Thread sturlamolden
On 18 Des, 05:46, Michael L Torrie <[EMAIL PROTECTED]> wrote: > How would this handle python resources that a programmer would want to > share among the threads? What facilities for IPC between the > interpreters would be used? There would be no IPC as they would live in the same process. A thre

Re: More than one interpreter per process?

2007-12-18 Thread sturlamolden
On 18 Des, 10:24, Roger Binns <[EMAIL PROTECTED]> wrote: > The biggest stumbling block is what to do when the external environment > makes a new thread and then eventually calls back into Python. It is > hard to know which interpretter that callback should go to. Not if you explicitely hav to pa

Re: More than one interpreter per process?

2007-12-18 Thread sturlamolden
On 18 Des, 10:24, Roger Binns <[EMAIL PROTECTED]> wrote: > You can. Have a look at mod_python and mod_wsgi which does exactly > this. But extension modules that use the simplified GIL api don't work > with them (well, if at all). mod_python implements use Py_NewInterpreter() to create sub- inte

Re: More than one interpreter per process?

2007-12-20 Thread sturlamolden
On 19 Des, 08:02, Christian Heimes <[EMAIL PROTECTED]> wrote: > No, you can't. Sub-interpreters share a single GIL and other state. Why > don't you run multiple processes? It's on of the oldest and best working > ways use the full potential of your system. Lot's of Unix servers like > postfix, qma

Re: Is there *any* real documentation to PyWin32?

2007-12-21 Thread sturlamolden
On 21 Des, 21:07, Gilles Ganault <[EMAIL PROTECTED]> wrote: > Like others have mentionned, apparently the only book available is > this: > > www.oreilly.com/catalog/pythonwin32/chapter/ch12.html PyWin32 follows the Windows API quite pedantically, except for GUI where it wraps MFC. If you can rea

Re: 3D plotting with python 2.5 on win32

2007-12-21 Thread sturlamolden
On 19 Des, 15:15, anton <[EMAIL PROTECTED]> wrote: > Package/Lib to do 3D plotting out of the box. > > I know matplotlib. If you are going to do 3D plotting of data, the tool to use is VTK. It is the de facto standard for 3D scientific/technical visualization, regardless of programming language.

Re: 3D plotting with python 2.5 on win32

2007-12-21 Thread sturlamolden
On 22 Des, 03:19, sturlamolden <[EMAIL PROTECTED]> wrote: > If you are going to do 3D plotting of data, the tool to use is VTK. It > is the de facto standard for 3D scientific/technical visualization, > regardless of programming language. VTK has Python bindings, but you >

Re: Hooking things up in GUI application

2006-04-25 Thread sturlamolden
Ryan Ginstrom wrote: > Apropos recent threads about GUI editors, coming from a Win32/WTL C++ > background, I actually like the idea of being able to (easily) create GUIs > programmatically. > > But I still see a lot of the same tedium: hooking up events to handlers, and > getting data into and ou

Re: MinGW and Python

2006-04-25 Thread sturlamolden
Martin v. Löwis wrote: > - there is no build process available to do that In MSYS: $ ./configure --prefix=/c/mingw $ make $ make install This should be obvious to any with Unix experience. MinGW actually distribute precompiled Python binaries as well (in MSYS-DTK). > - people building extens

Re: MinGW and Python

2006-04-25 Thread sturlamolden
Robert Kern wrote: > - gcc does not optimize particularly well. That is beyond BS. The more recent gcc releases optimize as well as any commercial compiler. GCC 4 may even optimize better than MSVC. GCC is the compiler used to build the Linux kernel and MacOSX. If it can deal with this I say it

Re: MinGW and Python

2006-04-25 Thread sturlamolden
Robert Kern wrote: > Dunno. Depends on the machine. Depends on the program. Depends on how the > interpreter and any extension modules and underlying libraries were built. > Depends on which Linux and which Windows. > > I'm sorry, but your question is a non sequitur. I don't understand its > rel

Re: MinGW and Python

2006-04-25 Thread sturlamolden
I forgot to mention that C libraries built with Visual C++ and MinGW are binary compatible. MinGW can link libararies and object files from Visual C++. Although Python may be build with Visual C++, you can still compile and link your C extensions with MinGW. -- http://mail.python.org/mailman/lis

Re: Hooking things up in GUI application

2006-04-25 Thread sturlamolden
Ryan Ginstrom wrote: > > Behalf Of sturlamolden > > If you use PyGTK (it also runs on Windows), you can design > > the GUI with > > GLADE and then use libglade to import the gui as an xml-resource. > > Yes, I've tried something similar with wxGlade. Nice, but i

Re: Hooking things up in GUI application

2006-04-25 Thread sturlamolden
Ryan Ginstrom wrote: > Yes, I've tried something similar with wxGlade. But GLADE is not wxGlade :-) wxGlade is a GUI designer for wxWidgets and wxPython. It looks a bit like GLADE on the surface, but does not share any code with GLADE. GLADE is a GUI designer for GTK, gtkmm, Mono, GNOME and Py

Re: How do I open a mysql database with python

2006-04-25 Thread sturlamolden
http://sourceforge.net/projects/mysql-python -- http://mail.python.org/mailman/listinfo/python-list

Re: Hooking things up in GUI application

2006-04-25 Thread sturlamolden
Ryan Ginstrom wrote: > But I don't want to argue this point, just state that this isn't the problem > I want to solve. I really liked the idea of KVO/KVC in Cocoa that James > Stroud mentioned. That is what I am after, or something like that. If there > isn't anything like that, I think that it m

Re: MinGW and Python

2006-04-25 Thread sturlamolden
Edward Elliott wrote: > if so, i do see good reason to build with mingw instead of gcc/cygwin. MinGW and Cygwin GCC is actually the same compiler. On Cygwin you can remove the dependency on the cygwin dll by compiling with -mno-cygwin. But as long as the cygwin dll is there, it creates an overhe

Re: MinGW and Python

2006-04-25 Thread sturlamolden
Edward Elliott wrote: > Couldn't you compile the msvc-python code under gcc/mingw? Yes I could, but I cannot compile the code under msvc for comparison. I only have MinGW. If build the mingw binary then someone else has to build the msvc binary for comparison. Then we could do pybenches on the s

Re: MinGW and Python

2006-04-25 Thread sturlamolden
Edward Elliott wrote: > Sorry, I didn't mean you personally, I meant "you" in the general sense. OK :-) I've just tried to build Python 2.4.3 with MinGW (MSYS 1.0.10, GCC 3.4.2): $ ./configure --prefix=/c/Python243-mingw $ make The build then failed on posixmodule.c. Sturla Molden ./Modul

Re: MinGW and Python

2006-04-25 Thread sturlamolden
Martin v. Löwis wrote: > Please believe me: there is currently no build process that > gives the same results as the build process used. It might > be fairly easy to create one, but none exists as of today. I tried to build with MinGW this eveing and it failed. I believe you We need to make a bu

Re: MinGW and Python

2006-04-25 Thread sturlamolden
Look what I just found: http://jove.prohosting.com/iwave/ipython/pyMinGW.html A build process for python 2.4.2 (i.e. not the latest) for MinGW. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex installation on windows XP: step-by-step guide

2006-04-26 Thread sturlamolden
Julien Fiore wrote: > > # step A.3 # > Install Mingw, the gcc compiler for Windows, available at > http://www.mingw.org/download.shtml. (we downloaded the file > MinGW-5.0.2.exe and installed only the "base tool" (this includes > mingw-runtime 3.9, w32api-3.6, binutils 2.15.91 and gcc-core 3.4.2).

Re: MinGW and Python

2006-04-27 Thread sturlamolden
Martin v. Löwis wrote: > That's not how I read it. To me, it says: it can be used by other > parts of Windows itself (i.e. system-level components), but it is not > intended to be used by third-party applications (such as Python), > as these are not system-level components. That is correct. And

Re: MinGW and Python

2006-04-27 Thread sturlamolden
Martin v. Löwis wrote: > > Nonetheless, Cygwin applications are not generally considered native > > Win32 applications because of the dependency on CYGWIN1.DLL and the > > related environment. > - Is winword.exe not a native Win32 library because it uses "MSO.DLL"? > - A cygwin application does

Re: MinGW and Python

2006-04-27 Thread sturlamolden
Martin v. Löwis wrote: > > Nonetheless, Cygwin applications are not generally considered native > > Win32 applications because of the dependency on CYGWIN1.DLL and the > > related environment. > - Is winword.exe not a native Win32 library because it uses "MSO.DLL"? > - A cygwin application does

Re: MinGW and Python

2006-04-27 Thread sturlamolden
Martin v. Löwis wrote: > > Nonetheless, Cygwin applications are not generally considered native > > Win32 applications because of the dependency on CYGWIN1.DLL and the > > related environment. > - Is winword.exe not a native Win32 library because it uses "MSO.DLL"? > - A cygwin application does

Re: Pyrex installation on windows XP: step-by-step guide

2006-04-27 Thread sturlamolden
Julien Fiore wrote: > Thanks for your remark, Sturlamolden. > > Is there a free version of the "Visual C++ 2003" compiler available on > the web? I have found "Visual C++ 2005 Express edition" > (http://msdn.microsoft.com/vstudio/express/visualc/). According

Re: finding IP address of computer

2006-04-27 Thread sturlamolden
print '127.0.0.1' :-P -- http://mail.python.org/mailman/listinfo/python-list

Re: MS VC++ Toolkit 2003, where?

2006-04-27 Thread sturlamolden
I believe MinGW can link .lib C libraries files from Visual Studio. But there are no .a for Python24.dll as far as I can tell. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex installation on windows XP: step-by-step guide

2006-04-27 Thread sturlamolden
sturlamolden wrote: > I don't think this is safe. MinGW links with msvcrt.dll whereas the > main Python distribution links with msvcr71.dll (due to Visual C++ > 2003). In order to make minGW link with msvcr71.dll, edit the text file c:\mingw\lib\gcc\mingw32\3.2.4\specs and ch

Re: MS VC++ Toolkit 2003, where?

2006-04-27 Thread sturlamolden
Alex Martelli wrote: > Provides the core msvcrt.lib for msvcr71.dll against which to link > your extensions. This is critically important, as without it you are > going to wind up linking against the wrong run-time and will see crashes > whenever a core object such as a file is shared acro

Re: MinGW and Python

2006-04-27 Thread sturlamolden
I seem to vaguely remember that MinGW was going to get its own CRT. And unless it does, MinGW is a defect compiler for legal resons. It cannot be legally used. Microsoft has designated the CRT that MinGW links a system file, against which no application should link. Insted they have asked that a C

Re: MinGW and Python

2006-04-28 Thread sturlamolden
Ames Andreas wrote: > 1) psychological issues: 'convenient IDE', 'better debugger' I prefer Eclipse when using MinGW. That IDE is on par with Visual Studio. And Python will be developed for GCC anyway. > 2) legal issues: redistribution of msvcrXX That is indeed the problem. msvcrXX cannot be

Re: MinGW and Python

2006-04-28 Thread sturlamolden
Ross Ridge wrote: > You'd have to point people who don't already have it to Microsoft's > download site. Is there a download site? I have not been able to localise one. > I think that having current versions of Python also linked MSVCRT.DLL, > whether compiled with MinGW or MSVC 6, 7 or 8, coul

Re: MinGW and Python

2006-04-28 Thread sturlamolden
Ross Ridge wrote: > Links where you can download them were posted in the thread you started > on the MinGW C/C++ forum. AFAIK the links were for various versions of the "VS 2005 redistributable". It does not contain msvcr71.dll, instead it has msvcr80.dll. I don't think there is a download for

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-26 Thread sturlamolden
Gonzalo Monzón wrote: > I use Python 2.4.3 (msvcrt71) and I succesfully installed the last > version of binutils, pyrex and MinGW, some weeks ago, using Julien Fiore > step-by-step guide, so "my" MinGW is linking with msvcrt71.dll, with the > default configuration. A successful build (compile an

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-26 Thread sturlamolden
Gonzalo Monzón wrote: > Does this happen if you're releasing, i.e. a built exe with py2exe, > where you supply the right crt? or if you do supply the right crt on the > application folder? ... It does not matter which crt you "supply". The dynamic linker will attempt to load the crt specified by

Re: Python too slow?

2008-01-11 Thread sturlamolden
On 9 Jan, 20:11, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Is there a better way to do color tracking, or is Python just too slow > as an interpreted language to do any effective color tracking? You should code numerically intensive tasks using NumPy arrays. If things are getting slow, ch

Re: Python too slow?

2008-01-11 Thread sturlamolden
On 10 Jan, 03:10, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > You are correct that optimizing Python is hard. However, in many cases, > the problem is not that Python is too slow, but the specific algorithm > chosen by the programmer is slow, e.g. no compiler optimization is going > to turn an O(

Re: Python too slow?

2008-01-11 Thread sturlamolden
On 9 Jan, 20:11, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Is there a better way to do color tracking, or is Python just too slow > as an interpreted language to do any effective color tracking? The slowness stems from the use of k-means clustering on each frame. SciPy's clustering module

Re: How to create graphs an embed them in GUI?

2008-01-17 Thread sturlamolden
On 17 Jan, 16:08, Heiko Niedermeyer wrote: > My problem is, that I want to add graph (simple, line connected X,Y- > scatter plots) and if possible the 3D representation of atoms in a > molecule (-> coloured spheres in space). > I think it would take me years to program those by myself, so I would

Re: Loop in a loop?

2008-01-17 Thread sturlamolden
On 17 Jan, 14:38, Sacred Heart <[EMAIL PROTECTED]> wrote: > Okey, so if my array1 is has 4 elements, and array2 has 6, it won't > loop trough the last 2 in array2? How do I make it do that? In that case your problem is the data. You'll either have to truncate one array and/or pad the other. Or i

Re: Loop in a loop?

2008-01-17 Thread sturlamolden
On 17 Jan, 13:21, Sacred Heart <[EMAIL PROTECTED]> wrote: > A push in the right direction, anyone? for number,letter in zip(array1,array2): print "%s %s" % (number,letter) -- http://mail.python.org/mailman/listinfo/python-list

Re: call by reference howto????

2008-03-15 Thread sturlamolden
On 28 Feb, 02:24, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Python doesn't do call by reference. Nor does it do call by value. Please > pay no attention to anyone who says it does. Exactly. Python pass variables the same way as Lisp, which is neither "call-by-value" (cf. C)

Re: call by reference howto????

2008-03-15 Thread sturlamolden
On 28 Feb, 02:24, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Python doesn't do call by reference. Nor does it do call by value. Please > pay no attention to anyone who says it does. Exactly. Python pass variables the same way as Lisp, which is neither "call-by-value" (cf. C)

Re: call by reference howto????

2008-03-15 Thread sturlamolden
On 13 Mar, 09:22, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Whatever python has for a calling convention, it is close enough that > naming it "call by reference" gives people a reasonable idea of what > is going on. Only to the extent that many mistake passing Java or C# reference types for "cal

Re: Python Generators

2008-03-15 Thread sturlamolden
On 15 Mar, 21:35, mpc <[EMAIL PROTECTED]> wrote: > generator embedded in the argument only once. Can anyone explain while > the generator will not re-initiate, and suggest a simple fix? I am not sure what you are trying to do, but it seems a bit confused. >>> def concat(seq): for s in

Re: Convert int to float

2008-03-15 Thread sturlamolden
On 15 Mar, 22:43, Guido van Brakel <[EMAIL PROTECTED]> wrote: > > def gem(a): > > g = sum(a) / len(a) > > return g > It now gives a int, but i would like to see floats. How can integrate > that into the function? You get an int because you are doing integer division. Cast one int to floa

Re: Convert int to float

2008-03-15 Thread sturlamolden
On 15 Mar, 22:43, Guido van Brakel <[EMAIL PROTECTED]> wrote: > > def gem(a): > > g = sum(a) / len(a) > > return g > > > print gem([1,2,3,4]) > > print gem([1,10,100,1000]) > > print gem([1,-2,3,-4,5]) gem( map(float,[1,2,3,4]) ) gem( float(i) for i in [1,2,3,4] ) -- http://mail.py

Re: Types, Cython, program readability

2008-03-16 Thread sturlamolden
On 16 Mar, 15:32, [EMAIL PROTECTED] wrote: > It seems the development of Cython is going very well, quite > differently from the dead-looking Pyrex. Hopefully Cython will become > more user-friendly too (Pyrex is far from being user-friendly for > Windows users, it doesn't even contain a compiler,

Re: Types, Cython, program readability

2008-03-16 Thread sturlamolden
On 16 Mar, 16:58, [EMAIL PROTECTED] wrote: > I think lot of Win users (computational biologists?), even people that > know how to write good Python code, don't even know how to install a C > compiler. If you don't know how to install a C compiler like Microsoft Visual Studio, you should not be pr

<    1   2   3   4   5   6   7   8   >