473,805 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python in sci/tech applications

I've discovered Python and have been trying it out lately as a possible
replacement for computations that would ordinarily be done with a
commercial package like Matlab or IDL. I'd like to mention a few things
I've run across that have either surprised me or kept me from doing
things the way I'd like to.

1) -There's a large and active sci/tech Python community out there.-
This was something of a surprise. If you look at the python.org site
and click down a couple of levels past the front page, there's a rather
brief mention of scientific and numeric applications-- but I don't
think this does justice to the current levels of activity and
accomplishment.

2) -There's a very impressive set of libraries out there-
NumPy, SciPy, Enthought. It's really kind of stunning how mature these
libraries are and how much I had to poke around to figure that out.

3) -There's a problem with development under Windows.
A typical task will entail writing a 'pure python' prototype to get the
'data in, data out' part of a problem straightened out, then writing a
module in C to get adequate performance in production runs. But the C
compiler that my employer provides (the current version of MSVS)
doesn't produce libraries that work with the current version of Python.
Ooops. This, in the real world, is a big problem. I -love- Python. And
I think I could convince other people to use it. But I've got to have a
way to produce compiled modules painlessly, i.e., without installing a
new operating system.

Nov 2 '06 #1
22 1543
mattf wrote:
I'd like to mention a few things I've run across that have either surprised me or kept me
from doing things the way I'd like to.

1) -There's a large and active sci/tech Python community out there.-
This was something of a surprise. If you look at the python.org site
and click down a couple of levels past the front page, there's a rather
brief mention of scientific and numeric applications-- but I don't
think this does justice to the current levels of activity and
accomplishment.
If you want an in-depth impression of how widely Python is used,
python.org is not really the place that manages to provide it. Sure,
"NASA uses Python" (appropriate response: dressed in a flight suit,
leap up and punch the air?) but isn't OLPC (One Laptop per Child:
http://www.laptop.org/) worth a mention, given the central role of
Python in a device that will potentially reach millions? To the site's
credit, the link to scientific and numeric applications does yield a
lot of information, and I suppose it's hard to focus the site on any
one thing that any given group considers of utmost importance.

However, I think you're going to find that the python.org worldview can
be somewhat alien, especially if your primary interest isn't Python
(the language). To take another domain as an example, if you do desktop
development, the treatment of graphical user interface programming on
the site is quite possibly going to be completely disaligned with what
you'd expect: Python is used extensively in various desktop
environments (not that you'd get that impression from a cursory
examination of python.org), but the python.org (or comp.lang.pytho n)
worldview mostly excludes such things as if the desktop is something
you abstract away rather than take advantage of.

And on the subject of how well "core Pythoneers" know of Python's
successes: how many people knew that Python was used in the OLPC device
before Alan Kay mentioned it at EuroPython? It's hard to promote Python
when you don't know where it's being successfully used already.
2) -There's a very impressive set of libraries out there-
NumPy, SciPy, Enthought. It's really kind of stunning how mature these
libraries are and how much I had to poke around to figure that out.
I guess a lot of the poking around comes about because people are
reluctant to provide any semi-official guide to the best libraries, and
that the most promotion occurs for the most fashionable products in the
most fashionable domains. Some of us have tried to provide better
information about libraries for Python, but such details remain
relatively hidden in the python.org Wiki:

http://wiki.python.org/moin/UsefulModules

With respect to content on python.org, I think all that remains is an
acknowledgement that certain resources are never going to return to
their original vitality, and that alternative mechanisms for publishing
content are required. For example, the XML topic guide surely hasn't
seen many updates in a very long time, and despite a reasonable level
of maintenance, the database topic guide could surely be more actively
maintained by aggregating package information from the package index.

Paul

Nov 2 '06 #2
mattf:
3) -There's a problem with development under Windows.
It's possibile to compile Python with MinGW, and to create extensions
with it. So some site can host a single zip file that contains both
MinGW and Python compiled with it, all ready and set. A person not much
expert can then create compiled small extensions in a short time
without too much complexities. (Or maybe the D language can be packed
into that, instead of MinGW, to do similar things. D can be a good
language used with Python) But then probably PIL, scipy, etc have to be
compiled again for such alternative official or semi-official Python
distribution.

Bye,
bearophile

Nov 2 '06 #3
be************@ lycos.com wrote:
mattf:
>3) -There's a problem with development under Windows.

It's possibile to compile Python with MinGW, and to create extensions
with it. So some site can host a single zip file that contains both
MinGW and Python compiled with it, all ready and set. A person not much
expert can then create compiled small extensions in a short time
without too much complexities. (Or maybe the D language can be packed
into that, instead of MinGW, to do similar things. D can be a good
language used with Python) But then probably PIL, scipy, etc have to be
compiled again for such alternative official or semi-official Python
distribution.
With a few caveats, mingw will simply work with the standard 2.4 (and presumably
2.5) interpreter. We distribute mingw set up to do this with our "Enthought
Edition" Python distribution.

http://code.enthought.com/enthon/

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Nov 2 '06 #4
be************@ lycos.com wrote:
mattf:
>3) -There's a problem with development under Windows.

