[ANN] Release 0.61.0 of Task Coach

2006-11-03 Thread Frank Niessink
Hi all,

I'm pleased to announce release 0.61.0 of Task Coach. New in this release:

Bugs fixed:

* Displaying a previously hidden toolbar would result in an incorrectly 
drawn window.
* Exported HTML didn't contain an explicit charset.
* Negative effort preventation was not working correctly.

Features added:

* Hierarchical categories.
* Export in Comma Separated Values (CSV) format. As with export to HTML, 
the current view is exported.
* Task Coach can be run from a removable medium, such as a USB stick. On 
Windows, use the installer to install Task Coach to the medium. Then, 
start Task Coach and turn the setting 'Save settings to same directory 
as program' on. This setting can be found in Edit - Preferences - 
File). This makes sure the TaskCoach.ini file is saved on the removable 
medium, in the same directory as the main program.


What is Task Coach?

Task Coach is a simple task manager that allows for hierarchical
tasks, i.e. tasks in tasks. Task Coach is open source (GPL) and is
developed using Python and wxPython. You can download Task Coach from:

http://taskcoach.niessink.com
https://sourceforge.net/projects/taskcoach/

A binary installer is available for Windows XP and a disk image is
available for Mac OSX, in addition to the source distribution.

Note that Task Coach is alpha software, meaning that it is wise to back
up your task file regularly, and especially when upgrading to a new release.

Cheers, Frank

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


python-dev Summary for 2006-09-16 through 2006-09-30

2006-11-03 Thread steven . bethard
python-dev Summary for 2006-09-16 through 2006-09-30


.. contents::

[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2006-09-16_2006-09-30]



=
Summaries
=

---
Import features
---

Fabio Zadrozny ran into the `previously reported relative import issues`_ where 
a ``from . import xxx`` always fails from a top-level module. This is because 
relative imports rely on the ``__name__`` of a module, so when it is just 
``__main__``, they can't handle it properly.

On the subject of imports, Guido said that one of the missing import features 
was to be able to say *this* package lives *here*. Paul Moore whipped up a 
Python API to an import hook that could do this, but indicated that a full 
mechanism would need to pay more attention to the environment (e.g. PYTHONPATH 
and .pth files).

There was also some discussion about trying to have a sort of per-module 
``sys.path`` so that you could have multiple versions of the same module 
present, with different modules importing different versions. Phillip J. Eby 
suggested that this was probably not a very common need, and that implementing 
it would be quite difficult with things like C extensions only being able to be 
loaded once.

In general, people seemed interested in a pure-Python implementation of the 
import mechanism so that they could play with some of these approaches. It 
looked like Brett Cannon would probably be working on that.

.. _previously reported relative import issues: 
http://www.python.org/dev/summary/2006-06-16_2006-06-30/#relative-imports-and-pep-338-executing-modules-as-scripts

Contributing thread:

- `New relative import issue 
http://mail.python.org/pipermail/python-dev/2006-September/068806.html`__


Python library documentation


A less-trolly-than-usual post from Xah Lee started a discussion about the 
Python documentation.  Greg Ewing and others suggested following the 
documentation style of the Inside Macintosh series: first an About this 
module narrative explaining the concepts and how they fit together, followed 
by the extensive API reference. Most people agreed that simply extracting the 
documentation from the docstrings was a bad idea -- it lacks the high-level 
overview and gives equal importance to all functions, regardless of their use.

Contributing thread:

- `Python Doc problems 
http://mail.python.org/pipermail/python-dev/2006-September/069023.html`__

---
OS X universal binaries
---

Jack Howarth asked about creating universal binaries for OS X that would 
support 32-bit or 64-bit on both PPC and x86. Ronald Oussoren pointed out that 
the 32-bit part of this was already supported, but indicated that adding 64-bit 
support simultaneously might be more difficult. Ronald and Martin v. Lowis 
discussed strategies for modifying pyconfig.h, though it seemed these solutions 
might cause distutils to detect some architecture features incorrectly. Martin 
suggested that this was more a problem of distutils than pyconfig.h.

Contributing thread:

- `python, lipo and the future? 
http://mail.python.org/pipermail/python-dev/2006-September/068800.html`__

--
Finer-grained locking than the GIL
--

Martin Devera was looking into replacing the global interpreter lock (GIL) with 
finer-grained locking, tuned to minimize locking by assuming that most objects 
were used only by a single thread. For objects that were shared across multiple 
threads, this approach would allow non-blocking reads, but require all threads 
to come home before modifications could be made. Phillip J. Eby pointed out 
that most object accesses in Python are actually modifications too, due to 
reference counting, so it looked like Martin's proposal wouldn't work well with 
the current refcounting implementation of Python. After Martin v. Lowis found a 
bug in the locking algorithm, Martin Devera decided to take his idea back to 
the drawing board.

Contributing thread:

- `deja-vu .. python locking 
http://mail.python.org/pipermail/python-dev/2006-September/068828.html`__

---
OS X and ssize_t formatting
---

The buildbots spotted an OS X error in the itertools module. After Jack 
Diederich fixed a bug where ``size_t`` had been used instead of ``ssize_t``, 
Neal Norwitz noticed some problems with ``%zd`` on OS X. Despite documentation 
to the contrary in both the man page and the C99 Standard, using that specifier 
on OS X treats a negative number as an unsigned number. Ronald Oussoren and 
others reported the bug to Apple.

Contributing thread:

- `test_itertools fails for trunk on x86 OS X machine 
http://mail.python.org/pipermail/python-dev/2006-September/068898.html`__

---
itertools.flatten()

python-dev Summary for 2006-09-01 through 2006-09-15

2006-11-03 Thread steven . bethard
python-dev Summary for 2006-09-01 through 2006-09-15


.. contents::

[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2006-09-01_2006-09-15]



=
Announcements
=


QOTF: Quote of the Fortnight


Through a cross-posting slip-up, Jean-Paul Calderone managed to provide us with 
some inspiring thoughts on mailing-list archives:

One could just as easily ask why no one bothers to read mailing list
archives to see if their question has been answered before.

No one will ever know, it is just one of the mysteries of the universe.

Contributing thread:

- `[Twisted-Python] Newbie question 
http://mail.python.org/pipermail/python-dev/2006-September/068682.html`__

-
Monthly Arlington sprints
-

Jeffrey Elkner has arranged for monthly Arlington Python sprints. See the 
`Arlington sprint wiki`_ for more details.

.. _Arlington sprint wiki: http://wiki.python.org/moin/ArlingtonSprint

Contributing thread:

- `Arlington sprints to occur monthly 
http://mail.python.org/pipermail/python-dev/2006-September/068688.html`__

=
Summaries
=

-
Signals, threads and blocking C functions
-

Gustavo Carneiro explained a problem that pygtk was running into.  Their main 
loop function, ``gtk_main()``, blocks forever. If there are threads in the 
program, they cannot receive signals because Python catches the signal and 
calls ``Py_AddPendingCall()``, relying on the main thread to call 
``Py_MakePendingCalls()``.  Since with pygtk, the main thread is blocked 
calling a C function, it has no way other than polling to decide when 
``Py_MakePendingCalls()`` needs to be called.  Gustavo was hoping for some sort 
of API so that his blocking thread could get notified when 
``Py_AddPendingCall()`` had been called.

There was a long discussion about the feasibility of this and other solutions 
to his problem. One of the main problems is that almost nothing can safely be 
done from a signal handler context, so some people felt like having Python 
invoke arbitrary third-party code was a bad idea. Gustavo was reasonably 
confident that he could write to a pipe within that context, which was all he 
needed to do to solve his problem, but Nick Maclaren explained in detail some 
of the problems, e.g. writing proper synchronization primitives that are 
signal-handler safe.

Jan Kanis suggested that threads in a pygtk program should occasionally check 
the signal handler flags and calls PyGTK's callback to wake up the main thread. 
But Gustavo explained that things like the GnomeVFS library have their own 
thread pools and know nothing about Python so can't make such a callback.

Adam Olsen suggested that Python could create a single non-blocking pipe for 
all signals. When a signal was handled, the signal number would be written to 
that pipe as a single byte. Third-party libraries, like pygtk, could poll the 
appropriate file descriptor, waking up and handing control back to Python when 
a signal was received. There were some disadvantages to this approach, e.g. if 
there is a large burst of signals, some of them would be lost, but folks seemed 
to think that these kinds of things would not cause many real-world problems. 
Gustavo and Adam then worked out the code in a little more detail.

The `Py_signal_pipe patch`_ was posted to SourceForge.

.. _Py_signal_pipe patch: http://bugs.python.org/1564547

Contributing thread:

- `Signals, threads, blocking C functions 
http://mail.python.org/pipermail/python-dev/2006-September/068569.html`__


API for str.rpartition()


Raymond Hettinger pointed out that in cases where the separator was not found, 
``str.rpartition()`` was putting the remainder of the string in the wrong spot, 
e.g. ``str.rpartition()`` worked like::

'axbxc'.rpartition('x') == ('axb', 'x', 'c')
'axb'.rpartition('x') == ('a', 'x', 'b')
'a'.rpartition('x') == ('a', '', '')  # should be ('', '', 'a')

Thus code that used ``str.rpartition()`` in a loop or recursively would likely 
never terminate. Raymond checked in a fix for this, spawning an enormous 
discussion about how the three bits ``str.rpartition()`` returns should be 
named.  There was widespread disagreement on which side was the head and 
which side was the tail, and the only unambiguous one seemed to be left, 
sep, right. Raymond and others were not as happy with this version because it 
was no longer suggestive of the use cases, but it looked like this might be the 
best compromise.

Contributing threads:

- `Problem withthe API for str.rpartition() 
http://mail.python.org/pipermail/python-dev/2006-September/068565.html`__
- `Fwd: Problem withthe API for str.rpartition() 

Re: Javascript is turning into Python?!

2006-11-03 Thread Ben Finney
Paul Rubin http://phr.cx@NOSPAM.invalid writes:

 I hadn't seen this before.  New Javascript 1.7 features:
 - Generators
 - Iterators
 - Array comprehensions
 - Destructuring assignment

 Sounds like another language we know.

The current developers of Javascript have been quite open during
development of 1.7 that they have been inspired by Python for many of
the new features. (Tried to find a URL, but my search-fu is weak
today.)

-- 
 \ Try to become not a man of success, but try rather to become a |
  `\man of value.  -- Albert Einstein |
_o__)  |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: SE 2.3 temporarily unavailable. Cheese shop defeats upload with erratic behavior. Urgently requesting help.

2006-11-03 Thread Frederic Rentsch
jim-on-linux wrote:
 Frederic,

 I've been trying to get back into my package in 
 the Cheese Shop for over a year. The phone 
 company changed my e:mail address and to make a 
 long and frustrating story short I can't get back 
 into the Cheese Shop to make changes to my file.

 Time is money.  At some time you have to consider 
 if it is worth it.  At least you have the name of 
 your program listed.

 I wish I could be more helpfull. I'll watch the 
 responses you get from others.

 Good Luck,
 jim-on-linux

 http://www.inqvista.com






 On Thursday 02 November 2006 09:00, you wrote:
   
 Some time ago I had managed to upload a small
 package to the Cheese Shop using the data entry
 template. Uploading is in two steps: first the
 text then the package file. When I had a new
 version it went like this: The new text made a
 new page, but the new file went to the old
 
 snip
   


Thanks for letting me know that I am not alone. Do you know of an 
alternative to the Cheese Shop?

Frederic


-- 
http://mail.python.org/mailman/listinfo/python-list


problems with matplotlib on mac os x

2006-11-03 Thread spross
hi all

i have to use matplotlib on mac os x. on the official site of
matplotlib, i found a link to precompiled python packages for mac os x:

http://pythonmac.org/packages/py24-fat/index.html

so first, i installed python 2.4. that works great! if i type 'python'
in the terminal, it loads python 2.4.
after that, i loaded and installed the matplotlib package from this
site. if i type in python 'import matplotlib' no error appiers. so far,
so well...

so i went back to the tutorial page of matplotlib to crab a test... but
they use overall 'import pylab'. witch doesn't work in my python... so
i went back to the packages site again, loaded and installed numpy. now
hurray, python can do something with 'import pylab', but:

[code]
 import pylab
RuntimeError: module compiled against version 109 of C-API but this
version of numpy is 102

The import of the numpy version of the _transforms module,
_ns_transforms, failed.  This is is either because numpy was
unavailable when matplotlib was compiled, because a dependency of
_ns_transforms could not be satisfied, or because the build flag for
this module was turned off in setup.py.  If it appears that
_ns_transforms was not built, make sure you have a working copy of
numpy and then re-install matplotlib. Otherwise, the following
traceback gives more details:

Traceback (most recent call last):
  File stdin, line 1, in ?
  File
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pylab.py,
line 1, in ?
from matplotlib.pylab import *
  File
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/pylab.py,
line 201, in ?
from axes import Axes, PolarAxes
  File
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axes.py,
line 14, in ?
from artist import Artist, setp
  File
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/artist.py,
line 4, in ?
from transforms import identity_transform
  File
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/transforms.py,
line 223, in ?
from _transforms import Value, Point, Interval, Bbox, Affine
  File
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/_transforms.py,
line 17, in ?
from matplotlib._ns_transforms import *
ImportError: numpy.core.multiarray failed to import
[/code]

The error tells me, i have to install the packages in right order. so i
did it again:

1. numarray
2. numpy
3. matplotlib

But after that, the same error message appiers. i was never so near
that it will works :(
Can anybody help me?

Big thanks!
spross

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a newbi problem: can't find complete python curses library

2006-11-03 Thread Fredrik Lundh
krishnakant Mane wrote:

 does python possess a complete wrapper to ncurses and its related
 libraries like menu, panel and form?
 if yes then where can I find documentation?

if you want to have good documentation and save a lot of time and 
energy, I recommend building on top of Urwid rather than directly on 
ncurses:

 http://excess.org/urwid/

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Defaultdict and speed

2006-11-03 Thread bearophileHUGS
This post sums some things I have written in another Python newsgroup.
More than 40% of the times I use defaultdict like this, to count
things:

 from collections import defaultdict as DD
 s = abracadabra
 d = DD(int)
 for c in s: d[c] += 1
...
 d
defaultdict(type 'int', {'a': 5, 'r': 2, 'b': 2, 'c': 1, 'd': 1})

But I have seen that if keys are quite sparse, and int() becomes called
too much often, then code like this is faster:

 d = {}
 for c in s:
...   if c in d: d[c] += 1
...   else: d[c] = 1
...
 d
{'a': 5, 'r': 2, 'b': 2, 'c': 1, 'd': 1}

So to improve the speed for such special but common situation, the
defaultdict can manage the case with default_factory=int in a different
and faster way.

Bye,
bearophile

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: __doc__ in compiled script

2006-11-03 Thread Peter Otten
Fredrik Lundh wrote:

 Gabriel Genellina wrote:
 
  co.co_consts[list(co.co_names).index(__doc__)]
 'This is a docstring'
 
 Good! I'll buy this one :) thanks!
 
 however, there's no 1:1 mapping between names and constants; if you want
 code that works by accident, you might as well use co_consts[0].

Seems like I hid the magic constant in some voodoo code. There is an
advantage over co_consts[0], though: it balks when there is no docstring.

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list


Directory Listing output to a file

2006-11-03 Thread wifighost








Hi All,



 I am a newbie to the Python language and already
love it. I am working on my first script. I am trying to create a script that
will get the contents of a directory and export (output) that information in a
file that exists or creates. Mainly its going to read my network drive
and output all the names of files and folders in that drive so I can have a
list handy in a txt file format. I am already working on the code an running
into a few snags. Please e-mail me if you can help, I will post the code on my
web site so those who e-mail me can see it.






-- 
http://mail.python.org/mailman/listinfo/python-list

Re: __doc__ in compiled script

2006-11-03 Thread Peter Otten
Gabriel Genellina wrote:

 I have a script starting with a docstring. After compiling it with
 compile(), is there any way I could get the docstring? __doc__ on the
 code object doesn't work.


The lazy coder's approach:

 compiler.parse(
... 'the docstring'
... print 42
... ).doc
'the docstring'

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-03 Thread Daniel Dittmar
robert wrote:
 I'd like to use multiple CPU cores for selected time consuming Python 
 computations (incl. numpy/scipy) in a frictionless manner.
 
 Interprocess communication is tedious and out of question, so I thought 
 about simply using a more Python interpreter instances 
 (Py_NewInterpreter) with extra GIL in the same process.

If I understand Python/ceval.c, the GIL is really global, not specific 
to an interpreter instance:
static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */

Daniel


-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-03 Thread robert
Jean-Paul Calderone wrote:
 On Thu, 2 Nov 2006 14:15:58 -0500, Jean-Paul Calderone 
 [EMAIL PROTECTED] wrote:
 On Thu, 02 Nov 2006 19:32:54 +0100, robert 
 [EMAIL PROTECTED] wrote:
 I'd like to use multiple CPU cores for selected time consuming Python 
 computations (incl. numpy/scipy) in a frictionless manner.

 NumPy releases the GIL in quite a few places.
 
 Eh, no it doesn't.  Sorry for the misinformation.  I'll double check
 my memory first next time.
 

only lin. alg and rare locations. But that doesn't make up my typical CPU load. 
Parallel execution of any varying Python code (and also Pyrex) without 
constantly thinking about C-level is definitely my real aim. (Otherwise I'd 
code most algs directly in C with less worries.)

robert
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Javascript is turning into Python?!

2006-11-03 Thread Robert Thorpe
Paul Rubin wrote:
 I hadn't seem this before.  New Javascript 1.7 features:

 - Generators
 - Iterators
 - Array comprehensions
 - Destructuring assignment

 Sounds like another language we know.

 http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7

Indeed, this is a consequence of Greenspun's tenth rule, and it's good.
It doesn't have much to do with GNU Emacs though.

-- 
http://mail.python.org/mailman/listinfo/python-list


Feature Request: Py_NewInterpreter to create separate GIL (branch)

2006-11-03 Thread robert
Feature Request: Py_NewInterpreter to create separate GIL (branch)

Daniel Dittmar wrote:
 robert wrote:
 I'd like to use multiple CPU cores for selected time consuming Python 
 computations (incl. numpy/scipy) in a frictionless manner.

 Interprocess communication is tedious and out of question, so I 
 thought about simply using a more Python interpreter instances 
 (Py_NewInterpreter) with extra GIL in the same process.
 
 If I understand Python/ceval.c, the GIL is really global, not specific 
 to an interpreter instance:
 static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */
 

Thats the show stopper as of now.
There are only a handfull funcs in ceval.c to use that very global lock. The 
rest uses that funcs around thread states.

Would it be a possibilty in next Python to have the lock separate for each 
Interpreter instance. 
Thus: have *interpreter_lock separate in each PyThreadState instance and only 
threads of same Interpreter have same GIL?
Separation between Interpreters seems to be enough. The Interpreter runs mainly 
on the stack. Possibly only very few global C-level resources would require 
individual extra locks.

Sooner or later Python will have to answer the multi-processor question. 
A per-interpreter GIL and a nice module for tunneling Python-Objects directly 
between Interpreters inside one process might be the answer at the right 
border-line ? Existing extension code base would remain compatible, as far as 
there is already decent locking on module globals, which is the the usual case.

Robert
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Feature Request: Py_NewInterpreter to create separate GIL (branch)

2006-11-03 Thread Andre Meyer
Hi allStrange enough, there does not even seem to be interest in removing the GIL in Python 3000.For some interesting answers on this topic you may read through the thread Kill GIL on the py3k mailing list archives:
http://mail.python.org/pipermail/python-3000/2006-September/thread.html.kind regardsAndré
On 11/3/06, robert [EMAIL PROTECTED] wrote:
Feature Request: Py_NewInterpreter to create separate GIL (branch)Daniel Dittmar wrote: robert wrote: I'd like to use multiple CPU cores for selected time consuming Python computations (incl. numpy/scipy) in a frictionless manner.
 Interprocess communication is tedious and out of question, so I thought about simply using a more Python interpreter instances (Py_NewInterpreter) with extra GIL in the same process.
 If I understand Python/ceval.c, the GIL is really global, not specific to an interpreter instance: static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */Thats the show stopper as of now.
There are only a handfull funcs in ceval.c to use that very global lock. The rest uses that funcs around thread states.Would it be a possibilty in next Python to have the lock separate for each Interpreter instance.
Thus: have *interpreter_lock separate in each PyThreadState instance and only threads of same Interpreter have same GIL?Separation between Interpreters seems to be enough. The Interpreter runs mainly on the stack. Possibly only very few global C-level resources would require individual extra locks.
Sooner or later Python will have to answer the multi-processor question.A per-interpreter GIL and a nice module for tunneling Python-Objects directly between Interpreters inside one process might be the answer at the right border-line ? Existing extension code base would remain compatible, as far as there is already decent locking on module globals, which is the the usual case.
Robert--http://mail.python.org/mailman/listinfo/python-list-- Dr. Andre P. Meyer
http://python.openspace.nl/meyerTNO Defence, Security and Safetyhttp://www.tno.nl/Delft Cooperation on Intelligent Systems
http://www.decis.nl/Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. - Douglas Adams
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: refcounting errors???

2006-11-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote:


 The invokation of the foo-function goes somewhere in the line of:

PyObject *up = PyBool_FromLong(1L);
if (! up) PyErr_Print();

PyObject *res = PyObject_CallFunction(action.u.button.u.s,
 (NIH),

what happens if you use (OIH) instead ?

/F 



-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-03 Thread Filip Wasilewski
robert wrote:
 I'd like to use multiple CPU cores for selected time consuming Python 
 computations (incl. numpy/scipy) in a frictionless manner.

 Interprocess communication is tedious and out of question, so I thought about 
 simply using a more Python interpreter instances (Py_NewInterpreter) with 
 extra GIL in the same process.
 I expect to be able to directly push around Python Object-Trees between the 2 
 (or more) interpreters by doing some careful locking.

I don't want to discourage you but what about reference counting/memory
management for shared objects? Doesn't seem fun for me.


Take a look at IPython1 and it's parallel computing capabilities [1,
2]. It is designed to run on multiple systems or a single system with
multiple CPU/multi-core. It's worker interpreters (engines) are loosely
coupled and can utilize several MPI modules, so there is no low-level
messing with GIL. Although it is work in progress it already looks
quite awesome.

[1] http://ipython.scipy.org/moin/Parallel_Computing
[2] http://ipython.scipy.org/moin/Parallel_Computing/Tutorial

fw

-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: SE 2.3. Available now

2006-11-03 Thread Frederic Rentsch
A few Cheese Shop upload problems have been solved with the help of this 
creative group. Thank you all!

Version 2.2 beta should be phased out. It has a functional defect, 
missing matches with a very low statistical probability. Version 2.3 has 
this fixed.

   Download URL: http://cheeseshop.python.org/pypi/SE/2.3

A list of possible handling improvements is being made to be 
incorporated in the next version, One major flaw of the interface design 
came to light the other day when a user reported a non-functioning 
Editor Object made with a file name. If the constructor cannot find the 
file it records the fact in the object's log without making the user 
aware that his Editor Object is incomplete or altogether devoid of 
substitutions. His obvious conclusion is that the damn thing isn't 
working right.
   Compile errors should certainly be reported at compile time. The next 
version will send all messages being logged also to stderr by default. 
The thing to do with the current version, if it appears to malfunction, 
is to inspect the log and the compiled substitutions.

  Editor = SE.SE ('operators.se')
  Editor.show_log ()

Fri Nov 03 12:49:17 2006 - Compiler - Ignoring single word 
'operators.se'. Not an existing file 'operators.se'.

  Editor = SE.SE ('se/operators.se')   # path was missing
  Editor.show_log ()

(Log is empty. All is well.)

  Editor.show (show_translators = 1)

(snip)

Single-Byte Targets
1: ||-|LT|
2: ||-|GT|

Multi-Byte Targets
3: ||-|AND|
4: -|OR|

etc...

The display makes definition errors conspicuous. Missing definitions 
indicate malformed or redefined (overwritten) ones.


Frederic


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: SE 2.3 temporarily unavailable. Cheese shop defeats upload with erratic behavior. Urgently requesting help.

2006-11-03 Thread Steve Holden
Frederic Rentsch wrote:
 jim-on-linux wrote:
 
Frederic,

I've been trying to get back into my package in 
the Cheese Shop for over a year. The phone 
company changed my e:mail address and to make a 
long and frustrating story short I can't get back 
into the Cheese Shop to make changes to my file.

Time is money.  At some time you have to consider 
if it is worth it.  At least you have the name of 
your program listed.

I wish I could be more helpfull. I'll watch the 
responses you get from others.

Good Luck,
jim-on-linux

http://www.inqvista.com






On Thursday 02 November 2006 09:00, you wrote:
  

Some time ago I had managed to upload a small
package to the Cheese Shop using the data entry
template. Uploading is in two steps: first the
text then the package file. When I had a new
version it went like this: The new text made a
new page, but the new file went to the old


snip
  
 
 
 
 Thanks for letting me know that I am not alone. Do you know of an 
 alternative to the Cheese Shop?
 
Surely the correct answer to this problem is to get the Cheese Shop 
fixed, not to migrate away from it? To whom (besides this list) have you 
communicated the problem, and with what results?

Remember that python.org is run by volunteers, but they are mostly 
highly capable volunteers. This is probably just a change situation that 
wasn't anticipated in the design (we all make mistakes).

A simple change of email address could probably be achieved by tweaking 
the data for one or two individuals, and an automated solution should 
clearly be added as volumes build up.

For now, how about a link that causes someone to receive email? I'd be 
surprised if this couldn't be used to handle low-volume changes with 
adequate security.

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd  http://www.holdenweb.com
Skype: holdenweb   http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-03 Thread robert
Filip Wasilewski wrote:
 robert wrote:
 I'd like to use multiple CPU cores for selected time consuming Python 
 computations (incl. numpy/scipy) in a frictionless manner.

 Interprocess communication is tedious and out of question, so I thought 
 about simply using a more Python interpreter instances (Py_NewInterpreter) 
 with extra GIL in the same process.
 I expect to be able to directly push around Python Object-Trees between the 
 2 (or more) interpreters by doing some careful locking.
 
 I don't want to discourage you but what about reference counting/memory
 management for shared objects? Doesn't seem fun for me.

in combination with some simple locking (anyway necessary) I don't see a 
problem in ref-counting.

If at least any interpreter branch has a pointer to the (root) object in 
question the ref-count is 0. 


 
Question Besides:  do concurrent INC/DEC machine OP-commands execute atomically 
on Multi-Cores as they do in Single-Core threads?

Example:

obj=Obj()

In a read-only phase (e.g. after computations) without locking, 2 Interpreters 
would for example both access the obj (and change around the refcount but no 
data).
The CPU will execute 2 [INC/DEC @refcount] OP-codes on different cores 
concurrently. Is it guaranteed that the counts sum up correctly?


 Take a look at IPython1 and it's parallel computing capabilities [1,
 2]. It is designed to run on multiple systems or a single system with
 multiple CPU/multi-core. It's worker interpreters (engines) are loosely
 coupled and can utilize several MPI modules, so there is no low-level
 messing with GIL. Although it is work in progress it already looks
 quite awesome.
 
 [1] http://ipython.scipy.org/moin/Parallel_Computing
 [2] http://ipython.scipy.org/moin/Parallel_Computing/Tutorial
 

there are some MPI methods around. (This IPython method seems to be only on the 
level of an artefact of the interactive terminal connections.)

Yet with its burden of expensive data sync thats far away from my requirements. 
Thats for massive parallel computing and in sci areas.

I do selected things with interprocess shared memory techniques already. Thats 
medium efficent. 

Multiple interpreters inside one process seem to be most promising for seemless 
multi-core programming. As all Python objects share the same malloc space - 
thats the key requirement in order to get the main effect. 
As soon as with have object pickling in between its well away from this very 
discussion.


robert
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in sci/tech applications

2006-11-03 Thread Magnus Lycka
robert wrote:
 When one follows ..
 http://docs.python.org/inst/tweak-flags.html#SECTION000622000 
 http://www.zope.org/Members/als/tips/win32_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?

As far as I understand, there should be only one runtime library
involved. MinGW relies on the Microsoft runtime. It seems some
people have had problems using MSVCRT71 with MinGW, but I'm sure
that e.g. the Enthought people can explain those issues, since they
bundle MinGW in their Python 2.4 distribution.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Keyboard interrupts, Idle vs. SciTE