It's possibile to compile Python with MinGW, and to create extensions
with it. So some site can host a single zip file that contains both
MinGW and Python compiled with it, all ready and set. A person not much
expert can then create compiled small extensions in a short time
without too much complexities. (Or maybe the D language can be packed
into that, instead of MinGW, to do similar things. D can be a good
language used with Python) But then probably PIL, scipy, etc have to be
compiled again for such alternative official or semi-official Python
distribution.
Is it really not possible to create extension libs with older MSVC or Mingw, which work with regular Python binaries version 2.4 and 2.5 ?
Maybe with some special import libraries?

(another option is to stay with Python2.3, which has a small memory footprint and compiles with crtl4.2 libs (VC6, ...) )

-robert
Nov 2 '06 #5
Robert Kern:
We distribute mingw set up to do this with our "Enthought
Edition" Python distribution.
http://code.enthought.com/enthon/
Sorry, maybe I'm blind but I don't see MinGW listed in that page...
Maybe it's included but not listed...

Bye,
bearophile

Nov 2 '06 #6
robert wrote:
Is it really not possible to create extension libs with
older MSVC or Mingw, which work with regular Python binaries
version 2.4 and 2.5 ?
last time I tried, it took me 20 minutes from that I typed "mingw" into
google until I had built and tested my first non-trivial extension. your
milage may vary.

</F>

Nov 2 '06 #7
be************@ lycos.com wrote:
Robert Kern:
>We distribute mingw set up to do this with our "Enthought
Edition" Python distribution.
http://code.enthought.com/enthon/

Sorry, maybe I'm blind but I don't see MinGW listed in that page...
Maybe it's included but not listed...
It's there.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Nov 2 '06 #8
Fredrik Lundh wrote:
robert wrote:
>Is it really not possible to create extension libs with
older MSVC or Mingw, which work with regular Python binaries
version 2.4 and 2.5 ?

last time I tried, it took me 20 minutes from that I typed "mingw" into
google until I had built and tested my first non-trivial extension. your
milage may vary.
thats far beyond my dexterity.

When one follows ..
http://docs.python.org/inst/tweak-fl...00000000000000
http://www.zope.org/Members/als/tips..._mingw_modules

...this seems only to cover the immediate python dll issues. What happens with the C runtime libraries? You'll bind 2 different C-RTLs (DLLs) etc.?
And what happens for example with heap objects created with one C-RTL and deleted/free'd with the other?

-robert

Nov 2 '06 #9
Fredrik Lundh:
last time I tried, it took me 20 minutes from that I typed "mingw" into
google until I had built and tested my first non-trivial extension. your
milage may vary.
But probably before those 20 minutes there is a lot of time of
experience of yours with CPython sources, other compilers, and so on,
so for most people this timing comparison just means "It can be done"
:-)

Bye,
bearophile

Nov 2 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1432
by: Irmen de Jong | last post by:
QOTW: "To make the instructions even friendlier it would also help if 'but Whatever You Do DON'T UNZIP THE FREAKIN' THING - This Means YOU John Latter!' were in large, bold, and underlined type. And preferably a different colour." -- John Latter, on Python's install instructions " What's more, these are three of Python's greatest *strengths*. We resist all attempts to change these, and we (at least I) avoid other languages because...
5
19372
by: K. N. | last post by:
Is there any good and fast Python module for XSLT processing ? I'm going to use XML and XSLT to generate web pages, so I need XSLT processor that will be able to transform for example a DOM object in memory - I don't want to create XML file containing data and then load it and transform with XSLT, but I want to do this at once - without writing to a temporary file. Actually I've seen alot articles about parsing XML, but nothing about...
1
2022
by: Orr, Steve | last post by:
I'm looking to architect a 4-tier or N-tier Python web/CGI app with database connection pooling for high performance. Is there a Python equivalent to Sun's now famous Java PetStore application? (Or something like this link: http://www.developer.com/tech/article.php/606971?) Any Python recommended links/white papers? I've glanced at various Python utilities and frameworks (including Twisted) but what I really need is a fairly complete and...
5
4232
by: Andr? Roberge | last post by:
Sorry about the cryptic subject line, but I wanted to capture the essence of my message in a single line. I am learning Python (which, as everyone know is the best language :-) so that I can write a tutorial to teach my kids about computer programming. The motivation for them will be to use Python to create their own games using pygame and, eventually, blender3d. From what I hear, their friends will be interested in that tutorial too. ...
385
17337
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like extraneous jargons, such as in the Unix & Perl community. Unlike mathematicians, where in mathematics there are no fewer jargons but each and every one are
2
4549
by: Xah Lee | last post by:
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the the function due to its
12
4046
by: Xah Lee | last post by:
Python Doc Problem Example Quote from: http://docs.python.org/lib/module-os.path.html ---------- split( path) Split the pathname path into a pair, (head, tail) where tail is the last pathname component and head is everything leading up to that. The tail part will never contain a slash; if path ends in a slash, tail will be empty. If there is no slash in path, head will be empty. If
47
3488
by: Kenneth McDonald | last post by:
Is there any emerging consensus on the "best" UI for toolkit. Tk never quite made it but from what I can see, both qt and wxWin are both doing fairly well in general. I'm already aware of the licensing issues surrounding qt (fwiw, I think their license fee for commercial use is eminently reasonable), so aside from that, I was wondering if there was any feedback readers could provide on the following: 1) Which plays best with Python?...
0
10609
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.