2006-11-03 Thread robert
John Ladasky wrote:
 Hi there.
 
 The following minimal code in Python 2.3.4 works under Idle v. 1.0.3,
 but not under SciTE v. 1.66:
 
 from time import sleep
 try:
 while True:
 sleep(0.25)
 print .,
 except KeyboardInterrupt:
 print \nKeyboard interrupt received.  Exiting program.\n\n
 
 
 Under SciTE, I do not get my exiting program message.  Instead, I get
 the standard SciTE abort message:
 
 
 Process failed to respond; forcing abrupt termination...
 Exit code: 1
 
 
 I much prefer the SciTE environment to Idle.  Is there any way that I
 can rewrite my program to restore the keyboard interrupt function under
 SciTE?  Alternately, is there some setting that I can change in SciTE
 to accomplish the same effect?

Use PythonWin on Windows. It is based on the same Scintilla editor, but 
provides real interaction and inline script execution capabs, debugging ...
SciTE catches only stdout ( sometimes :-) ) etc. 

robert
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: emacs shell hangs on W32 with python

2006-11-03 Thread emin . shopper
Hmm, it doesn't even work if I run the cygwin version of GNU Emacs and
have it start the Windows version of python through python-mode or if I
start a shell in emacs and then start the Windows version of python
through the shell. Interestingly, however, things DO seem to work if I
use cygwin emacs with cygwin python (version 2.4.1).

I wonder if the windows version of Tkinter does something weird such as
implicitly calling Tk.mainloop()...

Any help would be much appreciated.

Brian Elmegaard wrote:
 [EMAIL PROTECTED] writes:

  Is there any way to run python through emacs or xemacs without having
  it hang or is shell support broken?

 Doing it from eshell gives the same problem :-(
 --
 Brian (remove the sport for mail)
 http://www.et.web.mek.dtu.dk/Staff/be/be.html
 Rugbyklubben Speed Scandinavian Open 7s Rugby http://www.rkspeed.dk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in sci/tech applications

2006-11-03 Thread John Coleman

John Coleman wrote:
 Robert Kern wrote:
  John Coleman wrote:
   Maybe I don't know what I'm looking for, but I downloaded Enthought a
   few days ago and don't seem to find MinGW on my system. There are 2
   relatively small (totalling about 13 kb IIRC) *python* files deeply
   buried in the distribution with mingw in their filename but nothing
   like a gcc compiler. I've mostly used visual studio or code warrior for
   C compiling, so again - maybe I don't know what I am looking for.
 
  It is in c:\Python24\Enthought\mingw32\, IIRC (I don't have it in front of 
  me).
  Add c:\Python24\Enthought\mingw32\bin\ to your PATH environment variable, 
  and
  gcc.exe should be executable.
 
 I have no such sub-directory. I'll try an uninstall-install. When I did
 the original installation the installer hung at the end and I had to
 manually close it. The Python interpreter was there and worked properly
 and all of the goodies like numby and chaco were there so I wrote it
 off as nothing more then a failure to close properly, but evidently I
 missed an essential part of the installation.

 -John Coleman

Problem fixed. I had clicked on the 10-05-06 download (thinking that
enthought_setup-1.1.0.msi led to the set up the full enthought
package), but this is evidently only a partial download. I tried it a
second time with the same results, but perhaps I wasn't using the
browse and install option correctly (clicking that button on the
enstaller caused a lot of files to be transfered, but there didn't seem
to be any real list to browse). In any event, the August download
worked like a charm and had it all, including mingw. Thanks for your
help.

-John Coleman

-- 
http://mail.python.org/mailman/listinfo/python-list


MemoDepot: build YOUR OWN online notes library - anything, anytime, anywhere

2006-11-03 Thread ompaniess
Just like everybody else nowadays, you are facing infinite amount of
information everyday. how can you keep those that truly matters to you?
MemoDepot allows you to do just that, and much more!

- Capture any information, store as notes in your MemoDepot account,
and access from anywhere
- Organize your notes the way you like, they are always available at
your fingertips
- Pinpoint any notes by powerful search, just when you need it
- Share your notes with others
- Export your notes to local machine, so you take control, not
MemoDepot

With MemoDepot, you no longer have to throw away any useful
information: contacts, ideas, experience, coupons, receipts, pictures,
web pages, hard Googled-out results, programming sample codes,
teacher's handout, scientific references, or simply favored book
passages.. yes, ANYTHING. It is the place to deposit your
knowledge; it is the way to extend your memory.

MemoDepot is NOT merely a storage solution, a screen scraper, NOR is
another online notebook, search engine or editor - it is an end to end
knowledge build and management system, everyday, in the most convenient
way.

To truly appreciate why MemoDepot tool and service are so powerful,
take a few minutes to check out:

http://www.memodepot.com/noteserver/flashes/memodepot.pps  (PowerPonit)

http://www.memodepot.com/noteserver/flashes/memodepot_demo.html  (Flash
Demo)

http://www.memodepot.com (Get started!)

Any comments or suggestions, send to: [EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: SE 2.3 temporarily unavailable. Cheese shop defeats upload with erratic behavior. Urgently requesting help.

2006-11-03 Thread jim-on-linux
On Thursday 02 November 2006 14:59, Frederic 
Rentsch wrote:
 jim-on-linux wrote:
  Frederic,
 
  I've been trying to get back into my package
  in the Cheese Shop for over a year. The phone
  company changed my e:mail address and to make
  a long and frustrating story short I can't
  get back into the Cheese Shop to make changes
  to my file.
 
  Time is money.  At some time you have to
  consider if it is worth it.  At least you
  have the name of your program listed.
 
  I wish I could be more helpfull. I'll watch
  the responses you get from others.
 
  Good Luck,
  jim-on-linux
 
  http://www.inqvista.com
 
  On Thursday 02 November 2006 09:00, you wrote:
  Some time ago I had managed to upload a
  small package to the Cheese Shop using the
  data entry template. Uploading is in two
  steps: first the text then the package file.
  When I had a new version it went like this:
  The new text made a new page, but the new
  file went to the old
 
  snip

 Thanks for letting me know that I am not alone.
 Do you know of an alternative to the Cheese
 Shop?

 Frederic

Python registering alternatives?

Part of the mission of the Cheese Shop is to 
safeguard the name of your software. Once 
registered, no one else can use that name. That's 
been done, unless you spelled the package name 
wrong.

I read the following, and I'm not sure if you have 
tried it.

The quote below is from: 
http//:www.python.org/doc/current/dist/package-index.htm 
item #7 Registering with the Package Index.  
(11-15-2004)


By default PyPi will list all versions of a given 
package.  To hide certain versions, the hidden 
property should be set to yes.  This must be 
edited through the web interface.

Sounds to me that you can hide what is on the site 
and submit a new version, if you set Hidden 
property to yes. 

I don't know of any other place to register a 
python package with the python organization.

Good Luck,

jim-on-linux

http://www.inqvista.com







































-- 
http://mail.python.org/mailman/listinfo/python-list


Converting Microsoft Works databases.... *shudder*

2006-11-03 Thread Michael B. Trausch
I was wondering if anyone has had any experience with this.  Someone I
know is trying to move away from Microsoft Works, and I am trying to
look into a solution that would convert their data in a lossless fashion
to a more modern format.  The database has more than 65K rows, so
converting it to be an Excel spreadsheet, would, AFAIK, not be an option.

It would seem that MS Works can export the database as a DBF format
database, though I have not tried it.  Before I get started, I was
wondering if anyone has been through this problem in the past and used
Python to solve the problem.  Knowing nearly nothing about the DBase
family of application software, and database formats, I find myself
feeling like the information out there is, frankly, a bit overwhelming.

Would the recipe specified in the dbf to csv thread be useful here for
a file in DBase IV format?  It of course uses the same extension, but I
am not sure if the file semantics are at all similar.  The idea at the
end would be to probably create a database on an small SQL server (like
MySQL) and let the person access their data using ODBC on their Windows
workstation so that they can create form letters and the like.  They do
not have access to MS Office's Access product, nor do they wish to use
OOo Base (and I can't say that I blame them -- it seems to crash far too
often to be considered reliable stuff).

-- Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: emacs shell hangs on W32 with python

2006-11-03 Thread emin . shopper
The same problems occur with the latest emacs binary from CVS
(emacs-version)

GNU Emacs 23.0.0.1 (i386-mingw-nt5.1.2600) of 2006-10-16 on DTOP

Lennart Borgman wrote:
 Would it not be a good idea to try the CVS version of Emacs for this now
 since the pretest will soon begin? Go here for precompiled versions:

 http://www.emacswiki.org/cgi-bin/wiki/CategoryWThirtyTwo




 [EMAIL PROTECTED] wrote:
  Hmm, it doesn't even work if I run the cygwin version of GNU Emacs and
  have it start the Windows version of python through python-mode or if I
  start a shell in emacs and then start the Windows version of python
  through the shell. Interestingly, however, things DO seem to work if I
  use cygwin emacs with cygwin python (version 2.4.1).
 
  I wonder if the windows version of Tkinter does something weird such as
  implicitly calling Tk.mainloop()...
 
  Any help would be much appreciated.
 
  Brian Elmegaard wrote:
 
  [EMAIL PROTECTED] writes:
 
 
  Is there any way to run python through emacs or xemacs without having
  it hang or is shell support broken?
 
  Doing it from eshell gives the same problem :-(
  --
  Brian (remove the sport for mail)
  http://www.et.web.mek.dtu.dk/Staff/be/be.html
  Rugbyklubben Speed Scandinavian Open 7s Rugby http://www.rkspeed.dk
 

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-03 Thread Daniel Dittmar
robert wrote:
  Question Besides:  do concurrent INC/DEC machine OP-commands 
 execute atomically on Multi-Cores as they do in Single-Core threads?

No on the level that that Python reference counting is implemented. The 
CPUs have often special assembler ops for these operations. I think that 
it's even more complicated as some machines require additional read and 
write barriers around these operations.

 Take a look at IPython1 and it's parallel computing capabilities [1,
[...]
 I do selected things with interprocess shared memory techniques already. 
 Thats medium efficent.
 Multiple interpreters inside one process seem to be most promising for 
 seemless multi-core programming. 

Both IPython and Jython use multiple CPUs without the GIL, so you don't 
need to add the complication of multiple interpreters.

  As all Python objects share the same
  malloc space - thats the key requirement in order to get the main
  effect. As soon as with have object pickling in between its well away
  from this very discussion.

There's the complication that CPython has garbage collection in addition 
to reference counting. I'm not sure what happens when the garbage 
collector looks at objects rooted in another interpreter.

Daniel
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: refcounting errors???

2006-11-03 Thread [EMAIL PROTECTED]
Bingo, that works.

Thanks!

Fredrik Lundh wrote:
 [EMAIL PROTECTED] wrote:


  The invokation of the foo-function goes somewhere in the line of:
 
 PyObject *up = PyBool_FromLong(1L);
 if (! up) PyErr_Print();
 
 PyObject *res = PyObject_CallFunction(action.u.button.u.s,
  (NIH),
 
 what happens if you use (OIH) instead ?
 
 /F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in sci/tech applications

2006-11-03 Thread Robert Kern
Magnus Lycka wrote:
 robert wrote:
 When one follows ..
 http://docs.python.org/inst/tweak-flags.html#SECTION000622000 
 http://www.zope.org/Members/als/tips/win32_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?
 
 As far as I understand, there should be only one runtime library
 involved. MinGW relies on the Microsoft runtime. It seems some
 people have had problems using MSVCRT71 with MinGW, but I'm sure
 that e.g. the Enthought people can explain those issues, since they
 bundle MinGW in their Python 2.4 distribution.

No, there are two if you use an unmodified Mingw distribution. Mingw is built 
around MSVCRT.dll . For many extensions, this doesn't cause a problem since 
things like FILE pointer don't cross C runtime boundaries. One can edit gcc's 
spec file to make it use MSVCR71.dll . However, Mingw's headers are still 
written for MSVCRT.dll and Microsoft changed some of the internal details that 
they rely upon. For many (most?) extensions, this won't matter, either. C++ 
extensions using iostreams have a problem, IIRC. Unfortunately, neither 
approach 
works for all extensions. It may even be the case that some extensions won't 
work under *either* method.

-- 
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

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Converting Microsoft Works databases.... *shudder*

2006-11-03 Thread GISDude
Mike,
I totally forgot that MS Works was out there. Haven't used that one in
about 6 or 7 years. Honestly, your best bet is to convert to .csv or
some delimited .txt file. Once that is done, all your rows/columns will
be nice and neat .
Once that is done, (and since your client doesn't have ACCESS, try
MYSQL or POSTGRESQL(they are open source). They can handle A LOT OF
DATA, so however big your orginal DB is, you can import it to one of
these more than capable OS freebie Databases.

Good luck
Michael B. Trausch wrote:
 I was wondering if anyone has had any experience with this.  Someone I
 know is trying to move away from Microsoft Works, and I am trying to
 look into a solution that would convert their data in a lossless fashion
 to a more modern format.  The database has more than 65K rows, so
 converting it to be an Excel spreadsheet, would, AFAIK, not be an option.

 It would seem that MS Works can export the database as a DBF format
 database, though I have not tried it.  Before I get started, I was
 wondering if anyone has been through this problem in the past and used
 Python to solve the problem.  Knowing nearly nothing about the DBase
 family of application software, and database formats, I find myself
 feeling like the information out there is, frankly, a bit overwhelming.

 Would the recipe specified in the dbf to csv thread be useful here for
 a file in DBase IV format?  It of course uses the same extension, but I
 am not sure if the file semantics are at all similar.  The idea at the
 end would be to probably create a database on an small SQL server (like
 MySQL) and let the person access their data using ODBC on their Windows
 workstation so that they can create form letters and the like.  They do
 not have access to MS Office's Access product, nor do they wish to use
 OOo Base (and I can't say that I blame them -- it seems to crash far too
 often to be considered reliable stuff).
 
   -- Mike

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: SE 2.3 temporarily unavailable. Cheese shop defeats upload with erratic behavior. Urgently requesting help.

2006-11-03 Thread jim-on-linux
On Friday 03 November 2006 08:21, Steve Holden 
wrote:
 Frederic Rentsch wrote:
  jim-on-linux wrote:
 Frederic,
 
 I've been trying to get back into my package
  in the Cheese Shop for over a year. The
  phone company changed my e:mail address and
  to make a long and frustrating story short I
  can't get back into the Cheese Shop to make
  changes to my file.
 
 Time is money.  At some time you have to
  consider if it is worth it.  At least you
  have the name of your program listed.
 
 I wish I could be more helpfull. I'll watch
  the responses you get from others.
 
 Good Luck,
 jim-on-linux
 
 http://www.inqvista.com
 
 On Thursday 02 November 2006 09:00, you wrote:
 Some time ago I had managed to upload a
  small package to the Cheese Shop using the
  data entry template. Uploading is in two
  steps: first the text then the package
  file. When I had a new version it went like
  this: The new text made a new page, but the
  new file went to the old
 
 snip
 
  Thanks for letting me know that I am not
  alone. Do you know of an alternative to the
  Cheese Shop?

 Surely the correct answer to this problem is to
 get the Cheese Shop fixed, not to migrate away
 from it? To whom (besides this list) have you
 communicated the problem, and with what
 results?

I emailed and emailed,  I got one response but 
nothing changed.

I suggest that the Cheese Shop also forward copies 
of help request to a site like this or similar. 
At least the sender knows that someone will read  
the email and help is on the way.

Also, my guess is that before these postings of 
the last few days, 65% of the people on this site 
never heard of The Cheese Shop,  Postings like 
these can only help The Cheese Shops.   

jim-on-linux

http://www.inqvista.com



 Remember that python.org is run by volunteers,
 but they are mostly highly capable volunteers.
 This is probably just a change situation that
 wasn't anticipated in the design (we all make
 mistakes).

 A simple change of email address could probably
 be achieved by tweaking the data for one or two
 individuals, and an automated solution should
 clearly be added as volumes build up.

 For now, how about a link that causes someone
 to receive email? I'd be surprised if this
 couldn't be used to handle low-volume changes
 with adequate security.

 regards
   Steve
 --
 Steve Holden   +44 150 684 7255  +1 800 494
 3119 Holden Web LLC/Ltd 
 http://www.holdenweb.com Skype: holdenweb  
 http://holdenweb.blogspot.com Recent Ramblings 
http://del.icio.us/steve.holden
-- 
http://mail.python.org/mailman/listinfo/python-list


Is there a way to define a true global across modules?

2006-11-03 Thread Hendrik van Rooyen
I am struggling with this - I want to define a system-wide flag for use as a
semaphore.

It looks to me as if the only way to do it is to import all the modules that
need to access it into the main namespace using the  from whatever import * 
form.

Is there a way to have one global object known to the main module as well as say
two imported modules by using the global statement in the three places, while
using the normal import modname  form?

It looks as if the global statement just makes the name global to the module
where it is defined, and if I use the import modname form I end up with a
local global for each module, as well as one for the main module...

Can they be merged' into one without sticking everything into the same
namespace?

I can think of ways to work around this, but it gets a bit obfuscatory - it
would be nicer to have one name, one thing in all three places...

- Hendrik

-- 
http://mail.python.org/mailman/listinfo/python-list


Tools for Java/Python scripting

2006-11-03 Thread Steve
I have added a page to the wiki, listing  tools for Java-Python
scripting (Java-Python interoperability).

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

I have included information about all of the tools that I could find.
If you know others, please add information about them to the page.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is mod_python borked?

2006-11-03 Thread Magnus Lycka
walterbyrd wrote:
 *sigh* maybe I'll just use php until the web-hosters catch up, if they
 ever do.

The first general availability release of Apache 2.0 (2.0.35) appeared
in April 2002. There are many ISPs. Perhaps you should limit yourself
to those who lag behind less than four years? I can understand that it
isn't always so easy. If you're approached by a client who has a web
site up and running on some backwards ISP, it might not be so easy to
get them to move their site or place parts of it on a separate server.

Hopefully, virtual server prices will continue to drop and become more
of a normal choice fairly soon.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to define a true global across modules?

2006-11-03 Thread Fredrik Lundh
Hendrik van Rooyen wrote:

 I am struggling with this - I want to define a system-wide flag for use as a
 semaphore.

http://www.effbot.org/pyfaq/how-do-i-share-global-variables-across-modules.htm

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Best way to have intermediate object description format

2006-11-03 Thread Larry Bates
[EMAIL PROTECTED] wrote:
 Hi,
  Is there any standard text format for storing data of object oriented
 nature.
  The text file should be readable.
 
 That is, Is there any better way than having to write out a file like
 this from the original place and read it in python and process it.
 
 #
 world = World(name='MyWorld')
 world.objects.append(Box(color='red'))
 world.objects.append(Circle(color='green'))
 world.someProp = 123
 #-
 
 Thanks.
 Suresh
 
While it is a little hard to determine your exact use case, I'll
try.  I have an application that dynamically creates objects from
.INI configuration file.  I use ConfigParser to process it.  The
entries are something like the following:

[world_MyWorld]
object_001=Box(color='red')
object_002=Circle(color='green')
property_someProp=123
property_someOtherProp=XYZ

I then read using ConfigParser and use list comprehensions to isolate
what I'm looking for in the file. Code not tested, but should serve as
and example and I think you will get the idea.  Note: Please don't get
too caught up in premature optimization.  I use this to process .INI
files with thousands of lines and it goes through the process in fractions
of a second.

-Larry


Sample Code (written completely from my memory):

INI=ConfigParser.ConfigParser()
INI.read(inifilepath)
#
# Get a list of the world sections in the .INI file
#
world_sections=[section for section in INI.sections()
if section.beginswith('world')
.
. Get lists of any other objects/sections here
.
#
# Create a list to store your instances of world_objects
#
world_instances=[]
#
# Loop over all the sections in the .INI file that create world objects
#
for section in world_sections:
#
# Isolate the name of this world object
#
name=section.split('_')[1]
obj=World(name=name)
#
# Create a list to store world instance objects here
#
world_objects=[object for object in INI.options(section)
   if object.startswith('object')]
#
# Loop over all the instance objects defined and append them here
#
for object in world_objects:
#
# Use eval to create object then append it.  Note: eval is
# dangerous if you don't control the .INI file.  Untrusted .INI
# file could have eval doing BAD things.
#
obj.append(eval(object))
#
# Create a list to store world instance properties here
#
world_properties=[object for object in INI.options(section)
   if object.startswith('property')]
#
# Loop over all the instance objects defined and append them here
#
for property in world_properties:
value=INI.get(section, property)
property_name=property.split('_')[1]
#
# Use setattr to set the property
#
setattr(obj, property_name, value)

#
# Append this world object onto the list
#
world_instances.append(obj)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Converting Microsoft Works databases.... *shudder*

2006-11-03 Thread Larry Bates
Michael B. Trausch wrote:
 I was wondering if anyone has had any experience with this.  Someone I
 know is trying to move away from Microsoft Works, and I am trying to
 look into a solution that would convert their data in a lossless fashion
 to a more modern format.  The database has more than 65K rows, so
 converting it to be an Excel spreadsheet, would, AFAIK, not be an option.
 
 It would seem that MS Works can export the database as a DBF format
 database, though I have not tried it.  Before I get started, I was
 wondering if anyone has been through this problem in the past and used
 Python to solve the problem.  Knowing nearly nothing about the DBase
 family of application software, and database formats, I find myself
 feeling like the information out there is, frankly, a bit overwhelming.
 
 Would the recipe specified in the dbf to csv thread be useful here for
 a file in DBase IV format?  It of course uses the same extension, but I
 am not sure if the file semantics are at all similar.  The idea at the
 end would be to probably create a database on an small SQL server (like
 MySQL) and let the person access their data using ODBC on their Windows
 workstation so that they can create form letters and the like.  They do
 not have access to MS Office's Access product, nor do they wish to use
 OOo Base (and I can't say that I blame them -- it seems to crash far too
 often to be considered reliable stuff).
 
   -- Mike
MS ships ODBC interface to xBase databases in all versions of Windows.
You don't need Access.  Just create DSN to your exported dBase database
and MS Word, MS Excel, and any other ODBC aware product can read the
data.  If the data size is large or if you want to move to server, you
can do that later.

-Larry
-- 
http://mail.python.org/mailman/listinfo/python-list


setting up wxPython on a Mac

2006-11-03 Thread Brian Blais
Hello,

I have a wxPython program that I would like to give to a friend of mine who has 
a 
Mac.  Is there a resource out there that can tell me what steps I need to 
follow to 
do this?  Under windows, I would just install Enthought, and it would work 
without 
any modifications.  I don't know Macs all that well, but is there something 
similar?

Thanks,


Brian Blais

-- 
-

  [EMAIL PROTECTED]
  http://web.bryant.edu/~bblais
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: setting up wxPython on a Mac

2006-11-03 Thread Kevin Walzer
Brian Blais wrote:
 Hello,
 
 I have a wxPython program that I would like to give to a friend of mine
 who has a Mac.  Is there a resource out there that can tell me what
 steps I need to follow to do this?  Under windows, I would just install
 Enthought, and it would work without any modifications.  I don't know
 Macs all that well, but is there something similar?
 
 Thanks,
 
 
 Brian Blais
 
Install Python from the Python website--a Python 2.5 installer is
available for the Mac.

Install wxPython from the wxPython website--an installer for the latest
version of wxPython for the Mac is also available.

That should do it.

-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: SE 2.3. Available now

2006-11-03 Thread Gary Herron
Frederic Rentsch wrote:
 A few Cheese Shop upload problems have been solved with the help of this 
 creative group. Thank you all!

 Version 2.2 beta should be phased out. It has a functional defect, 
 missing matches with a very low statistical probability. Version 2.3 has 
 this fixed.

Download URL: http://cheeseshop.python.org/pypi/SE/2.3
   
As a matter of polite netiquette, a message like this really ought to
have a paragraph telling us what SE *is*.(Unless it's a secret :-))

 A list of possible handling improvements is being made to be 
 incorporated in the next version, One major flaw of the interface design 
 came to light the other day when a user reported a non-functioning 
 Editor Object made with a file name. If the constructor cannot find the 
 file it records the fact in the object's log without making the user 
 aware that his Editor Object is incomplete or altogether devoid of 
 substitutions. His obvious conclusion is that the damn thing isn't 
 working right.
Compile errors should certainly be reported at compile time. The next 
 version will send all messages being logged also to stderr by default. 
 The thing to do with the current version, if it appears to malfunction, 
 is to inspect the log and the compiled substitutions.

   Editor = SE.SE ('operators.se')
   Editor.show_log ()

 Fri Nov 03 12:49:17 2006 - Compiler - Ignoring single word 
 'operators.se'. Not an existing file 'operators.se'.

   Editor = SE.SE ('se/operators.se')   # path was missing
   Editor.show_log ()

 (Log is empty. All is well.)

   Editor.show (show_translators = 1)

 (snip)

 Single-Byte Targets
 1: ||-|LT|
 2: ||-|GT|

 Multi-Byte Targets
 3: ||-|AND|
 4: -|OR|

 etc...

 The display makes definition errors conspicuous. Missing definitions 
 indicate malformed or redefined (overwritten) ones.


 Frederic


   

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tools for Java/Python scripting

2006-11-03 Thread skip

steve http://wiki.python.org/moin/Java_Scripting

Renamed to JavaScripting.

Skip
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tools for Java/Python scripting

2006-11-03 Thread Paul Boddie
[EMAIL PROTECTED] wrote:
 steve http://wiki.python.org/moin/Java_Scripting

 Renamed to JavaScripting.

You might want to coordinate this amongst yourselves: the original page
is still being edited whilst the new one remains as a snapshot of the
original page at the point of renaming.

Paul

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: SE 2.3. Available now

2006-11-03 Thread Fredrik Lundh
Gary Herron wrote:

 As a matter of polite netiquette, a message like this really ought to
 have a paragraph telling us what SE *is*.(Unless it's a secret :-))

nah, if you've spent more than five minutes on c.l.python lately, you'd 
noticed that it's the Solution to Everything (up there with pyparsing, I 
think).

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Keyboard interrupts, Idle vs. SciTE

2006-11-03 Thread John Ladasky
Thanks for the SciTE info, Neil.

Yes, it was silly of me to forget to state that I'm using Win32.
Normally, when I post to comp.lang.python, I remember to include that
fact... :^P

+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|   Ladasky Home Solar, Inc.:  blowing sunshine up your   |
|   power grid since March 24, 2005.  Fiat lux!   |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|   UptimeDowntimekWh generated kWh consumed  |
|   584 days  6.5 hours   1095310982  |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tools for Java/Python scripting

2006-11-03 Thread Rob Williscroft
 wrote in news:[EMAIL PROTECTED] in 
comp.lang.python:

 
 steve http://wiki.python.org/moin/Java_Scripting
 
 Renamed to JavaScripting.
 
 Skip

So nobody around here has heared of that other language 
called JavaScript then ?

Perhaps Scripting_Java might be better.

Pythoning-ly yr's Rob.
-- 
http://www.victim-prime.dsl.pipex.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Keyboard interrupts, Idle vs. SciTE

2006-11-03 Thread John Ladasky
Thanks Robert, I just poked around and found a PythonWin web page:

http://aspn.activestate.com/ASPN/docs/ActivePython/2.3/pywin32/html/pythonwin/readme.html

From other links it appears that SciTE was based on PythonWin, and not
the other way around.  For people coding in other languages besides
Python, switching from SciTE to PythonWin might be a step backward.
But probably not for me.  I'll give it a try.

+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|   Ladasky Home Solar, Inc.:  blowing sunshine up your   |
|   power grid since March 24, 2005.  Fiat lux!   |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|   UptimeDowntimekWh generated kWh consumed  |
|   584 days  6.5 hours   1095310982  |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-03 Thread robert
Daniel Dittmar wrote:
 robert wrote:
  Question Besides:  do concurrent INC/DEC machine OP-commands 
 execute atomically on Multi-Cores as they do in Single-Core threads?
 
 No on the level that that Python reference counting is implemented. The 
 CPUs have often special assembler ops for these operations. I think that 
 it's even more complicated as some machines require additional read and 
 write barriers around these operations.
 
 Take a look at IPython1 and it's parallel computing capabilities [1,
 [...]
 I do selected things with interprocess shared memory techniques 
 already. Thats medium efficent.
 Multiple interpreters inside one process seem to be most promising for 
 seemless multi-core programming. 
 
 Both IPython and Jython use multiple CPUs without the GIL, so you don't 
 need to add the complication of multiple interpreters.

(IPython is only a special python network terminal as already said.)

With Jython I'm not familiar. Yet I think going to Jython will first cost more 
performance than you can win - at least on only dual cores as we have now. In 5 
years with  8x MPU systems this may be different ... 
Does Jython really eliminate the GIL? What happens when different threads 
alter/read a dict concurrently - the basic operation in python, which is 
usually not protected by locks. Does Jython use a dict data type (and other 
collection types) which lock during _each_ access? in case - that may be very 
expensive.

   As all Python objects share the same
   malloc space - thats the key requirement in order to get the main
   effect. As soon as with have object pickling in between its well away
   from this very discussion.
 
 There's the complication that CPython has garbage collection in addition 
 to reference counting. I'm not sure what happens when the garbage 
 collector looks at objects rooted in another interpreter.

garbage is collected earliest, when the refcount went to 0. If it ever went to 
0, no one will ever use such object again. Thus GC should not be different at 
all.


robert
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: setting up wxPython on a Mac

2006-11-03 Thread Brian Blais
Kevin Walzer wrote:
 Brian Blais wrote:
 Hello,

 I have a wxPython program that I would like to give to a friend of mine
 who has a Mac.  Is there a resource out there that can tell me what
 steps I need to follow to do this? 

 Install Python from the Python website--a Python 2.5 installer is
 available for the Mac.
 
 Install wxPython from the wxPython website--an installer for the latest
 version of wxPython for the Mac is also available.
 
 That should do it.
 

sounds easy.  If I need the numpy/scipy/matplotlib combo, is it that 
straightforward? 
  On windows it is, on Linux is definitely is not.

thanks,

bb


-- 
-

  [EMAIL PROTECTED]
  http://web.bryant.edu/~bblais
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in sci/tech applications

2006-11-03 Thread robert
Robert Kern wrote:
 Magnus Lycka wrote:
 robert wrote:
 When one follows ..
 http://docs.python.org/inst/tweak-flags.html#SECTION000622000 
 http://www.zope.org/Members/als/tips/win32_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?

 As far as I understand, there should be only one runtime library
 involved. MinGW relies on the Microsoft runtime. It seems some
 people have had problems using MSVCRT71 with MinGW, but I'm sure
 that e.g. the Enthought people can explain those issues, since they
 bundle MinGW in their Python 2.4 distribution.
 
 No, there are two if you use an unmodified Mingw distribution. Mingw is 
 built around MSVCRT.dll . For many extensions, this doesn't cause a 
 problem since things like FILE pointer don't cross C runtime boundaries. 
 One can edit gcc's spec file to make it use MSVCR71.dll . However, 
 Mingw's headers are still written for MSVCRT.dll and Microsoft changed 
 some of the internal details that they rely upon. For many (most?) 
 extensions, this won't matter, either. C++ extensions using iostreams 
 have a problem, IIRC. Unfortunately, neither approach works for all 
 extensions. It may even be the case that some extensions won't work 
 under *either* method.

In past I asked for linking Python2.5 and next Pythons on Win against such 
standard DLL (MSVCRT4 or MSVCRT.DLL)- yet Martin v. Löwis somehow explained in  
http://groups.google.de/group/comp.lang.python/msg/fcbe41f9df595c35
somehow that MSVCRT.dll is not intended for normal apps - only for 
system-level components. 

Now I'm stun that MingW by default works with that library by default!
Another reason for my former request (in addition to ease of use with other 
compilers) was, that you don't have to package the big CRT7/8.. libs with 
frozen apps.


Robert
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Best way to have intermediate object description format

2006-11-03 Thread Paddy

[EMAIL PROTECTED] wrote:
 Thanks paddy, Since the original language from which I am translating
 does not support any of these formats, I will have to write one myself.
 So, which one is easy to write out in a C like environment.

 regards,
 Suresh
 Paddy wrote:
  [EMAIL PROTECTED] wrote:
   Hi,
Is there any standard text format for storing data of object oriented
   nature.
The text file should be readable.
  
   That is, Is there any better way than having to write out a file like
   this from the original place and read it in python and process it.
  
   #
   world = World(name='MyWorld')
   world.objects.append(Box(color='red'))
   world.objects.append(Circle(color='green'))
   world.someProp = 123
   #-
  
   Thanks.
   Suresh
 
  XML ?
  YAML ?
  JSON ?
  ConfigParser module ?
  CSV file ?
  UML ?
 
  I'm finding it hard to be more specific, given your original post. so
  just squirted some data formats that are supported by multiple
  languages and can be used to transfer data between them.
 
  P.S. I don't know why I put XML first :-)
  P.P.S. And UML seems to be about pretty diagrams rather than a textual
  format, but no doubt, with the size of the companies behind it, there's
  probably a textual format hidden in their too.
 
 
  - Paddy.
 Could you write out the data as a series of python dicts to file
ending in .py?,

If it is hard to write out the data in the language you are coming from
then it might be easier to stick to a simple format like CSV (comma
separated value/tab separated value), and then put more smarts in the
Python reader to reconstruct your objects.

- Paddy.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to define a true global across modules?

2006-11-03 Thread robert
Fredrik Lundh wrote:
 Hendrik van Rooyen wrote:
 
 I am struggling with this - I want to define a system-wide flag for 
 use as a
 semaphore.
 
 http://www.effbot.org/pyfaq/how-do-i-share-global-variables-across-modules.htm
  
 

Or worse style - if you are too lazy to create a extra global variables module 
(ab)use the __main__ module als global:


import __main__

__main__.mysemphore += 1



-robert
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-03 Thread Daniel Dittmar
robert wrote:
 (IPython is only a special python network terminal as already said.)

Sorry, I thought of IronPython, the .NET variant.

 Does Jython really eliminate the GIL? What happens when different 

Yes.

 threads alter/read a dict concurrently - the basic operation in python, 
 which is usually not protected by locks. Does Jython use a dict data 
 type (and other collection types) which lock during _each_ access? in 
 case - that may be very expensive.

True, though Java synchronization has gotten better and better. Still, 
Sun introduced non locking hash tables, so it was a problem. It'd be 
interesting to know which kind of dict is used in Jython for attribute 
access.
 
 garbage is collected earliest, when the refcount went to 0. If it ever 
 went to 0, no one will ever use such object again. Thus GC should not be 
 different at all.

Since Python 2.?, there's a mark-and-sweep garbage collection in 
addition to the reference counting scheme. This was put into Python to 
be able to reclaim object cycles.


Daniel
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in sci/tech applications

2006-11-03 Thread Robert Kern
robert wrote:
 In past I asked for linking Python2.5 and next Pythons on Win against such 
 standard DLL (MSVCRT4 or MSVCRT.DLL)- yet Martin v. Löwis somehow explained 
 in  
 http://groups.google.de/group/comp.lang.python/msg/fcbe41f9df595c35
 somehow that MSVCRT.dll is not intended for normal apps - only for 
 system-level components. 
 
 Now I'm stun that MingW by default works with that library by default!

This is what Martin said:


It used to be possible to link with it. See

http://msdn2.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx

This is now a known DLL, and meant for use by system-level components
only.


Note the words used to and now. Mingw is a somewhat old project and was 
initially developed at a time when MSVCRT.dll *was* intended to be used by 
applications. It simply hasn't received enough attention recently to move to a 
different runtime. If you would like to volunteer your time to do the necessary 
work to allow it to link to modern runtimes, please do so. You will receive the 
undying thanks of many, many Pythoneers.

-- 
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

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Forum written in Python?

2006-11-03 Thread slav0nic
http://diamanda.googlecode.com  forum + wiki
sorry i was mistaken fist link at previous post%)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: SE

2006-11-03 Thread Frederic Rentsch
C or L Smith wrote:
 Hello,

 I'm evaluating different methods of handling a transliteration (from an 
 ascii-based representation of the devanagari/indian script to a romanized 
 representation). I found SE and have been working with it today. One thing 
 that I ran into (that I don't see a reason for right off) is the behavior 
 where a single period just gets eaten and no output is produced:

   
 import SE
 s=SE.SE('.=period')
 s('A.')
 
 'Aperiod'
   
 s('.')
 

 It's not the fact that it's a single character target that is causing the 
 problem:

   
 s=SE.SE('x=y')
 s('x')
 
 'y'

 I also tried the following:

   
 s=SE.SE('(46)=dot')
 s('A.')
 
 'Adot'
   
 s('.')
 

 Am I missing something?

 /chris


   

No, you are not missing anything. Quite on the contrary. You caught 
something! Thanks for the report.

Here's the patch:

Line 343 in SEL.py is:  if name == '':

Make it:if name.replace ('.', '') == '':

In Version 2.2 it's line 338. But Version 2.2 should be phased out anyway.

The problem had to do with the automatic typing of the input data that 
tells string input from file names, which of course are also strings. 
The test is done by os.stat (). If it says an input string is an 
existing file, then that file is translated. Admittedly this is not a 
very robust mechanism. In practice, though, I have never had a problem 
with it, because input data just about never are single words. If names 
of existing files are the object of a translation they would be passed 
all together and be unambiguously recognized as a string. To translate a 
single file name SE is hardly a means of choice, but it could still be 
done if the file name is given a leading space.
   Now, if a single dot (or multiple dots) come along, os.stat does not 
raise an error and that results in a typing error at that point. The 
patch above takes care of that.

Frederic
















-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MemoDepot: build YOUR OWN online notes library - anything, anytime, anywhere

2006-11-03 Thread Terry Reedy

ompaniess [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
[spam snipped]
 Any comments or suggestions, send to: [EMAIL PROTECTED]
[cc'ed]
Don't spam random technical newsgroups with completely off-topic posts.
Such constitute anti-advertising.



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: setting up wxPython on a Mac

2006-11-03 Thread Kevin Walzer
Brian Blais wrote:
 Kevin Walzer wrote:
 Brian Blais wrote:
 Hello,

 I have a wxPython program that I would like to give to a friend of mine
 who has a Mac.  Is there a resource out there that can tell me what
 steps I need to follow to do this?
 Install Python from the Python website--a Python 2.5 installer is
 available for the Mac.

 Install wxPython from the wxPython website--an installer for the latest
 version of wxPython for the Mac is also available.

 That should do it.

 
 sounds easy.  If I need the numpy/scipy/matplotlib combo, is it that
 straightforward?  On windows it is, on Linux is definitely is not.
 
 thanks,
 
 bb
 
 
I'm not sure about numpy/scipy/matplotlib. I don't think there are
pre-built packages for them; you may have to build them from source. You
could also post to the MacPython mailing list, someone there has
probably looked at this already.

-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: SE 2.3. Available now

2006-11-03 Thread Frederic Rentsch
Gary Herron wrote:
 Frederic Rentsch wrote:
   
 A few Cheese Shop upload problems have been solved with the help of this 
 creative group. Thank you all!

 Version 2.2 beta should be phased out. It has a functional defect, 
 missing matches with a very low statistical probability. Version 2.3 has 
 this fixed.

Download URL: http://cheeseshop.python.org/pypi/SE/2.3
   
 
 As a matter of polite netiquette, a message like this really ought to
 have a paragraph telling us what SE *is*.(Unless it's a secret :-))

   
Thanks for the inquiry. I've been hawking this thing so persistently of 
late that I'm afraid to start being perceived as a nuisance. SE is a 
stream editor that is particularly easy  and fast to use. A summary of 
its characteristics is only a click away at the URL a few lines up from 
this line.

Frederic
 A list of possible handling improvements is being made to be 
 incorporated in the next version, One major flaw of the interface design 
 came to light the other day when a user reported a non-functioning 
 Editor Object made with a file name. If the constructor cannot find the 
 file it records the fact in the object's log without making the user 
 aware that his Editor Object is incomplete or altogether devoid of 
 substitutions. His obvious conclusion is that the damn thing isn't 
 working right.
Compile errors should certainly be reported at compile time. The next 
 version will send all messages being logged also to stderr by default. 
 The thing to do with the current version, if it appears to malfunction, 
 is to inspect the log and the compiled substitutions.

   Editor = SE.SE ('operators.se')
   Editor.show_log ()

 Fri Nov 03 12:49:17 2006 - Compiler - Ignoring single word 
 'operators.se'. Not an existing file 'operators.se'.

   Editor = SE.SE ('se/operators.se')   # path was missing
   Editor.show_log ()

 (Log is empty. All is well.)

   Editor.show (show_translators = 1)

 (snip)

 Single-Byte Targets
 1: ||-|LT|
 2: ||-|GT|

 Multi-Byte Targets
 3: ||-|AND|
 4: -|OR|

 etc...

 The display makes definition errors conspicuous. Missing definitions 
 indicate malformed or redefined (overwritten) ones.


 Frederic


   
 

   


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: SE 2.3 temporarily unavailable. Cheese shop defeats upload with erratic behavior. Urgently requesting help.

2006-11-03 Thread Steve Holden
jim-on-linux wrote:
 On Friday 03 November 2006 08:21, Steve Holden 
 wrote:
 
Frederic Rentsch wrote:

jim-on-linux wrote:

Frederic,

I've been trying to get back into my package
in the Cheese Shop for over a year. The
phone company changed my e:mail address and
to make a long and frustrating story short I
can't get back into the Cheese Shop to make
changes to my file.

Time is money.  At some time you have to
consider if it is worth it.  At least you
have the name of your program listed.

I wish I could be more helpfull. I'll watch
the responses you get from others.

Good Luck,
jim-on-linux

http://www.inqvista.com

On Thursday 02 November 2006 09:00, you wrote:

Some time ago I had managed to upload a
small package to the Cheese Shop using the
data entry template. Uploading is in two
steps: first the text then the package
file. When I had a new version it went like
this: The new text made a new page, but the
new file went to the old

snip

Thanks for letting me know that I am not
alone. Do you know of an alternative to the
Cheese Shop?

Surely the correct answer to this problem is to
get the Cheese Shop fixed, not to migrate away
from it? To whom (besides this list) have you
communicated the problem, and with what
results?
 
 
 I emailed and emailed,  I got one response but 
 nothing changed.
 
 I suggest that the Cheese Shop also forward copies 
 of help request to a site like this or similar. 
 At least the sender knows that someone will read  
 the email and help is on the way.
 
 Also, my guess is that before these postings of 
 the last few days, 65% of the people on this site 
 never heard of The Cheese Shop,  Postings like 
 these can only help The Cheese Shops.   
 
 jim-on-linux
 
 http://www.inqvista.com
 
 
 
Remember that python.org is run by volunteers,
but they are mostly highly capable volunteers.
This is probably just a change situation that
wasn't anticipated in the design (we all make
mistakes).

A simple change of email address could probably
be achieved by tweaking the data for one or two
individuals, and an automated solution should
clearly be added as volumes build up.

For now, how about a link that causes someone
to receive email? I'd be surprised if this
couldn't be used to handle low-volume changes
with adequate security.

I am forwarding this mail to the group that maintains the web site.

Note that

   http://cheeseshop.python.org/pypi

like most python.org pages does have a report web site bug link. I'm 
not sure whether this requires you to register for an account, as I know 
that Trac spam has been a problem, but there are ways to get the 
attention of the site maintainers (besides posting on c.l.py, where 
basically you are hoping that a webmaster or someone who knows the 
webmasters will see your message).

webmaster at python.org is another good address to remember ;-)

Anyway, I hope this gets the issue addressed. No promises, though: 
remember that all webmasters are volunteers.

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd  http://www.holdenweb.com
Skype: holdenweb   http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden
-- 
http://mail.python.org/mailman/listinfo/python-list


py2exe questions

2006-11-03 Thread Doug Stell
I have 2 questions about py2exe or any similar utility.

1. Is it possible to create a single Windows executable that does not
blow out to a folder full of files and can be called from scripts
using command line arguments?

2. If the above can be done, it is possible to hide parts of the
Python source code from users? These users are software developers,
but we don't want them to see how the code does what it does.

thanks, doug
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: SE 2.3. Available now

2006-11-03 Thread Frederic Rentsch
Fredrik Lundh wrote:
 Gary Herron wrote:

   
 As a matter of polite netiquette, a message like this really ought to
 have a paragraph telling us what SE *is*.(Unless it's a secret :-))
 

 nah, if you've spent more than five minutes on c.l.python lately, you'd 
 noticed that it's the Solution to Everything (up there with pyparsing, I 
 think).

 /F

   
And here's the proof I am being perceived as a nuisance. I apologize, 
keeping to myself that I don't care.

Frederic


-- 
http://mail.python.org/mailman/listinfo/python-list


python-dev Summary for 2006-09-16 through 2006-09-30

2006-11-03 Thread steven . bethard
python-dev Summary for 2006-09-16 through 2006-09-30


.. contents::

[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2006-09-16_2006-09-30]



=
Summaries
=

---
Import features
---

Fabio Zadrozny ran into the `previously reported relative import issues`_ where 
a ``from . import xxx`` always fails from a top-level module. This is because 
relative imports rely on the ``__name__`` of a module, so when it is just 
``__main__``, they can't handle it properly.

On the subject of imports, Guido said that one of the missing import features 
was to be able to say *this* package lives *here*. Paul Moore whipped up a 
Python API to an import hook that could do this, but indicated that a full 
mechanism would need to pay more attention to the environment (e.g. PYTHONPATH 
and .pth files).

There was also some discussion about trying to have a sort of per-module 
``sys.path`` so that you could have multiple versions of the same module 
present, with different modules importing different versions. Phillip J. Eby 
suggested that this was probably not a very common need, and that implementing 
it would be quite difficult with things like C extensions only being able to be 
loaded once.

In general, people seemed interested in a pure-Python implementation of the 
import mechanism so that they could play with some of these approaches. It 
looked like Brett Cannon would probably be working on that.

.. _previously reported relative import issues: 
http://www.python.org/dev/summary/2006-06-16_2006-06-30/#relative-imports-and-pep-338-executing-modules-as-scripts

Contributing thread:

- `New relative import issue 
http://mail.python.org/pipermail/python-dev/2006-September/068806.html`__


Python library documentation


A less-trolly-than-usual post from Xah Lee started a discussion about the 
Python documentation.  Greg Ewing and others suggested following the 
documentation style of the Inside Macintosh series: first an About this 
module narrative explaining the concepts and how they fit together, followed 
by the extensive API reference. Most people agreed that simply extracting the 
documentation from the docstrings was a bad idea -- it lacks the high-level 
overview and gives equal importance to all functions, regardless of their use.

Contributing thread:

- `Python Doc problems 
http://mail.python.org/pipermail/python-dev/2006-September/069023.html`__

---
OS X universal binaries
---

Jack Howarth asked about creating universal binaries for OS X that would 
support 32-bit or 64-bit on both PPC and x86. Ronald Oussoren pointed out that 
the 32-bit part of this was already supported, but indicated that adding 64-bit 
support simultaneously might be more difficult. Ronald and Martin v. Lowis 
discussed strategies for modifying pyconfig.h, though it seemed these solutions 
might cause distutils to detect some architecture features incorrectly. Martin 
suggested that this was more a problem of distutils than pyconfig.h.

Contributing thread:

- `python, lipo and the future? 
http://mail.python.org/pipermail/python-dev/2006-September/068800.html`__

--
Finer-grained locking than the GIL
--

Martin Devera was looking into replacing the global interpreter lock (GIL) with 
finer-grained locking, tuned to minimize locking by assuming that most objects 
were used only by a single thread. For objects that were shared across multiple 
threads, this approach would allow non-blocking reads, but require all threads 
to come home before modifications could be made. Phillip J. Eby pointed out 
that most object accesses in Python are actually modifications too, due to 
reference counting, so it looked like Martin's proposal wouldn't work well with 
the current refcounting implementation of Python. After Martin v. Lowis found a 
bug in the locking algorithm, Martin Devera decided to take his idea back to 
the drawing board.

Contributing thread:

- `deja-vu .. python locking 
http://mail.python.org/pipermail/python-dev/2006-September/068828.html`__

---
OS X and ssize_t formatting
---

The buildbots spotted an OS X error in the itertools module. After Jack 
Diederich fixed a bug where ``size_t`` had been used instead of ``ssize_t``, 
Neal Norwitz noticed some problems with ``%zd`` on OS X. Despite documentation 
to the contrary in both the man page and the C99 Standard, using that specifier 
on OS X treats a negative number as an unsigned number. Ronald Oussoren and 
others reported the bug to Apple.

Contributing thread:

- `test_itertools fails for trunk on x86 OS X machine 
http://mail.python.org/pipermail/python-dev/2006-September/068898.html`__

---
itertools.flatten()

python-dev Summary for 2006-09-01 through 2006-09-15

2006-11-03 Thread steven . bethard
python-dev Summary for 2006-09-01 through 2006-09-15


.. contents::

[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2006-09-01_2006-09-15]



=
Announcements
=


QOTF: Quote of the Fortnight


Through a cross-posting slip-up, Jean-Paul Calderone managed to provide us with 
some inspiring thoughts on mailing-list archives:

One could just as easily ask why no one bothers to read mailing list
archives to see if their question has been answered before.

No one will ever know, it is just one of the mysteries of the universe.

Contributing thread:

- `[Twisted-Python] Newbie question 
http://mail.python.org/pipermail/python-dev/2006-September/068682.html`__

-
Monthly Arlington sprints
-

Jeffrey Elkner has arranged for monthly Arlington Python sprints. See the 
`Arlington sprint wiki`_ for more details.

.. _Arlington sprint wiki: http://wiki.python.org/moin/ArlingtonSprint

Contributing thread:

- `Arlington sprints to occur monthly 
http://mail.python.org/pipermail/python-dev/2006-September/068688.html`__

=
Summaries
=

-
Signals, threads and blocking C functions
-

Gustavo Carneiro explained a problem that pygtk was running into.  Their main 
loop function, ``gtk_main()``, blocks forever. If there are threads in the 
program, they cannot receive signals because Python catches the signal and 
calls ``Py_AddPendingCall()``, relying on the main thread to call 
``Py_MakePendingCalls()``.  Since with pygtk, the main thread is blocked 
calling a C function, it has no way other than polling to decide when 
``Py_MakePendingCalls()`` needs to be called.  Gustavo was hoping for some sort 
of API so that his blocking thread could get notified when 
``Py_AddPendingCall()`` had been called.

There was a long discussion about the feasibility of this and other solutions 
to his problem. One of the main problems is that almost nothing can safely be 
done from a signal handler context, so some people felt like having Python 
invoke arbitrary third-party code was a bad idea. Gustavo was reasonably 
confident that he could write to a pipe within that context, which was all he 
needed to do to solve his problem, but Nick Maclaren explained in detail some 
of the problems, e.g. writing proper synchronization primitives that are 
signal-handler safe.

Jan Kanis suggested that threads in a pygtk program should occasionally check 
the signal handler flags and calls PyGTK's callback to wake up the main thread. 
But Gustavo explained that things like the GnomeVFS library have their own 
thread pools and know nothing about Python so can't make such a callback.

Adam Olsen suggested that Python could create a single non-blocking pipe for 
all signals. When a signal was handled, the signal number would be written to 
that pipe as a single byte. Third-party libraries, like pygtk, could poll the 
appropriate file descriptor, waking up and handing control back to Python when 
a signal was received. There were some disadvantages to this approach, e.g. if 
there is a large burst of signals, some of them would be lost, but folks seemed 
to think that these kinds of things would not cause many real-world problems. 
Gustavo and Adam then worked out the code in a little more detail.

The `Py_signal_pipe patch`_ was posted to SourceForge.

.. _Py_signal_pipe patch: http://bugs.python.org/1564547

Contributing thread:

- `Signals, threads, blocking C functions 
http://mail.python.org/pipermail/python-dev/2006-September/068569.html`__


API for str.rpartition()


Raymond Hettinger pointed out that in cases where the separator was not found, 
``str.rpartition()`` was putting the remainder of the string in the wrong spot, 
e.g. ``str.rpartition()`` worked like::

'axbxc'.rpartition('x') == ('axb', 'x', 'c')
'axb'.rpartition('x') == ('a', 'x', 'b')
'a'.rpartition('x') == ('a', '', '')  # should be ('', '', 'a')

Thus code that used ``str.rpartition()`` in a loop or recursively would likely 
never terminate. Raymond checked in a fix for this, spawning an enormous 
discussion about how the three bits ``str.rpartition()`` returns should be 
named.  There was widespread disagreement on which side was the head and 
which side was the tail, and the only unambiguous one seemed to be left, 
sep, right. Raymond and others were not as happy with this version because it 
was no longer suggestive of the use cases, but it looked like this might be the 
best compromise.

Contributing threads:

- `Problem withthe API for str.rpartition() 
http://mail.python.org/pipermail/python-dev/2006-September/068565.html`__
- `Fwd: Problem withthe API for str.rpartition() 

Sorted and reversed on huge dict ?

2006-11-03 Thread vd12005
Hello,

i would like to sort(ed) and reverse(d) the result of many huge
dictionaries (a single dictionary will contain ~ 15 entries). Keys
are words, values are count (integer).

i'm wondering if i can have a 10s of these in memory, or if i should
proceed one after the other.

but moreover i'm interested in saving theses as values, keys sorted and
reversed (ie most frequent first), i can do it with sort from unix
command but i wonder how i should do it with python to be memory
friendly.

can it be done by using :

from itertools import izip
pairs = izip(d.itervalues(), d.iterkeys())
for v, k in reversed(sorted(pairs)):
print k, v

or will it be the same as building the whole list ?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tools for Java/Python scripting

2006-11-03 Thread Steve
The URL is now:
http://wiki.python.org/moin/JavaScripting

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: SE 2.3. Available now

2006-11-03 Thread Fredrik Lundh
Frederic Rentsch wrote:

 And here's the proof I am being perceived as a nuisance. I apologize, 
 keeping to myself that I don't care.

since you're constantly targeting newbies, and are hawking your stuff 
also for things for which there are simple and efficient solutions 
available in Python's standard library, your behavior could be seen
as more than just a nuisance.

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sorted and reversed on huge dict ?

2006-11-03 Thread Paul Rubin
[EMAIL PROTECTED] writes:
 i would like to sort(ed) and reverse(d) the result of many huge
 dictionaries (a single dictionary will contain ~ 15 entries). Keys
 are words, values are count (integer).
 
 i'm wondering if i can have a 10s of these in memory, 

Depends on how much memory your machine has.

 or if i should proceed one after the other.

Obviously that's more memory friendly if you can do it that way.

 from itertools import izip
 pairs = izip(d.itervalues(), d.iterkeys())
 for v, k in reversed(sorted(pairs)):
 print k, v
 
 or will it be the same as building the whole list ?

I think the above is pretty good.  sorted necessarily builds and
returns a list, but itervalues/iterkeys, izip, and reversed, just
build small iterator objects.

If the lists are really large, your next step after the above is
probably to use an external sort, but 15 entries is not that many,
and anyway if sorting is a strain on available memory, then having the
dicts in memory at all will probably also be a strain.  Maybe you
should start looking into storing the dict contents externally, such
as in a database.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sorted and reversed on huge dict ?

2006-11-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote:

 i would like to sort(ed) and reverse(d) the result of many huge
 dictionaries (a single dictionary will contain ~ 15 entries). Keys
 are words, values are count (integer).

not sure 150k entries qualify as huge, though, unless you're short on 
memory.

 i'm wondering if i can have a 10s of these in memory, or if i should
 proceed one after the other.

why not just try it out?

 but moreover i'm interested in saving theses as values, keys sorted and
 reversed (ie most frequent first), i can do it with sort from unix
 command but i wonder how i should do it with python to be memory
 friendly.
 
 can it be done by using :
 
 from itertools import izip
 pairs = izip(d.itervalues(), d.iterkeys())
 for v, k in reversed(sorted(pairs)):
 print k, v
 
 or will it be the same as building the whole list ?

sorted() needs access to all data, so it'll build a list, even if you 
feed it a generator.  you will have to test it yourself, but I suspect 
that the most memory-efficient way to do what you want could be:

 items = d.items()
 items.sort(key=operator.itemgetter(1), reverse=True)

the items list would require a couple of megabytes for 150k dictionary 
entries, or so.  the key map needs some memory too, but the rest of the 
sort is done in place.

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Converting Microsoft Works databases.... *shudder*

2006-11-03 Thread Steve Holden
Larry Bates wrote:
 Michael B. Trausch wrote:
 
I was wondering if anyone has had any experience with this.  Someone I
know is trying to move away from Microsoft Works, and I am trying to
look into a solution that would convert their data in a lossless fashion
to a more modern format.  The database has more than 65K rows, so
converting it to be an Excel spreadsheet, would, AFAIK, not be an option.
[...]
 MS ships ODBC interface to xBase databases in all versions of Windows.
 You don't need Access.  Just create DSN to your exported dBase database
 and MS Word, MS Excel, and any other ODBC aware product

Including, presumably, mx.ODBC in Python, which gives the most 
attractive possibilities for output.

  can read the
 data.  If the data size is large or if you want to move to server, you
 can do that later.
 
regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd  http://www.holdenweb.com
Skype: holdenweb   http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sorted and reversed on huge dict ?

2006-11-03 Thread Paul Rubin
Fredrik Lundh [EMAIL PROTECTED] writes:
  items = d.items()
  items.sort(key=operator.itemgetter(1), reverse=True)
 
 the items list would require a couple of megabytes for 150k dictionary
 entries, or so.  the key map needs some memory too, but the rest of
 the sort is done in place.

I think the OP's method avoided the key map.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Javascript is turning into Python?!

2006-11-03 Thread MC
Hi!

 (ECMAscript), then, well I haven't seen any progress there.

1) in IE-7, the last release (of JScript) has few evolutions (more 
important, a new garbage collector)

2) in Windows, with Active-Scripting, it's possible to integrate 
JScript in Python, call JScript's functions from Python's code, call 
Python's functions from JScript's code, etc.

-- 
@-salutations

Michel Claveau


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sorted and reversed on huge dict ?

2006-11-03 Thread Fredrik Lundh
Paul Rubin wrote:

  items = d.items()
  items.sort(key=operator.itemgetter(1), reverse=True)

 the items list would require a couple of megabytes for 150k dictionary
 entries, or so.  the key map needs some memory too, but the rest of
 the sort is done in place.
 
 I think the OP's method avoided the key map.

right. I should have written most efficient, not memory efficient. 
the items+itemgetter approach is a bit faster, but uses a few extra 
megabytes of memory temporarily, during the sort.

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: setting up wxPython on a Mac

2006-11-03 Thread Russell E. Owen
In article [EMAIL PROTECTED],
 Kevin Walzer [EMAIL PROTECTED] wrote:

Brian Blais wrote:
I'm not sure about numpy/scipy/matplotlib. I don't think there are
pre-built packages for them; you may have to build them from source. You
could also post to the MacPython mailing list, someone there has
probably looked at this already.

There are prebuilt extension for these for Python 2.4.x available from 
http://pythonmac.org/packages/. Packages for 2.5 will show up 
eventually, but meanwhile if you want prebuilt then use python 2.4.4.

For python itself, I recommend using the Mac installer available from 
the standard python web site (rather than the package available from 
http://pythonmac.org/packages/).

-- Russell
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: emacs shell hangs on W32 with python

2006-11-03 Thread emin . shopper
Lennart Borgman wrote:
 Could you then please post a bug report? Just choose Help - Send bug
 report from the menus.

I sent a bug-report to the emacs list as requested and got an email
reply saying the message is being held for a moderator to look at.
Since the bug seems to be in the interaction of emacs with python, I'm
also cross-posting this to comp.lang.python in case anyone there can
help. (Note this bug shows up in all the versions of emacs that I have
tried including Xemacs and GNU Emacs 21).

The body of the bug-report is below:

I started emacs with -q did ESC-x shell and entered the following

--

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

h:\projects\arcp_db\trunk\src\guic:\python25\python.exe -i
c:\python25\python.exe -i
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win32
Type help, copyright, credits or license for more information.
 import Tkinter
 t = Tkinter.Tk()
 2

--

Note that after the call to Tkinter.Tk() my python window freezes and
no longer works. Killing the Tk window does not help. I realize that
this may seem like a bug in python and not emacs except that if I do
exactly the same thing through a dos shell I have no problems (i.e.,
python keeps accepting input). Consequently, it seems like emacs is
doing something funky when running the shell that interferes with
python in a way that running the shell without emacs would not do.


Sincerely,
-Emin Martinian


In GNU Emacs 23.0.0.1 (i386-mingw-nt5.1.2600)
 of 2006-10-16 on DTOP
X server distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.1) --cflags  -O2 -g0
-march=i386 -mtune=i686 -pipe -IC:/gnuwin32/include_emacs
-IC:/gnuwin32/lib -IC:/gnuwin32/src --ldflags  -s '

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  encoded-kbd-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
help-echo help-echo help-echo help-echo help-echo
help-echo help-echo help-echo help-echo help-echo
help-echo help-echo help-echo menu-bar help-menu
report-emacs-bug

Recent messages:
(c:\Program Files\emacs-23\ntemacs23\bin\emacs.exe -q)
Loading encoded-kb...done
For information about the GNU Project and its goals, type C-h C-p. [2
times]
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Converting Microsoft Works databases.... *shudder*

2006-11-03 Thread John Machin

GISDude wrote:
 Mike,
 I totally forgot that MS Works was out there. Haven't used that one in
 about 6 or 7 years. Honestly, your best bet is to convert to .csv or
 some delimited .txt file. Once that is done, all your rows/columns will
 be nice and neat .

Nice and neat? What is that supposed to mean?

Converting to a CSV or TXT format loses all meta-information about data
types, sizes, and precision. It also runs the risk of mangling the
actual data. The OP should take the DBF / ODBC route as suggested by
others.

-- 
http://mail.python.org/mailman/listinfo/python-list


Having trouble with file modes

2006-11-03 Thread erikcw
Hi all,

I've created a script that reads in a file, replaces some data (regex),
then writes the new data back to the file.

At first I was convinced that w+ was the tool for the job.  But now
I'm finding that the contents of the file are deleted (so I can't read
the data in).

f = open('_i_defines.php', 'w+')
data = f.read()
#patterns removed for brevity.
patterns = [(tuples)(blah blah)]

#loop through patterns list and find/replace data
for o, r in patterns:
data = data.replace(o, r)
print Replaced %s with %s % (o, r)
f.write(data)
f.close()

This results in an empty file.  All of the modes I've tried either
produce an empty file or append the data onto the end of the file.  How
Can I:

Open
Read
Truncate
...process data
Write
Close

Do I need to open and close the file twice? (once in 'r' and then again
in 'w')

Thanks!
Erik

-- 
http://mail.python.org/mailman/listinfo/python-list


getattrfunc vs. tp_methods

2006-11-03 Thread Fabiano Sidler
Hello list!

Writing a C extension module, which way is better to implement attribute
retrieval, by a getattr function in the PyTypeObject struct or by an entry
tp_methods? I don't need any black magic being executed on attribute access,
so I would tend towards the tp_methods entry. Any argument against it?

Greetings,
Fips
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Having trouble with file modes

2006-11-03 Thread martdi

 At first I was convinced that w+ was the tool for the job.  But now
 I'm finding that the contents of the file are deleted (so I can't read
 the data in).


Possible File Modes:
a : Append -- Add data at the end of the file
r : Read -- Read from the file
w : write -- Flush contents of the file and put data in it
r+ : read and write -- Make changes to the file
any of the above modes with b added at the end of the mode sets the
file in binary mode

you might want to check section 7.2 from
http://docs.python.org/tut/node9.html

Ofen when doing file operations you might prefer to read the file to
modify, make changes in memory then save back in an other file, so you
can make sure the changes are ok before you replace the old one

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py2exe questions

2006-11-03 Thread Grant Edwards
On 2006-11-03, Doug Stell [EMAIL PROTECTED] wrote:
 I have 2 questions about py2exe or any similar utility.

 1. Is it possible to create a single Windows executable that does not
blow out to a folder full of files and can be called from scripts
using command line arguments?

The default operation of py2exe already meets requirement 1b:
an executable that can be called from scripts using command
line arguments.

-- 
Grant Edwards   grante Yow!  Now I'm concentrating
  at   on a specific tank battle
   visi.comtoward the end of World
   War II!
-- 
http://mail.python.org/mailman/listinfo/python-list


Programming Language that is Spreadsheet/Table Based

2006-11-03 Thread Omar
I'm looking for a programming language or module that sorta looks and
feels like MS Excel (I love and think in tables), yet has the power and
open-endedness of python or javascript.  I'm still pretty new to
python.

any ideas?  i've been having some fun with VBA in excel, but I want
something I can save as en exe and call my own creation, y'know?

-- 
http://mail.python.org/mailman/listinfo/python-list


WSDL?

2006-11-03 Thread tobiah
Is WSDL the right answer for in house communication
between programs written in different languages, or
is it more for publishing interfaces for use by parties
outside your own company?

What else is available for sharing complex structures
with processes running programs that were written in
other languages?

Thanks,

Toby

-- 
Posted via a free Usenet account from http://www.teranews.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Programming Language that is Spreadsheet/Table Based

2006-11-03 Thread Fuzzyman

Omar wrote:
 I'm looking for a programming language or module that sorta looks and
 feels like MS Excel (I love and think in tables), yet has the power and
 open-endedness of python or javascript.  I'm still pretty new to
 python.

 any ideas?  i've been having some fun with VBA in excel, but I want
 something I can save as en exe and call my own creation, y'know?

I think you'll have to build it. For .NET there are lots of third party
grids available and a native one as well. You may want to look at the
grid supplied with wxPython.

Spreadsheets are effectively interfaces to functional programming, so
this request isn't as odd as it may seem to some.

You probably want to have a look at the PyCells project which can
handle the dependency tracking you will need: which is harder than you
might think.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py2exe questions

2006-11-03 Thread Larry Bates
Doug Stell wrote:
 I have 2 questions about py2exe or any similar utility.
 
 1. Is it possible to create a single Windows executable that does not
 blow out to a folder full of files and can be called from scripts
 using command line arguments?
 
 2. If the above can be done, it is possible to hide parts of the
 Python source code from users? These users are software developers,
 but we don't want them to see how the code does what it does.
 
 thanks, doug

py2exe reduce the number of files you need to distribute down to 4:

msvcr71.dll
w9xpopen.exe  (Windows/98 support)
library.zip (all .pyo, .pyd, and .dll files)
applcation.exe


I does not however go to great lengths to hide the code from
someone with time/expertise that wants to get to your code
(but then just about anything can be disassembled).  The compiled
.pyo files are just placed in library.zip.  At least it doesn't
send your .py files along.

-Larry
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Programming Language that is Spreadsheet/Table Based

2006-11-03 Thread MC
Hi!

You can expand VBA/Excel with Python, with Pywin32 for to make a 
dynamic COM server.

-- 
@-salutations

Michel Claveau


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Having trouble with file modes

2006-11-03 Thread erikcw
To make it write over the data, I ended up adding, which seems to work
fine.

f = open('_i_defines.php', 'w+')
data = f.read()
f.seek(0)
f.truncate(0)
...process data, write file, close...

Now that I look at it, I could probably take out the f.seek().

Thanks for your help!


On Nov 3, 4:00 pm, martdi [EMAIL PROTECTED] wrote:
  At first I was convinced that w+ was the tool for the job.  But now
  I'm finding that the contents of the file are deleted (so I can't read
  the data in).Possible File Modes:
 a : Append -- Add data at the end of the file
 r : Read -- Read from the file
 w : write -- Flush contents of the file and put data in it
 r+ : read and write -- Make changes to the file
 any of the above modes with b added at the end of the mode sets the
 file in binary mode

 you might want to check section 7.2 fromhttp://docs.python.org/tut/node9.html

 Ofen when doing file operations you might prefer to read the file to
 modify, make changes in memory then save back in an other file, so you
 can make sure the changes are ok before you replace the old one

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Having trouble with file modes

2006-11-03 Thread Larry Bates
Don't do that.  Do something like renaming the old file
to .bak (or .aside or something) and then create the entire file
by opening it with 'w'.

-Larry
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WSDL?

2006-11-03 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], tobiah wrote:

 What else is available for sharing complex structures
 with processes running programs that were written in
 other languages?

Corba?

Ciao,
Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Make all files extension lower by a given directory name

2006-11-03 Thread Martin Miller
Tim Chase wrote, in part:
 ...
 I've found that Win32 doesn't often take a rename if the origin
 and destination differ only in case[*].  Thus, to change the
 case, I've had to do *two* renames...one to, say, prefix with an
 underscore and change the case to my desired case, and then one
 to strip off the leading underscore.  You might try a similar
 song-and-dance to strong-arm Windows into specifying the case of
 the file.  ...

FWIW, I just tried a file name case-only os.rename() on a file running
Win XP SP2 with Python 2.5 and it worked just fine -- i.e. changed
'TextFile.TXT' to 'TextFile.txt') with just a single call to
os.rename(), no error was raised, and the case of the letters in the
file name were changed properly. (I can also do the same thing at the
command line with a similar results.)

Perhaps you were using a different version of Windows or the os module
(silently) handles the situation. I do agree that this is arguably
strange behavior given how the OS mostly ignores case...

-mm

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sorted and reversed on huge dict ?

2006-11-03 Thread vd12005
thanks for your replies :)

so i just have tried, even if i think it will not go to the end = i
was wrong : it is around 1.400.000 entries by dict...

but maybe if keys of dicts are not duplicated in memory it can be done
(as all dicts will have the same keys, with different (count) values)?

memory is 4Gb of ram, is there a good way to know how much ram is used
directly from python  (or should i rely on 'top' and other unix
command? by now around 220mb is used for around 200.000 words handled
in 15 dicts)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in sci/tech applications

2006-11-03 Thread Thomas Nelson
How hard would it be to have numpy/ scipy part of the python standard
library?
Tom


mattf wrote:
 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.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and SSL enabled

2006-11-03 Thread matey
It appears my __m2crypto.so didn't get built correctly.

cengsu01:/home/mmedina/crypt/m2kcrypto/m2crypto-0.16 python setup.py
build
/usr/local/lib/python2.3/distutils/extension.py:128: UserWarning:
Unknown Extension options: 'swig_opts'
  warnings.warn(msg)
running build
running build_py
running build_ext
building '__m2crypto' extension
swig -python -ISWIG -I/home/mmedina/crypt/openssl/openssl-0.9.8/include
-o SWIG/_m2crypto.c SWIG/_m2crypto.i
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPIC -I/home/mmedina/crypt/m2kcrypto/m2crypto-0.16/SWIG
-I/home/mmedina/crypt/openssl/openssl-0.9.8/include
-I/usr/local/include/python2.3 -c SWIG/_m2crypto.c -o
build/temp.solaris-2.9-sun4u-2.3/SWIG/_m2crypto.o -DTHREADING
In file included from /usr/local/include/python2.3/stringobject.h:10,
 from /usr/local/include/python2.3/Python.h:83,
 from SWIG/_m2crypto.c:13:
/opt/sfw/lib/gcc-lib/sparc-sun-solaris2.9/2.95.3/include/stdarg.h:170:
warning: redefinition of `va_list'
/usr/include/stdio.h:120: warning: `va_list' previously declared here
SWIG/_m2crypto.c:3502: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:3666: warning: function declaration isn't a prototype
SWIG/_m2crypto.c: In function `make_stack_from_der_sequence':
SWIG/_m2crypto.c:3763: warning: function declaration isn't a prototype
SWIG/_m2crypto.c: At top level:
SWIG/_m2crypto.c:4897: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:5589: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:6556: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:7689: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:8111: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:8912: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:10924: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:13654: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:15281: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:13654: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:15281: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:15302: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:15895: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:16086: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:559: warning: `SWIG_Python_ConvertPacked' defined but
not used
warning: no library file corresponding to '/home/mmedina/lib' found
(skipping)
gcc -shared build/temp.solaris-2.9-sun4u-2.3/SWIG/_m2crypto.o
-L/home/mmedina/crypt/openssl/openssl-0.9.8/lib -lssl -lcrypto -o
build/lib.solaris-2.9-sun4u-2.3/M2Crypto/__m2crypto.so
Text relocation remains referenced
against symbol  offset  in file
unknown   0x5c0
/home/mmedina/lib/libssl.a(s3_lib.o)
unknown   0x5c4
/home/mmedina/lib/libssl.a(s3_lib.o)
unknown   0x5c8
/home/mmedina/lib/libssl.a(s3_lib.o)
unknown   0x5cc   /home/mmedina/li


Not sure what is going on here.  Can it not find my libraries?

Heikki Toivonen wrote:
 matey wrote:
  I tried to run the following simple program
 
  #!/usr/local/bin/python
 
  import M2Crypto
 
  u = M2Crypto.m2urllib.URLopener()
  u.open('http://www.yahoo.com')
 
  However I got the following errror:
 
  Traceback (most recent call last):
File test.py, line 3, in ?
  import M2Crypto
File /home/mmedina/python2.3/site-packages/M2Crypto/__init__.py,
  line 14, in ?
  import __m2crypto
  ImportError: ld.so.1: python: fatal: relocation error: file
  /home/mmedina/python2.3/site-packages/M2Crypto/__m2crypto.so: symbol
  d2i_SSL_SESSION: referenced symbol not found
  cengsu01:/home/mmedina/scripts/python 

 Sorry, no idea why you are getting this.

 Btw, I think even the M2Crypto m2urllib is unsafe, you'd be better of
 using some of the other convenience libs libs httpslib or something.

  However, I went back to INSTALL instructions for m2crytpo.  I saw I
  forgot to run alltests.py
 
  I ran the alltests.py and received the following:
 
  Traceback (most recent call last):
  ImportError: No module named __m2crypto

 Currently you need to install M2Crypto before you can run the tests.
 Next version of M2Crypto will have an option to run tests without
 installing. I'd assume if copied the sources to your own site-packages
 dir and set the PYTHONPATH environment variable this would have worked.
 Notice that you'd need to copy the *built* M2Crypto dir, not the source
 M2Crypto dir which does not include the .so file.
 
 -- 
   Heikki Toivonen

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WSDL?

2006-11-03 Thread WakeBdr
XMLRPC and SOAP are the two I'm working with right now.


tobiah wrote:
 Is WSDL the right answer for in house communication
 between programs written in different languages, or
 is it more for publishing interfaces for use by parties
 outside your own company?

 What else is available for sharing complex structures
 with processes running programs that were written in
 other languages?

 Thanks,

 Toby
 
 -- 
 Posted via a free Usenet account from http://www.teranews.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sorted and reversed on huge dict ?

2006-11-03 Thread Paul Rubin
[EMAIL PROTECTED] writes:
 but maybe if keys of dicts are not duplicated in memory it can be done
 (as all dicts will have the same keys, with different (count) values)?

There will still be a pointer for each key, the strings themselves
won't be duplicated.  

 memory is 4Gb of ram, 

That sounds like enough ram to hold all your stuff easily.

 is there a good way to know how much ram is used
 directly from python  (or should i rely on 'top' and other unix
 command? 

I think try resource.getrusage()

 by now around 220mb is used for around 200.000 words handled in 15
 dicts)

That sounds very manageable given a 4gb machine.  Otherwise, since
it sounds like you're trying to scan some big text corpus and figure
out word frequencies, you could do it the old fashioned way.  Write
the words one per line into a big file, then sort the file with the
Unix sort utility (which is an external sort), then read the sorted
file (or pipe it through uniq -c) to figure out the counts.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WSDL?

2006-11-03 Thread tobiah
I recently wrote a SOAP client(?) to read what the guy from
the other company called a WSDL, which was just a URL that
served an XML API description.  Is that the same as XMLRPC
(I ask because you mention SOAP).

Thanks,

Toby

WakeBdr wrote:
 XMLRPC and SOAP are the two I'm working with right now.
 
 
 tobiah wrote:
 Is WSDL the right answer for in house communication
 between programs written in different languages, or
 is it more for publishing interfaces for use by parties
 outside your own company?

 What else is available for sharing complex structures
 with processes running programs that were written in
 other languages?

 Thanks,

 Toby

 -- 
 Posted via a free Usenet account from http://www.teranews.com
 

-- 
Posted via a free Usenet account from http://www.teranews.com

-- 
http://mail.python.org/mailman/listinfo/python-list


how do I pass values between classes?

2006-11-03 Thread kath
hi everyone.

I have a task, I have fragmented the task into subtask. I have planned
to create a class to each subclass and one parent class to handle the
sub tasks. Each subclass are saved in seperate file and all my
subclasses and parent class are placed in the same folder.

The parent class is subclass of wx.Frame, and subclasses are subclass
of wx.Panel. Each subclass will create a GUI for each task..

ok.. here is problem

When a menu is selected in the parent class, im instantiating the child
class(i.e, Panel), which has textbox and two buttons. first button is
used to select a file, and second one I have planned to, read the file
and pass the values to parent class [B]OR[/B] pass the filepath to
parent to read and do rest of the work.

How do I do that?

Please tell me whether I am following a correct method, by fragmenting
task  into small task and assigning it to child class and saving it in
a separate file?.

ok, here is the Parent class
[code]
import wx
import client
My Parent class
class Parent(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title)

menu=wx.Menu()
menu.Append(5000, File)
menu.AppendSeparator()
menu.Append(5001, Exit)
menubar=wx.MenuBar()
menubar.Append(menu, File)
self.SetMenuBar(menubar)
self.Bind(wx.EVT_MENU, self.OnFile,id=5000)
self.Bind(wx.EVT_MENU, self.OnExit,id=5001)

def OnFile(self, event):
self.cl=client.Child(self, -1)

def OnBrowse(self, event):
dir=
d=x.FileDialog(self, Choose an Excel file, self.dirname, ,
*.xls, wx.OPEN)
if d.ShowModal() == wx.ID_OK:
self.filename=d.GetFilename()
self.dirname=d.GetDirectory()
self.filepath.SetValue(os.path.join(self.dirname,
self.filename))

def OnUpload(self, event):
pass

def OnExit(self, event):
self.Close()

class MyApp(wx.App):
def OnInit(self):
frame=Parent(None, -1, Parent window)
frame.Show(True)
self.SetTopWindow(frame)
return True

if __name__ == '__main__':
app=MyApp(redirect=False)
app.MainLoop()

[/code]

and Child class
[code]
import wx, os

My Child class

class Child(wx.Panel):
def __init__(self, parent, id):
wx.Panel.__init__(self, parent, id, size=(300,300))
box=wx.BoxSizer(wx.HORIZONTAL)
label=wx.StaticText(self, -1, File Path:  )

self.text=wx.TextCtrl(self, -1)
browse=wx.Button(self, -1,Browse)
upload=wx.Button(self, -1, Upload)
self.Bind(wx.EVT_BUTTON, self.OnBrowse, browse)
self.Bind(wx.EVT_BUTTON, self.OnUpload, upload)
box.Add(label)
box.Add(self.text)
box.Add(browse)

mainbox=wx.BoxSizer(wx.VERTICAL)
mainbox.Add(box)
mainbox.Add(upload)

self.SetSizer(mainbox)
mainbox.Layout()
def OnBrowse(self, event):
self.dir=
d=wx.FileDialog(self, Choose an Excel file, self.dir, ,
*.xls, wx.OPEN)
if d.ShowModal() == wx.ID_OK:
self.filename=d.GetFilename()
self.dir=d.GetDirectory()
self.text.SetValue(os.path.join(self.dir, self.filename))

def OnUpload(self, event):
pass

class MyApp(wx.App):
def OnInit(self):
frame=wx.Frame(None, -1, Child window)
panel=Child(frame, -1)
frame.Show(True)
self.SetTopWindow(frame)
return True

if __name__ == '__main__':
app=MyApp()
app.MainLoop()
[/code]

thank you,
regards,
kath.

-- 
http://mail.python.org/mailman/listinfo/python-list


numpy help

2006-11-03 Thread Chris Smith

Howdy,

I'm a college student and for one of we are writing programs to
numerically compute the parameters of antenna arrays. I decided to use
Python to code up my programs. Up to now I haven't had a problem,
however we have a problem set where we are creating a large matrix and
finding it's inverse to solve the problem. To invert the matrix I've
tried using numpy.numarray.linear_algebra.inverse and
numpy.oldnumeric.linear_algebra.inverse which both give me the same
error ( I was hoping they called different routines but I think they
call the same one ).


This is the error message I receive:

Traceback (most recent call last):
   File C:\Documents and Settings\Chris 
Esther\Desktop\636_hw5_2\elen636_hw5_2.py, line 60, in module
 matrix_inverse =
numpy.numarray.linear_algebra.generalized_inverse(matrix)
   File
C:\Python25\lib\site-packages\numpy\oldnumeric\linear_algebra.py, line
59, in generalized_inverse
 return linalg.pinv(a, rcond)
   File C:\Python25\lib\site-packages\numpy\linalg\linalg.py, line
557, in pinv
 u, s, vt = svd(a, 0)
   File C:\Python25\lib\site-packages\numpy\linalg\linalg.py, line
485, in svd
 a = _fastCopyAndTranspose(t, a)
   File C:\Python25\lib\site-packages\numpy\linalg\linalg.py, line
107, in _fastCopyAndTranspose
 cast_arrays = cast_arrays + (_fastCT(a.astype(type)),)
TypeError: can't convert complex to float; use abs(z)



I've tried inverting small complex matrices and it worked fine. Does
anyone know why it won't work for this larger matrix? Any ideas how I
can work around this problem and get the correct inverse matrix?

Chris

P.S. elen636_math.py is my personal library of functions I've create to
solve the problem while elen636_hw5_2.py is the program that I'm
actually running

# Purpose:
# This is a library of functions for ELEN 636 that
# so far has the ability to calculate the Sine and
# Cosine integrals as well as the mutual impedance
# between two parallel antennas.
#
# Author: Christopher Smith
# E-mail: [EMAIL PROTECTED]
# Date:   10/30/2006

###
### NOTE: The functions below for the sine and cosine integrals are similar
###   to the functions I turned in for homework assignment 4 problem 6
###   except that I added the ability to check for convergence.
###   I also added the factor into the mutual impedance formula so that the
###   answer is given in terms of the terminal input impedance instead of
###   the loop impedance as it was formerly giving.
###

# depends on the math library
from math import *
import numpy.numarray, numpy

def factorial(n):

This function calculates the factorial of a number.

sum = 1.0
for m in range(1, int(n)+1):
sum = float(m)*sum
return sum

def Si(x):

This function computes the sine integral. It uses a power series
expansion that can be found in Abramowitz and Stegun's math
functions reference book.

start = 0.0
stop = 10.0
sine_int = 0.0
convergence = 1.0*10**(-6)   # want to have the difference between
 # the last run and this run below
 # this value
while 1:
for n in range(int(start), int(stop)):
n = float(n)
sine_int += ((-1)**n)*x**(2*n +1)/((2*n+1)*factorial(2*n+1))
sine_int_new = sine_int + ((-1.)**stop)*x**(2.*stop 
+1.)/((2.*stop+1.)*factorial(2.*stop+1.))
converge_check = sine_int_new - sine_int
if abs(converge_check)  convergence:
break
else:
start = stop
stop += 5.0
return sine_int_new

def Ci(x):

This function computes the cosine integral. It uses a power series
expansion that can be found in Abramowitz and Stegun's math
functions reference book.

start = 1.0
stop = 10.0
convergence = 1.0*10.**(-6)   # want to have the difference between
 # the last run and this run below
 # this value
# The first number in the sum is Euler's constant to 10 digits
cosine_int = 0.5772156649 + log(x)
while 1:
for n in range(int(start), int(stop)):
m = float(n)
cosine_int = cosine_int +((-1)**m)*x**(2*m)/((2*m)*factorial(2*m))
cosine_int_new = cosine_int + 
((-1)**stop)*x**(2*stop)/((2*stop)*factorial(2*stop))
converge_check = cosine_int_new - cosine_int
if abs(converge_check)  convergence:
break
else:
start = stop
stop += 5.0
#print stop
return cosine_int_new


def mutual_impedance(length1_tot, length2_tot, stagger, d):

This function computes the mutual impedance between two antennas
for the Parallel in Echelon Configuration. The formulas are taken
from a paper by Howard King, Mutual Impedance of Unequal Length
Antennas in Echelon

NOTE: all measurements should 

Re: Python in sci/tech applications

2006-11-03 Thread robert
Robert Kern wrote:
 This is what Martin said:
 
 
 It used to be possible to link with it. See
 
 http://msdn2.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx
 
 This is now a known DLL, and meant for use by system-level components
 only.
 
 
 Note the words used to and now. Mingw is a somewhat old project and 
 was initially developed at a time when MSVCRT.dll *was* intended to be 
 used by applications. It simply hasn't received enough attention 
 recently to move to a different runtime. If you would like to volunteer 
 your time to do the necessary work to allow it to link to modern 
 runtimes, please do so. You will receive the undying thanks of many, 
 many Pythoneers.

thanks, but I'm more in favor of the reverse direction :-) 
As I have a lot to do with frozen distributables, package sizes are still a 
predominant concern for me. App-startup speed, MEM consumption etc. also - 
still. 
Having non-standard C-RTLs and maybe non-standard versions of the MFC dll's, 
doubled Python-DLL sizes etc. one has an extra burden of 3MB since Python2.4.
This means for me: Python2.3 - or create very proprietary compilations.

robert
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >