ANN: PyTables 1.1 released

2005-07-15 Thread Francesc Altet
=
 Announcing PyTables 1.1
=

After quite a few testing iterations, the PyTables development team is
happy to announce the availability of PyTables 1.1.

On this version you will find support for a nice set of new features,
like nested datatypes, enumerated datatypes, nested iterators (for
reading only), support for native HDF5 multidimensional attributes, a
new object for dealing with compressed, non-enlargeable arrays
(CArray), bzip2 compression support and more. Many bugs has been
addressed as well.

Go to the PyTables web site for downloading the new beast:
http://pytables.sourceforge.net/

or keep reading for more info about the new features and bugs fixed.


Changes more in depth
=

Improvements:

- Support for nested datatypes is in place. You can now made columns
  of tables that host another columns for an unlimited depth (well,
  theoretically, in practice until the python recursive limit would be
  reached). Convenient NestedRecArray objects has been implemented as
  data containers. Cols and Description accessors has been improved so
  you can navigate on the type hierarchy very easily (natural naming
  is has been implemented for the task).

- ``Table``, ``EArray`` and ``VLArray`` objects now support enumerated
  types.  ``Array`` objects support opening existing HDF5 enumerated
  arrays.  Enumerated types are restricted sets of ``(name, value)``
  pairs.  Use the ``Enum`` class to easily define new enumerations
  that will be saved along with your data.

- Now, the HDF5 library is responsible to do data conversions when the
  datasets are written in a machine with different byte-ordering than
  the machine that reads the dataset. With this, all the data is
  converted on-the-fly and you always get native datatypes in
  memory. I think this approach to be more convenient in terms of CPU
  consumption when using these datasets. Right now, this only works
  for tables, though.

- Added support for native HDF5 multidimensional attributes. Now, you
  can load native HDF5 files that contains fully multidimensional
  attributes; these attributes will be mapped to NumArray
  objects. Also, when you save NumArray objects as attributes, they
  get saved as native HDF5 attributes (before, NumArray attributes
  where pickled).

- A brand-new class, called CArray, has been introduced. It's mainly
  like an Array class (i.e. non-enlargeable), but with compression
  capabilities enabled. The existence of CArray also allows PyTables
  to read native HDF5 chunked, non-enlargeable datasets.

- Bzip2 compressor is supported. Such a support was already in
  PyTables 1.0, but forgot to announce it.

- New LZO2 (http://www.oberhumer.com/opensource/lzo/lzonews.php)
  compressor is supported. The installer now recognizes whether LZO1
  or LZO2 is installed, and adapts automatically to it. If both are
  installed in your system, then LZO2 is chosen. LZO2 claims to be
  fully compatible (both backward and forward) with LZO1, so you
  should not experience any problem during this transition.

- The old limit of 256 columns in a table has been released. Now, you
  can have tables with any number of columns, although if you try to
  use a too high number (i.e.  1024), you will start to consume a lot
  of system resources. You have been warned!.

- The limit in the length of column names has been released also.

- Nested iterators for reading in tables are supported now.

- A new section in tutorial about how to modify values in tables and
  arrays has been added to the User's Manual.

Backward-incompatible changes:

- None.

Bug fixes:

- VLArray now correctly updates the number of rows internal counter
  when opening an existing VLArray object. Now you can add new rows
  to existing VLA's without problems.

- Tuple flavor for VLArrays now works as intended, i.e. reading
  VLArray objects will always return tuples even in the case of
  multidimensional Atoms. Before, this operations returned a mix of
  tuples and lists.

- If a column was not able to be indexed because it has too few
  entries, then _whereInRange is called instead of
  _whereIndexed. Fixes #1203202.

- You can call now Row.append() in the middle of Table iterators without
  resetting loop counters. Fixes #1205588.

- PyTables used to give a segmentation fault when removing the last
  row out of a table with the table.removeRows() method. This is due
  to a limitation in the HDF5 library. Until this get fixed in HDF5, a
  NotImplemented error is raised when trying to do that. Address
  #1201023.

- You can safely break a loop over an iterator returned by
  Table.where(). Fixes #1234637.

- When removing a Group with hidden child groups, those are
  effectively closed now.

- Now, there is a distinction between shapes 1 and (1,) in tables. The
  former represents a scalar, and the later a 1-D array with just one
  element. That follows the numarray convention for records, and makes
  more 

ANN: PyMedia 1.3.5-pre1 for Windows

2005-07-15 Thread Dmitry Borisov
Hi all,
Just wanted to let you know that early prerelease of PyMedia 1.3.5 is out.

What is it ?

PyMedia is a media library for Python based on the following libraries:
  libavcodec,  libavformat,  libdvdcss, libdvdread

It has simple interface and yet powerfull for writing multimedia apps in
Python.

Features

1. Audio decoding/encoding for the following types:
   - mp2, mp3, ac3, ogg, wma
2. Video decoding/encoding for the following types:
   - mpeg1,2 ( dvd, vcd, svcd ), mpeg4, xvid, asf, mov
3. Video/Audio muxing for mpeg files only
4. Direct access to sound device( Input/Output ). Input is synchronous in
Linux.
5. Sound manipulation classes such as Resampler and SpectrAnalyzer
6. Direct access to cdda tracks for easy grabbing and encoding Audio CDs
7. Direct access to dvd tracks for playing DVD movies( all types )
8. Ability to convert video frames from YUV-BMP formats
9. Simple interface and portability( Windows/Linux/cygwin )

What's new

1. FLAC support
2. Muxer object is suitable for audio and video and become global for
pymedia.
It enables simpler audio/video demuxing
3. Video playback rate was tuned to be as close to mplayer as possible
4. Precompiled version for Python2.4 on Windows available
5. Sound module for Windows works

Bugs

1. AAC decoder does not work correctly
2. WMA decoder has been corrupted and may not play somethimes
3. Video encoding has bugs with PTS/DTS handling
4. Muxing for OGG does not work

Downoad

Just check the http://pymedia.sourceforge.net and download the latest
Windows binary version( 1.3.5-pre1 ).
There is no tarball available since existing version resides in CVS.
You're welcome to try it out on Linux !

How to use

First of all you can see PyCar application
  http://pymedia.org/pycar/

For everything else see the tutorials on a web site
 http://pymedia.org/tut/
 Please note that some of the chapters may not be up-to-date.
 Let me know if something does not work for you !

Enjoy,
Dmitry/


-- 
XS2Mail: Check your mail anywhere http://www.xs2mail.com/
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


ANN: KirbyBase 2.0 beta 1

2005-07-15 Thread Jamey Cribbs
I would like to announce the first beta of version 2 of KirbyBase, a 
simple, pure-Python database management system that stores it's data in 
plain-text files.  Version 2 is a total rewrite of the code, a major 
change in the api, and a major improvement (I hope) in the syntax used 
to express queries, inserts, and updates.

Because of the dramatic changes, I wanted to get this beta out in the 
hopes that I can get some early feedback on the new api and syntax, 
before releasing version 2.

You can download the beta from here:

http://www.netpromi.com/files/KirbyBase_Python_2.0_beta_1.zip


Included in the zip file is a script, kbtest.py that has numerous 
examples of the new syntax.  I'll try to give you a small flavor of it here:

To specify a select query in the old version of KirbyBase you would do 
something like this:

db.select('plane.tbl', ['country', 'speed'], ['USA', ' 300'])

which says, Select all planes from the US with a speed greater than 300mph.

In the new version of KirbyBase you could state the query using named 
arguments:

plane_tbl.select(country='USA', speed=' 300')

or, using a dictionary:

plane_tbl.select({'country': 'USA', 'speed': ' 300'})

or, you could even use a lambda, like this:

plane_tbl.select(lambda r: r.country == 'USA' and r.speed  300)

I personally prefer the latter, but I realize that lambda's are quite 
controversial just now, so I offer alternative ways to specify select 
criteria.  One of the cool things about using lambdas is that it gives 
you more power in your selects, like being able to use regular 
expressions and being able to use or logic.

Anyway, this is just a small taste of the changes.  The changes actually 
go much deeper and, I think, make the resulting api much more 
Pythonic.  About the only thing that hasn't changed is the table 
structure in the physical file (well, there is one small change, but it 
is easily made).

It is currently a good bit slower than the current version of KirbyBase; 
I will work on optimizing it after the api is frozen.

For those of you who have used the Ruby version of KirbyBase, this new 
Python version closely resembles that, while trying to be as Python-like 
as possible.

There is no manual yet, but I think you can get a good feel for the 
differences by looking at kbtest.py.

I would be very interested in any feedback you can give me on the new 
version.

Jamey Cribbs

[EMAIL PROTECTED]


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

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


Australian Open Source Developers' Conference

2005-07-15 Thread Simon Taylor
Announcement:

OSDC 2005 is up and running.

The second Australian OSDC (Open Source Developers' Conference) will be
held on the 5th, 6th and 7th of December 2005 at Monash University in
Melbourne.

The 2004 Conference was an outstanding success with over 160 delegates 
attending, including a significant number from interstate and overseas.

The quality of presentations and general enthusiasm of the attendees
confirmed the growing reputation and strength of open source development 
in Australia. Most of last year's attendees plan to attend the 
conference again in 2005.

In 2005, OSDC will be even bigger and better.

OSDC is a great opportunity for open source devotees to
attend an affordable conference where the main focus is software
development. Companies and other organisations will find the conference
an ideal avenue for providing professional development for staff,
identifying trends and partners and promoting their services.

The conference web site is: http://www.osdc.com.au
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-15 Thread Michael Hudson
Grant Edwards [EMAIL PROTECTED] writes:

 I've read over and over that Python leaves floating point
 issues up to the underlying platform.  

Please read the conversation Tim and I are having in the Re:
math.nroot [was Re: A brief question.] elsewhere in this same
newsgroup.

Cheers,
mwh

-- 
  Also, does the simple algorithm you used in Cyclops have a name?
  Not officially, but it answers to hey, dumb-ass!
   -- Neil Schemenauer and Tim Peters, 23 Feb 2001
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.nroot [was Re: A brief question.]

2005-07-15 Thread Michael Hudson
Tim Peters [EMAIL PROTECTED] writes:

 [Tim]
  Ah, but as I've said before, virtually all C compilers on 754 boxes
  support _some_ way to get at this stuff.  This includes gcc before C99
  and fenv.h -- if the platforms represented in fpectlmodule.c were
  happy to use gcc, they all could have used the older gcc spellings
  (which are in fpectlmodule.c, BTW, under the __GLIBC__ #ifdef).
 
 [Michael] 
  Um, well, no, not really.  The stuff under __GLIBC___ unsurprisingly
  applies to platforms using the GNU project's implementation of the C
  library, and GCC is used on many more platforms than just that
  (e.g. OS X, FreeBSD).
 
 Good point taken:  parings of C compilers and C runtime libraries are
 somewhat fluid.
 
 So if all the platforms represented in fpectlmodule.c were happy to
 use glibc, they all could have used the older glibc spellings. 
 Apparently the people who cared enough on those platforms to
 contribute code to fpectlmodule.c did not want to use glibc, though. 

It may not have been possible for them, after a little googling.  It
seems that while glibc is theoretically portable to systems other than
linux, in practice it ain't.

 In the end, I still don't know why there would be a reason to hope
 that an endless variety of other libms would standardize on the C99
 spellings.

Point.  But as you said in the post I replied to, soon (maybe even
now) there won't be an endless variety of other libms to worry
about.

  ...
   Even given that, the glibc section looks mighty Intel specific to me (I 
  don't
  see why 0x1372 should have any x-architecture meaning).
 
 Why not?  I don't know whether glibc ever did this, but Microsoft's
 spelling of this stuff used to, on Alphas (when MS compilers still
 supported Alphas), pick apart the bits and rearrange them into the
 bits needed for the Alpha's FPU control registers.  

Well, I considered that but decided that it was far too insane.  Maybe
that was insufficient cynicism :)

In any case, glibc's docs today only mention the C99 (and C99-like,
for setting traps) interfaces, and I can't be arsed to go through old
docs to see if _FPU_SETCW or __setfpucw were ever documented and if so
what they were documented to do.

  One thing GCC doesn't yet support, it turns out, is the #pragma STDC
  FENV_ACCESS ON gumpf, which means the optimiser is all too willing to
  reorder
  
 feclearexcept(FE_ALL_EXCEPT);
 r = x * y;
 fe = fetestexcept(FE_ALL_EXCEPT);
 
  into
  
 feclearexcept(FE_ALL_EXCEPT);
 fe = fetestexcept(FE_ALL_EXCEPT);
 r = x * y;
  
  Argh!  Declaring r 'volatile' made it work.
  
 Oh, sigh.  One of the lovely ironies in all this is that CPython
 _could_ make for an excellent 754 environment, precisely because it
 does such WYSIWYG code generation. 

One of my motivations here (other than the instantly discountably one
of aesthetic purity :) is to make Python a good system for prototyping
numeric codes.

 Optimizing-compiler writers hate hidden side effects, and every fp
 operation in 754 is swimming in them -- but Python couldn't care
 much less.

Thing is, I don't see how this particular stuff should be that hard to
implement -- if you have an optimizing compiler that can move code
around, presumably you have some way of saying what can't be moved
past what else.  But you're not going to catch me diving into GCC's
sources :) (In other news, passing -frounding-math to GCC may also
have the desired effect, but I haven't tested this).

 Anyway, you're rediscovering the primary reason you have to pass a
 double lvalue to the PyFPE_END_PROTECT protect macro. 
 PyFPE_END_PROTECT(v) expands to an expression including the
 subexpression
 
 PyFPE_dummy((v))
 
 where PyFPE_dummy() is an extern that ignores its double* argument. 
 The point is that this dance prevents C optimizers from moving the
 code that computes v below the code generated for
 PyFPE_END_PROTECT(v).  Since v is usually used soon after in the
 routine, it also discourages the optimizer from moving code up above
 the PyFPE_END_PROTECT(v) (unless the C does cross-file analysis, it
 has to assume that PyFPE_dummy((v)) may change the value of v). 
 These tricks may be useful here too -- fighting C compilers to the
 death is part of this game, alas.

I did read those comments.  Maybe passing the address of the result
variable to the routine that checks the flags and decides whether to
raise an exception would be a good hack (and, yes, writing that
function in another file so GCC doesn't bloody well inline it and then
rearrange all my code).

 PyFPE_END_PROTECT() incorporates an even stranger trick, and I wonder
 how gcc deals with it.  The Pentium architecture made an agonizing
 (for users who care) choice:  if you have a particular FP trap enabled
 (let's say overflow), and you do an fp operation that overflows, the
 trap doesn't actually fire until the _next_ fp operation (of any kind)
 occurs.  You can honest-to-God have, e.g., an overflowing fp add on an
 

Python Programming Contest

2005-07-15 Thread Brian Quinlan
I've decided that it would be be fun to host a weekly Python programming
contest. The focus will be on algorithms that require a bit of thought
to design but not much code to implement.

I'm doing to judge the solutions based on execution speed. It sucks but
that is the easiest important consideration to objectively measure. I'll
also indicated which solutions I think are good examples of Python
design. Hopefully, people's solutions can provide a resource for people
looking for best practice examples and also for people looking for
performance ideas.

You can find the first problem here:
http://www.sweetapp.com/pycontest/contest1

I'm always looking for feedback, so let me know what you think or if you
have any ideas for future problems.

Cheers,
Brian

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


Re: Python Programming Contest

2005-07-15 Thread Simon Dahlbacka
Are you aware of http://mathschallenge.net/index.php?section=project ?

The The focus will be on algorithms that require a bit of thought
to design but not much code to implement. part seems common, although
your problem domain probably is larger.

/Simon

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


Re: Python Programming Contest

2005-07-15 Thread James


Brian Quinlan wrote:
 I've decided that it would be be fun to host a weekly Python programming
 contest. The focus will be on algorithms that require a bit of thought
 to design but not much code to implement.

 I'm doing to judge the solutions based on execution speed. It sucks but
 that is the easiest important consideration to objectively measure. I'll
 also indicated which solutions I think are good examples of Python
 design. Hopefully, people's solutions can provide a resource for people
 looking for best practice examples and also for people looking for
 performance ideas.

 You can find the first problem here:
 http://www.sweetapp.com/pycontest/contest1

 I'm always looking for feedback, so let me know what you think or if you
 have any ideas for future problems.

 Cheers,
 Brian

I am not sure if it is a good idea to use a LiveCD for OS when you are
testing for speed. CD access speeds fluctuate and may even impact
performance even if you start measuring after the module loading is
complete.

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


Documenting extension modules?

2005-07-15 Thread Francois De Serres
Hiho,

I can't seem to find a proper way to document my extension module. 
Following the C API doc:

static PyMethodDef ioMethods[] = {
{o_count,  o_count, METH_VARARGS, Return the count of available 
MIDI outputs.},

}

lacks:
a) module level documentation
b) function parameters

Also, I'd like to know if there's a typical format for the help string 
(but in C), compatible with docstring's
short desription

long description

Any pointers please?

TIA,
Francois
-- 
http://mail.python.org/mailman/listinfo/python-list


using hotshot for timing and coverage analysis

2005-07-15 Thread Andreas Lobinger
Aloha,

hotshot.Profile has flags for recording timing per line and line
events. Even if i had both set to 1 i still get only the
standard data (time per call).

Is there any document available that has examples how to use
the hotshot for converage analysis and to display timing
per line?

Hoping for an answer and wishing a happy day
LOBI
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Documenting extension modules?

2005-07-15 Thread Robert Kern
Francois De Serres wrote:
 Hiho,
 
 I can't seem to find a proper way to document my extension module. 
 Following the C API doc:
 
 static PyMethodDef ioMethods[] = {
 {o_count,  o_count, METH_VARARGS, Return the count of available 
 MIDI outputs.},
 
 }
 
 lacks:
 a) module level documentation

In your initmodule function, assign a PyStr object to __doc__.

 b) function parameters

Add that information to your docstring. I don't think that there is a 
way to get this information via inspect.

 Also, I'd like to know if there's a typical format for the help string 
 (but in C), compatible with docstring's
 short desription
 
 long description

char *o_count__doc__;
char *o_count__doc__ = short description\n\
\n\
long description\n;

-- 
Robert Kern
[EMAIL PROTECTED]

In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die.
   -- Richard Harter

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


Kamaelia Talk at Open Tech 2005, anyone for sprinting?

2005-07-15 Thread Michael Sparks
Hi,


Apologies first to those outside the UK... Open Tech 2005* is a follow
on from previous years' NotCon events which are community driven
low cost events by geeks  developers for geeks  developers. (Much
like Pycon  Europython but much more general in nature)

Website: http://www.ukuug.org/events/opentech2005/
Where/When: Hammersmith, London, UK, July 23rd

The reason I'm posting about it is because I'm going to be talking
about Kamaelia there. Unlike Python UK  Europython this is going to
be a 15 minute talk, so I'll be focussing on what we've been doing
with Kamaelia, what you can do with Kamaelia, and so on rather
than going through internals.

In addition since my talk on Kamaelia is before lunch, I'd really like
to help people get started using Kamaelia (this really the point of
giving talks!), so I'm going to be running a small ad-hoc/mini sprint
that afternoon. 

There's a variety of possible sprintable things ranging from how to
put together simple Kamaelia systems through to using Kamaelia for
simplifying networking on Nokia mobiles through to using Kamaelia
for writing games (since we have some nice Pygame based components
now). 

I'll probably be sprinting on converting a proof of concept P2P
swarming algorithm into a protocol for creating TCP server swarms.
This is for joining together multicast islands to make it so that
internet broadcasting, rather than narrowcasting, can become
a reality for the BBC - which has clear benefits for everyone!
(Even though the internet is not TV :)

Kamaelia is designed to be able to picked up relatively quickly/easily,
but having a working knowledge of python is probably a necessity.

If you're interested, please let me know! (Either before, or at Open
Tech :)

Best Regards,


Michael.
-- 
[EMAIL PROTECTED], http://kamaelia.sourceforge.net/
British Broadcasting Corporation, Research and Development
Kingswood Warren, Surrey KT20 6NP

This message (and any attachments) may contain personal views
which are not the views of the BBC unless specifically stated.

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


Re: Python Programming Contest

2005-07-15 Thread skip

Brian I've decided that it would be be fun to host a weekly Python
Brian programming contest. The focus will be on algorithms that require
Brian a bit of thought to design but not much code to implement.

For some of us that's what we do day-in, day-out at work.  It's just not
called a contest.  To make it more challenging, we sometimes leave out the
bit of thought part. ;-)

Skip

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


Question about basic use of a timer object from timeit module to execute code every so often in a class

2005-07-15 Thread 42zeros
I would like a function to be executed every x often.
I was just wondering how to pass the following code correctly.  my
object t just doesn't know what checkMail is.  How can I tell it that
checkMail is a member of the class MyApp?

thanks in advance,
code is below


class MyApp(wx.App):
def OnInit(self):


frame = wxMainFrame(None, thing)
icon = wx.Icon('foo.bmp', wx.BITMAP_TYPE_ICO)
frame.SetIcon(icon)
self.SetTopWindow(frame)

t = timeit.Timer(checkMail(),30.0)

t.timeit()
return True


def checkMail():

print The number of messages is

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


Re: Question about basic use of a timer object from timeit module to execute code every so often in a class

2005-07-15 Thread Robert Kern
[EMAIL PROTECTED] wrote:
 I would like a function to be executed every x often.
 I was just wondering how to pass the following code correctly.  my
 object t just doesn't know what checkMail is.  How can I tell it that
 checkMail is a member of the class MyApp?

Reread the documentation for timeit. It doesn't do what you think it does.

Look at wxTimer instead.

-- 
Robert Kern
[EMAIL PROTECTED]

In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die.
   -- Richard Harter

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


Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
James wrote:
 I am not sure if it is a good idea to use a LiveCD for OS when you are
 testing for speed. CD access speeds fluctuate and may even impact
 performance even if you start measuring after the module loading is
 complete.

It didn't seem to matter in my testing. Module loading is done before 
the test is run.  Also, it is easiest to protect my system against 
malicious code if it is being run on an OS without a writeable filesystem.

Cheers,
Brian
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
[EMAIL PROTECTED] wrote:
 Brian I've decided that it would be be fun to host a weekly Python
 Brian programming contest. The focus will be on algorithms that require
 Brian a bit of thought to design but not much code to implement.
 
 For some of us that's what we do day-in, day-out at work.  It's just not
 called a contest.  To make it more challenging, we sometimes leave out the
 bit of thought part. ;-)

Hmmm...I find that I am rarely faced with challenging algorithmic 
problems in my day-to-day work. I continuously face difficult design 
decisions but that is a difficult sort of beast all together.

This contest is for people who like thinking about algorithms.

Cheers,
Brian
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to create cross-backend python web app

2005-07-15 Thread Paul Boddie
matt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]...
 Hi all-
 
 I'm trying to port an ajax spell-checker
 (http://www.broken-notebook.com/spell_checker/index.php) to use with
 the moin moin wiki and have been somewhat successful.  (By successful I
 mean I can spell check using the php backend and my python port running
 as cgi-bin).

That looks like an interesting application/component.

 My question is this:  moinmoin runs on many python web backends
 (cgi-bin/mod-python/twisted/standalone).  My spell-checker backend runs
 as cgi (disclaimer: I've done a bit of php and java(struts) web app
 programming, but the last python related web programming I did was Zope
 about 5 years ago (does that even count ? ;) )) because that was the
 easiest for me to get up to speed on.  What is the best way to write
 cross-backend python web apps?  Is there any abstraction I can use?

Although a kind of Web middleware standard called WSGI [1] has been
proposed to somehow alleviate these kinds of problems, I'd recommend
using WebStack [2] to implement a cross-backend solution which will
run on CGI, mod_python, Twisted, BaseHTTPServer and other
technologies.

 With cgi-bin, I use the python cgi module, which gives me easy access
 to form variables, but I'd like to be able to deploy in the other
 backends as well.  What's the best way to do this?  Or is a rewrite
 required for each one?

Some might argue that writing directly to WSGI would allow you to
re-use your CGI-based code moderately easily whilst having some
backend portability. I'd argue that WebStack's API is slightly more
high-level and that the WebStack distribution should provide you with
everything you need to deploy your application on the backends you've
chosen (plus others). Either way, you certainly don't need to rewrite
your application for every different environment any more.

Paul

[1] http://www.python.org/peps/pep-0333.html
[2] http://www.python.org/pypi/WebStack
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: using hotshot for timing and coverage analysis

2005-07-15 Thread Thomas Lotze
Andreas Lobinger wrote:

 hotshot.Profile has flags for recording timing per line and line events.
 Even if i had both set to 1 i still get only the standard data (time per
 call).

Could it be that pstats.Stats doesn't know about hotshot? Haven't checked...

What's much more annoying about hotshot is that loading the stats takes
ages if one profiles stuff that runs about half a minute or so. At least
it does that on Python 2.4.1a0 as shipped with Debian testing a while ago.

 Is there any document available that has examples how to use the hotshot
 for converage analysis and to display timing per line?

Haven't looked thoroughly yet; all I know is what's in the Python docs.

-- 
Thomas

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


Re: Documenting extension modules?

2005-07-15 Thread Francois De Serres
Robert Kern wrote:

Francois De Serres wrote:
  

Hiho,

I can't seem to find a proper way to document my extension module. 
Following the C API doc:

static PyMethodDef ioMethods[] = {
{o_count,  o_count, METH_VARARGS, Return the count of available 
MIDI outputs.},

}

lacks:
a) module level documentation



In your initmodule function, assign a PyStr object to __doc__.

  

b) function parameters



Add that information to your docstring. I don't think that there is a 
way to get this information via inspect.

  

Also, I'd like to know if there's a typical format for the help string 
(but in C), compatible with docstring's
short desription

long description



char *o_count__doc__;
char *o_count__doc__ = short description\n\
\n\
long description\n;

  

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


Re: Documenting extension modules?

2005-07-15 Thread Simon Dahlbacka
Re: assigning a PyStr object to __doc__, take a look at Py_InitModule3,
which does that for you.

Then you have the PyDoc_STRVAR macro in python.h that you might want to
use (see definition below). But as Robert already told you, you'll need
to provide the necessary information about i.e. parameters yourself in
the docstrings.

/* Define macros for inline documentation. */
#define PyDoc_VAR(name) static char name[]
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
#ifdef WITH_DOC_STRINGS
#define PyDoc_STR(str) str
#else
#define PyDoc_STR(str) 
#endif

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


Re: How can I import a py script by its absolute path name?

2005-07-15 Thread Chris Lambacher
You probably actually want:

import sys
sys.path.instert(0, r'c:\xxx\yyy')
m = __import__('zzz', globals(),  locals(), [])
del sys.path[0]

Because if another module named zzz exists in your path.  Appending will pick
those versions up first.  Then you delete the path you just added so that you
don't have any problems importing other modules that may have the same names a
python files in the path you just added.

-Chris
On Thu, Jul 14, 2005 at 02:52:31PM +0300, Edvard Majakari wrote:
 could ildg [EMAIL PROTECTED] writes:
 
  I want to import c:\xxx\yyy\zzz.py into my programme,
  What should I do?
  Thank you~
 
 import sys
 sys.path.append('c:\xxx\yyy')
 import zzz
 
 (Untested, similar idiom would work in *nix systems, never programmed in
 Windows)
 
 However, I guess it is not very usual you should need to import stuff from
 arbitrary locations. Consider publishing those modules in normal Python
 include path (just see what ''print sys.path'' produces)
 
 -- 
 # Edvard Majakari Software Engineer
 # PGP PUBLIC KEY availableSoli Deo Gloria!
 
 $_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
 join('',map{chr hex}(split/(\w{2})/)),uc 
 substr(crypt(60281449,'es'),2,4),\n;
 -- 
 http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Programming Contest

2005-07-15 Thread Bill Mill
On 7/15/05, Brian Quinlan [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
  Brian I've decided that it would be be fun to host a weekly Python
  Brian programming contest. The focus will be on algorithms that require
  Brian a bit of thought to design but not much code to implement.
 
  For some of us that's what we do day-in, day-out at work.  It's just not
  called a contest.  To make it more challenging, we sometimes leave out the
  bit of thought part. ;-)
 
 Hmmm...I find that I am rarely faced with challenging algorithmic
 problems in my day-to-day work. I continuously face difficult design
 decisions but that is a difficult sort of beast all together.
 
 This contest is for people who like thinking about algorithms.
 
 Cheers,
 Brian
 --
 http://mail.python.org/mailman/listinfo/python-list
 

Questions:

Will that random test generator (included in the download) be used to
perform the actual testing? How many tests will be run on each
program?

What is the penalty for a wrong answer?

Peace
Bill Mill

PS - check out http://www.sleepinginairports.net/ before you say you
can't sleep in the airport :)
-- 
http://mail.python.org/mailman/listinfo/python-list


Reading variables from a forked child (Python C/API)

2005-07-15 Thread MrEntropy
Greetings,
I'm having a little trouble getting an idea running. I am writing a C 
program which is really a frontend to a Python program. Now, my C 
program starts up, does some initialisation like initialisation of it's 
variables and Py_Initialize() and then it fork()s. After forking the 
child launches the python program with Py_Main() and with the parent I 
want to be able to read the variables of the Python program. I have 
tried many ways but cannot find a solution to do this. The ONLY testcase 
in fact that I could get working is this:

#include Python.h
#include stdio.h

int main(){
   char* buffer;
   PyObject* mod;
   PyObject* dict;
   PyObject* obj;

   Py_Initialize();

   PyRun_SimpleString(foo = 'bar');
   mod = PyImport_AddModule(__main__);
   dict = PyModule_GetDict(mod);
   obj = PyMapping_GetItemString(dict, foo);
   buffer = PyString_AsString(obj);
   printf(buffer);
   Py_Finalize();
   return 0;
}

And that only proves to me that I can get the variables out of python, 
nothing to do with forking. When i try doing very much the same thing to 
a forked child I get sedfaults. In other words the child gets 
Py_Main()'d and executes the child, while in the parent i do much the 
same as the above with the exception of PyImport_AddModule() being 
changed to PyImport_ImportModule() because main is already preset i gather.

So my questions are these:

Does the fact that I initialise before the fork have anything to do with 
my failure? And if so, is it because some pointers are invalidated?

Is the problem to do with the inability to perform operations on a 
python environment initialised through C while it's executing? Because 
i'm technically executing operations on it from the parent while the 
child in the same environment is running the program.

In the program that the child is running, i need to access some 
variables it has in __main__. main also has an instantiated object 'd' 
which i also need some variables from, i.e. __main__.d.foo. How can I 
access these?

Overall, I would REALLY appreciate an example of how to do what I want 
to achieve, examples help me a lot so if you wouldn't mind typing one up 
or pointing me to some relevant documentation i'd appreciate it.

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


Re: Documenting extension modules?

2005-07-15 Thread Francois De Serres
Simon Dahlbacka wrote:

Re: assigning a PyStr object to __doc__, take a look at Py_InitModule3,
which does that for you.

  

got it, thx.

Then you have the PyDoc_STRVAR macro in python.h that you might want to
use (see definition below). But as Robert already told you, you'll need
to provide the necessary information about i.e. parameters yourself in
the docstrings.

/* Define macros for inline documentation. */
#define PyDoc_VAR(name) static char name[]
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
#ifdef WITH_DOC_STRINGS
#define PyDoc_STR(str) str
#else
#define PyDoc_STR(str) 
#endif

  

beautiful.

PS: The following snip from http://python.fyxm.net/peps/pep-0007.html 
was helpful to me in understanding usage of these macros:

- Use the PyDoc_STR() or PyDoc_STRVAR() macro for docstrings to
  support building Python without docstrings (./configure
  --without-doc-strings).

  For C code that needs to support versions of Python older than
  2.3, you can include this after including Python.h:

#ifndef PyDoc_STR
#define PyDoc_VAR(name) static char name[]
#define PyDoc_STR(str)  (str)
#define PyDoc_STRVAR(name, str) PyDoc_VAR(name) = PyDoc_STR(str)
#endif

- The first line of each fuction docstring should be a signature
  line that gives a brief synopsis of the arguments and return
  value.  For example:

PyDoc_STRVAR(myfunction__doc__,
myfunction(name, value) - bool\n\n\
Determine whether name and value make a valid pair.);

  Always include a blank line between the signature line and the
  text of the description.

  If the return value for the function is always None (because
  there is no meaningful return value), do not include the
  indication of the return type.

- When writing multi-line docstrings, be sure to always use
  backslash continuations, as in the example above, or string
  literal concatenation:

PyDoc_STRVAR(myfunction__doc__,
myfunction(name, value) - bool\n\n
Determine whether name and value make a valid pair.);

  Though some C compilers accept string literals without either:

/* BAD -- don't do this! */
PyDoc_STRVAR(myfunction__doc__,
myfunction(name, value) - bool\n\n
Determine whether name and value make a valid pair.);

  not all do; the MSVC compiler is known to complain about this.








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


Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
Bill Mill wrote:
 On 7/15/05, Brian Quinlan [EMAIL PROTECTED] wrote:
 
[EMAIL PROTECTED] wrote:

Brian I've decided that it would be be fun to host a weekly Python
Brian programming contest. The focus will be on algorithms that require
Brian a bit of thought to design but not much code to implement.

For some of us that's what we do day-in, day-out at work.  It's just not
called a contest.  To make it more challenging, we sometimes leave out the
bit of thought part. ;-)

Hmmm...I find that I am rarely faced with challenging algorithmic
problems in my day-to-day work. I continuously face difficult design
decisions but that is a difficult sort of beast all together.

This contest is for people who like thinking about algorithms.

Cheers,
Brian
--
http://mail.python.org/mailman/listinfo/python-list

 
 
 Questions:
 
 Will that random test generator (included in the download) be used to
 perform the actual testing?

Yes. With two caveats:
1. I will pick the seed ahead of time so everyone gets the same problem
set
2. I will use a local copy of the verification code (for performance
reasons)

 How many tests will be run on each
 program?

Probably a few thousand. If I need more to discriminate between two very 
similar solutions, then I will do so.

 What is the penalty for a wrong answer?

Infinite. Only correct solutions will be judged on performance.

 PS - check out http://www.sleepinginairports.net/ before you say you
 can't sleep in the airport :)

Nice :-)

Cheers,
Brian

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


Re: Question about basic use of a timer object from timeit module to execute code every so often in a class

2005-07-15 Thread [EMAIL PROTECTED]
I've seen both documentation for using timeit as simply a timer to
measure preformance, but also a random page here and there that looked
to me as if they were using it as a simple timer.  HOwever, if there is
a wxwidget timer I'll gladly hit that up.  Thanks for the info

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


Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-15 Thread Grant Edwards
On 2005-07-15, Michael Hudson [EMAIL PROTECTED] wrote:
 Grant Edwards [EMAIL PROTECTED] writes:

 I've read over and over that Python leaves floating point
 issues up to the underlying platform.  

 Please read the conversation Tim and I are having in the Re:
 math.nroot [was Re: A brief question.] elsewhere in this same
 newsgroup.

Thanks, I just found it.

-- 
Grant Edwards   grante Yow!  I Know A Joke!!
  at   
   visi.com
-- 
http://mail.python.org/mailman/listinfo/python-list


open a mail and...

2005-07-15 Thread Alberto Vera



Hello

Is it possible to open a mail and download its 
files attached in a hard-disk using a python script?

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

Re: open a mail and...

2005-07-15 Thread Fabien
 Is it possible to open a mail and download its files attached in a
 hard-disk using a python script?

Use the poplib to do that. The documentation for this module can be
found at http://docs.python.org/lib/module-poplib.html.

-- 
Fabien

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


Re: open a mail and...

2005-07-15 Thread Tim Williams (gmail)
On 7/15/05, Alberto Vera [EMAIL PROTECTED] wrote:

 Hello

 Is it possible to open a mail and download its files attached in a hard-disk
 using a python script?

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


yes, use the email module.

 msg = email.message_from_file(an_opened_file)
or
 msg = email.message_from_string(a_mail_string)

then use:

For part in msg.walk():
   do_something(part)

The email docs will help you with converting and extracting the
specific attachements you are expecting

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


Re: all possible combinations

2005-07-15 Thread rbt
Wow. That's neat. I'm going to use it. Thanks!

On Thu, 2005-07-14 at 19:52 -0400, Peter Hansen wrote:
 Bengt Richter wrote:
  On Thu, 14 Jul 2005 17:10:37 -0400, William Park [EMAIL PROTECTED] wrote:
  It's a one liner in Python too ;-)
  
print ' '.join([x+y+z+q for s in ['abc'] for x in s for y in s for z 
  in s for q in s])
 
 Or for the cost of an import and a lambda, you can keep it looking real 
 obscure and generalize it to any size of sequence ('abcdef' or whatever) 
 and a result length of up to 52 elements:
 
   from string import letters as L
   cartesian = lambda seq, num: eval(list(%s for __ in [seq]
 %s) % ('+'.join(L[:num]), 'for %s in __ ' * num % tuple(L[:num])))
 # (there are spaces at any line breaks above)
 
   cartesian('abcde', 6)
 ['aa', 'ab', 'ac', 'ad', 'ae', 'ba',
 ...
 'ec', 'ed', 'ee']
   len(_)
 15625
 
 grin
 
 -Peter

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


IDLE in Jython

2005-07-15 Thread Nadeem Mohsin
Me and a couple of friends have been thinking of doing something
involving Python for our final year undergrad project. We're
considering the first idea mentioned on this page:
http://wiki.python.org/moin/JythonProjects.

Unfortunately, their statement is a little terse, so I was hoping
someone could give us a better idea of what they wanted. As far as I
can see, they want us to build an integrated development environment
for Jython along the lines of Python's traditional IDLE. Have I gotten
confused, or this really the gist of the idea?

If I've got it right, I'd appreciate some help on the following issues:
1. The broad outlines of what we'll have to do - how much Java and how
much Python?
2. Any Jython specific issues I need to be aware of? How big a part
will Jython play in development?
3. Some idea of the scope of this project and the time it might take a
team of three to get it up and running.

We're looking for something fairly challenging, but not so difficult
that we won't be able to finish it off in time. We have about 7-8
months to pull it off, but we'll have a bunch of pretty hectic exams,
assignments, entrance tests, grad school apps and stuff like that for a
pretty significant proportion of that time. The 'powers that be' are
officially giving us one day a week for it, though I'm pretty certain
we can increase that, and we'll have about a month of free time at the
end of this semester, and less hectic schedules in the next. I'm pretty
certain it's possible, but better heads than mine have been wrong...If
anyone has any ideas for other interesting projects involving Python,
we'd like to hear them too.

At present I'm the only Python coder in the group, but all three of us
are pretty good with Java, and we have a fair amount of experience
doing GUIs in Swing. Hope you guys can help us out.

Nadeem.

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


Re: How can I import a py script by its absolute path name?

2005-07-15 Thread could ildg
Thank you for your help.
It's really useful for me.

On 7/14/05, Chris Lambacher [EMAIL PROTECTED] wrote:
 You probably actually want:
 
 import sys
 sys.path.instert(0, r'c:\xxx\yyy')
 m = __import__('zzz', globals(),  locals(), [])
 del sys.path[0]
 
 Because if another module named zzz exists in your path.  Appending will pick
 those versions up first.  Then you delete the path you just added so that you
 don't have any problems importing other modules that may have the same names a
 python files in the path you just added.
 
 -Chris
 On Thu, Jul 14, 2005 at 02:52:31PM +0300, Edvard Majakari wrote:
  could ildg [EMAIL PROTECTED] writes:
 
   I want to import c:\xxx\yyy\zzz.py into my programme,
   What should I do?
   Thank you~
 
  import sys
  sys.path.append('c:\xxx\yyy')
  import zzz
 
  (Untested, similar idiom would work in *nix systems, never programmed in
  Windows)
 
  However, I guess it is not very usual you should need to import stuff from
  arbitrary locations. Consider publishing those modules in normal Python
  include path (just see what ''print sys.path'' produces)
 
  --
  # Edvard Majakari Software Engineer
  # PGP PUBLIC KEY availableSoli Deo Gloria!
 
  $_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
  join('',map{chr hex}(split/(\w{2})/)),uc 
  substr(crypt(60281449,'es'),2,4),\n;
  --
  http://mail.python.org/mailman/listinfo/python-list
 --
 http://mail.python.org/mailman/listinfo/python-list

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


Re: System calls not using correct permissions?

2005-07-15 Thread [EMAIL PROTECTED]
Oops, yeah I should have mentioned some of that. It's a Linux
environment, and it's running Python 2.2. To my knowledge, the batch
files my program calls run a few processes on some data and generate a
few temporary files. I believe those files are not correctly being
generated. There is an error message in one of the scripts that says
could not find xxx.xxx, which is a temp file it creates. The batch
files are all executed with tcsh.

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


Re: eBay.py - Has anyone looked at this???

2005-07-15 Thread provato
Thanks. That helps.

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


Re: httplib/HTTPS Post Problem

2005-07-15 Thread Andreas Kostyrka
Am Montag, den 11.07.2005, 06:29 -0700 schrieb [EMAIL PROTECTED]:
 Hi,
 
 Sorry to post what might seem like a trivial problem here, but its
 driving me mad!
 
 I have a simple https client that uses httplib to post data to a web
 server.
 
 When I post over http  https using curl the data is recieved by the
 web server with no problems.

Just a curious guess: Are you behind a proxy? If so, it's a known and
never fixed bug from Python 1.5 times ;)

You might also try to use PyCurl.

Andreas

 
 When I post using my python client the headers get there, but the body
 of the message does not.
 
 My code is pretty standard and has the format:
 
 
 httplib.HTTPSConnection.debuglevel = 1
 connection = httplib.HTTPSConnection(host_name, key_file = key,
 cert_file = cert)
 connection.putrequest(POST, path)
 connection.putheader(Content-Length, str(len(body)))
 
 ...(some more headers)...
 
 connection.endheaders()
 connection.send(body)
 
 response = connection.getresponse()
 connection.close()
 
 (some code has been removed for clarity)..
 
 I can see in the debug messages the body getting sent, but nothing
 arrives at
 the server...
 
 I think I would understand whats going on better if I knew how Python
 uses the
 underlying socket - does it
 
 a) open the socket, send the header  body together or
 b) send the header, wait, then send the body?
 
 I think the answer to this question solve my problem - can anyone help?
 
 Thanks.
 
 p.s. I'm using Python 2.3.3 [GCC 3.3.3 (SuseLinx)]
 


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
-- 
http://mail.python.org/mailman/listinfo/python-list

How to send broadcast message over network and collect all the IP address?

2005-07-15 Thread Sandeep Arya
Hello to all

Well this is my first mail on this list. I am facing a problem associated 
with collecting IP address on my network.

What i thought is to send broadcast packet over the network and then 
recieving back the reply from the computers and bridges connected to my 
network and then adding their IP Address in a list.

How this can be achieved? Say my computer on which application will run's IP 
is 192.168.100.254 and subnetmask is 255.255.255.0

How to do this in core Python?

Sandeep

_
7000 classifieds 
http://www.sulekha.com/classifieds/cllist.aspx?nma=INref=msn -Chennai, 
Mumbai, Hyderabad Bangalore.

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


Re: Reading variables from a forked child (Python C/API)

2005-07-15 Thread Donn Cave
Quoth MrEntropy [EMAIL PROTECTED]:

|   I'm having a little trouble getting an idea running. I am writing a C 
| program which is really a frontend to a Python program. Now, my C 
| program starts up, does some initialisation like initialisation of it's 
| variables and Py_Initialize() and then it fork()s. After forking the 
| child launches the python program with Py_Main() and with the parent I 
| want to be able to read the variables of the Python program. I have 
| tried many ways but cannot find a solution to do this.

That's because there is no solution.  After a fork, the only effect
observable in the parent process is the return value of fork, which
will have a non-zero value.  Subsequent execution in the child process
occurs completely independently from the parent, and leaves no trace
whatever.  So you can't read variables from memory, that were set by
the child.

Past that, I deleted the rest of your post because it sort of avoids
the question of what you're really trying to accomplish and what errors
you actually got, but note that just for the sake of avoiding segmentation
faults etc., it's a good idea when writing in C to check return values:

obj = PyMapping_GetItemString(dict, foo);
if (obj) {
...
} else {
...
}

Anyway, if you really need a subprocess, you're going to have to
communicate with it via some sort of I/O, like UNIX pipes or temporary
files or something.  You probably don't need to call Python from C,
may as well just invoke python (cf. os.spawnv)

Donn Cave, [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to send broadcast message over network and collect all the IP address?

2005-07-15 Thread Francesco Ciocchetti
Sandeep Arya wrote:

Hello to all

Well this is my first mail on this list. I am facing a problem associated 
with collecting IP address on my network.

What i thought is to send broadcast packet over the network and then 
recieving back the reply from the computers and bridges connected to my 
network and then adding their IP Address in a list.

How this can be achieved? Say my computer on which application will run's IP 
is 192.168.100.254 and subnetmask is 255.255.255.0

How to do this in core Python?

Sandeep

_
7000 classifieds 
http://www.sulekha.com/classifieds/cllist.aspx?nma=INref=msn -Chennai, 
Mumbai, Hyderabad Bangalore.

  

I'm leaving from office now so i can not give a more complete answer ... 
i would use an ARP Request to all network address on your network and 
check who answer. Check out libdnet (http://libdnet.sf.net) for a python 
module implementing networking funcions.

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


Re: Python Programming Contest

2005-07-15 Thread skip

Brian This contest is for people who like thinking about algorithms.

Surely you must have missed the smiley...

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


Exception in callback = GPF?

2005-07-15 Thread Francois De Serres
Hiho,

When there's an unhandled exception in my 
extension-module's-callback-into-Python-function-object, I get a GPF and 
Python exits.
When the exception is being handled within the callback (hence in 
Python), I get a very significant hiccup (1 to 5 seconds freeze).

Question: is there a specific way to deal with exceptions when they 
happen inside such a callback? I searched the web with no avail. All 
callbacks examples I've seen seem not to care about exceptions.

Maybe of importance: the callback is initiated within a native thread.
My C extension module is calling back into Python like this:

/* Python callback function object. */
static PyObject * my_callback = NULL;

/* C callback function passed to the implementation. */
static void external_callback(const MidiData * const data) {

if (my_callback  (my_callback != Py_None)) {

if (! data) {
PyErr_SetString(PyExc_IndexError, getLastErrorMessage());
} else {
   
PyObject * arglist = NULL;
PyObject * result = NULL;
   
PyGILState_STATE gil = PyGILState_Ensure();

arglist = Py_BuildValue((i,i,s#), data-deviceIndex, 
data-timestamp, data-buffer, data-size);// 0, 0, test, 4);//
result = PyEval_CallObject(my_callback, arglist);   
   
Py_DECREF(arglist);
Py_DECREF(result);
   
PyGILState_Release(gil);
}

}
}

TIA,
Francois

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


Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
[EMAIL PROTECTED] wrote:
 Brian This contest is for people who like thinking about algorithms.
 
 Surely you must have missed the smiley...

No, I saw it but it just confused me as I have no sense of humor.

Cheers,
Brian

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


MailMonitor for Exchange has processed a suspicious mail[Scanned]

2005-07-15 Thread MailMonitor
A mail sent by you has been identified as suspicious by MailMonitor for 
Exchange.

Event:  infection 
Action: Message quarantined 
Message ID: [EMAIL PROTECTED] 
Message subject:Mail System Error - Returned Mail 
Recipient:  [EMAIL PROTECTED] [EMAIL PROTECTED] 

=

Attachment information:
Event:  infection  
Action: Unable to disinfect 
Filename:   letter.zip 
Virus:  W32/MyDoom-O 
=

Attachment information:
Event:  infection  
Action: Unable to disinfect 
Filename:   letter.zip 
Virus:  W32/MyDoom-O 
=
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Programming Contest

2005-07-15 Thread Thomas Lotze
Brian Quinlan wrote:

 I've decided that it would be be fun to host a weekly Python programming
 contest.

I like the idea, and doing the first problem was fun indeed
:o)

 I'm always looking for feedback, so let me know what you think or if you
 have any ideas for future problems.

It would be nice if you could put up a suite of test data with oracle
solutions for download. For those sitting behind a modem line (like me),
it would be a great help and speed up of the testing cycle.

Thanks for your effort, in any case!

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


Re: Differences between RDFlib - 4RDF and Redfoot - 4Suite?

2005-07-15 Thread uche . ogbuji
I was wondering about the differences with the referred libs and
servers.
Since the documentation isn't so thorough(and a bit because of my
laziness), I thought I'd make request for usage accounts etc. stating
the pros and cons of the aforementioned. Any notes would be
appreciated.

RDFLib is a thinner layer, more of the raw API.  4RDF adds in Versa
query, a graph visualization tool, and multiple back ends.  However,
for the longest time the idea has been to merge the strengths of the
two packages (big example: rdflib's parser is up to the latest round of
specs.  4RDF's is not).  As part of a client project I've actually
begun the process of replacing 4RDF's parser with rdflib's in 4Suite (a
separate add-on until the 4Suite 1.1. branch emerges).

I'd say for now if you just need quick RDF parsing, and you're not also
using plain XML, and stuff like Versa RDF query language aren't
important to you, you'll get along just fine with rdflib.

-- 
Uche
http://copia.ogbuji.net

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


Re: Native ODBC access for python on linux?

2005-07-15 Thread callmebill
All,

This info was very helpful, and I'm up and running with MySQLdb on
linux, and the native ODBC support on Windows.

One last question I have:  In vbs (specifically with .asp) I can make a
connection to an ODBC provide _without_ the need to specify a system
DSN in the Control Panel.  It's easy to do with MySQLdb.connect(
host,user,pass,etc), but is this possible with the ODBC module in
Python on win32?

Thanks again for all the help.  This has really narrowed the gap in my
knowledge significantly.

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


Re: How can I import a py script by its absolute path name?

2005-07-15 Thread J.Bijsterbosch
Hello Edward,

Edvard Majakari [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]
 Thorsten Kampe [EMAIL PROTECTED] writes:

  sys.path.append('c:\\xxx\\yyy') or sys.path.append('c:/xxx/yyy')

 Well, of course. As I said, it was untested :) I just copied the path
string,
 and didn't remember Windows uses path names which need special
 treatment.

Hmm, what you call special treatmentg comes from pythons deep underlying C
and C++ language heietidge I presume. A backslash in a C or C++ string means
the following character is a so called escape character, like \n represents
a newline and \r a return to the beginning of a line.
If you really want a backslash you need to type it twice like so \\. Has
nothing to do with Windows...;-))

Greetings from sunny Amsterdam,

Jan


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


Re: ANN: CherryPy-2.1.0-beta released

2005-07-15 Thread Damjan
 I am happy to announce the first beta release of CherryPy-2.1

Can you briefly compare CherryPy to Quixote2 (+session2)?

 unicode decoding/encoding,

This especially interesting to me. 
Is CherryPy completelly unicode (and UTF-8) ready. 
The thing that frustrates me about quixote2 is that it has a lot of
assumptions that text is a str object in the latin1 encoding. 
I succeded to patch quixote to be usable but that may not be enough.

My quixote application works with unicode objects all the time, and the only
place I want UTF-8 is when the content is sent to the client... (or when
its stored in a database or file which I handle myself fine).

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


Issues compiling with large file support

2005-07-15 Thread pruebauno
Hello all,
I am having issues compiling Python with large file support. I tried
forcing the configure script to add it but then it bombs in the make
process. Any help will be appreciated.

Information:
Architecture:
PowerPc on AIX version 5

Compiler:
VisualAge C++ Professional / C for AIX Compiler, Version 6

Python version:
Python 2.4.1

Error Message:
cc_r -c  -DNDEBUG -g -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-I
. -I./Include  -DPy_BUILD_CORE -o Objects/fileobject.o
Objects/fileobject.c
Objects/fileobject.c, line 382.2: 1506-205 (S) #error Large file
support, but neither off_t nor fpos_t is large enough.
Objects/fileobject.c, line 389.27: 1506-046 (S) Syntax error.
Objects/fileobject.c, line 423.2: 1506-205 (S) #error Large file
support, but no way to fseek.
Objects/fileobject.c, line 431.8: 1506-166 (S) Definition of function
Py_off_t requires parentheses.
Objects/fileobject.c, line 432.1: 1506-276 (S) Syntax error: possible
missing
'{'?Objects/fileobject.c, line 446.2: 1506-205 (S) #error Large file
support, but no way to ftell.
Objects/fileobject.c, line 456.18: 1506-275 (S) Unexpected text
offset encountered.
Objects/fileobject.c, line 456.9: 1506-045 (S) Undeclared identifier
Py_off_t.
Objects/fileobject.c, line 468.9: 1506-045 (S) Undeclared identifier
offset.
Objects/fileobject.c, line 476.48: 1506-099 (S) Unexpected argument.
Objects/fileobject.c, line 494.18: 1506-275 (S) Unexpected text
newsize encountered.
Objects/fileobject.c, line 494.9: 1506-045 (S) Undeclared identifier
Py_off_t.
Objects/fileobject.c, line 496.18: 1506-275 (S) Unexpected text
initialpos encountered.
Objects/fileobject.c, line 513.9: 1506-045 (S) Undeclared identifier
initialpos.
Objects/fileobject.c, line 525.17: 1506-045 (S) Undeclared identifier
newsize.
Objects/fileobject.c, line 586.52: 1506-099 (S) Unexpected argument.
Objects/fileobject.c, line 604.18: 1506-275 (S) Unexpected text pos
encountered.
Objects/fileobject.c, line 604.9: 1506-045 (S) Undeclared identifier
Py_off_t.
Objects/fileobject.c, line 610.9: 1506-045 (S) Undeclared identifier
pos.
make: 1254-004 The error code from the last command is 1.

Stop.


More info:

checking MACHDEP... aix5
checking EXTRAPLATDIR...
checking for --without-gcc...
checking for --with-cxx=compiler... no
checking for c++... no
checking for g++... no
checking for gcc... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for gcc... cc_r
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether cc_r accepts -g... yes
checking for cc_r option to accept ANSI C... none needed
checking how to run the C preprocessor... cc_r -E
checking for egrep... grep -E
checking for AIX... yes
checking for --with-suffix...
checking for case-insensitive build directory... no
checking LIBRARY... libpython$(VERSION).a
checking LINKCC... $(srcdir)/Modules/makexp_aix Modules/python.exp .
$(LIBRARY);
 $(PURIFY) $(CC)
checking for --enable-shared... no
checking for --enable-profiling...
checking LDLIBRARY... libpython$(VERSION).a
checking for ranlib... ranlib
checking for ar... ar
checking for a BSD-compatible install... ./install-sh -c
checking for --with-pydebug... no
checking whether cc_r accepts -OPT:Olimit=0... no
checking whether cc_r accepts -Olimit 1500... no
checking whether pthreads are available without options... yes
checking for ANSI C header files... yes

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


RE: ANN: CherryPy-2.1.0-beta released

2005-07-15 Thread Robert Brewer
Damjan wrote:
  I am happy to announce the first beta release of CherryPy-2.1
 ...
  unicode decoding/encoding,
 
 This especially interesting to me. 
 Is CherryPy completelly unicode (and UTF-8) ready?
 The thing that frustrates me about quixote2 is that it has a lot of
 assumptions that text is a str object in the latin1 encoding. 
 I succeded to patch quixote to be usable but that may not be enough.
 
 My quixote application works with unicode objects all the 
 time, and the only place I want UTF-8 is when the content
 is sent to the client... (or when its stored in a database
 or file which I handle myself fine).

Encoding is a snap in CherryPy 2.1. Write your application using unicode
objects, then have all output converted to UTF-8 by simply writing in
your config file:

encodingFilter.on = True

To use a different encoding, write:

encodingFilter.encoding = ascii

Encoding is restricted to a limited set of MIME types; 'text/html' is
the default list. To change that, use the config entry:

encodingFilter.mimeTypeList = ['text/html', 'text/plain']

All of these configuration entries are specifiable per-path, so
different portions of your site can use different encoding schemes.


Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: threads and sleep?

2005-07-15 Thread Piet van Oostrum
 Christopher Subich [EMAIL PROTECTED] (CS) wrote:

CS Hrm... this would suggest the possibility of designing a metaclass,
CS perhaps, that would ensure synchronous access to an object.  Perhaps wrap
CS the class in another, that gets and releases a mutex on any external
CS get/set access (except, possibly, for a specified list of asynchronous
CS data members and methods).

Sometimes that's not enough, because you may have to synchronise access to
a couple of objects, or to multiple operations on some object(s). The
system can't know the required granularity of locking, only the application
programmer knows that.
-- 
Piet van Oostrum [EMAIL PROTECTED]
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading variables from a forked child (Python C/API)

2005-07-15 Thread Jonathan Conrad
#ifdef def
Donn Cave wrote:
 Quoth MrEntropy [EMAIL PROTECTED]:
 
 | I'm having a little trouble getting an idea running. I am writing a C 
 | program which is really a frontend to a Python program. Now, my C 
 | program starts up, does some initialisation like initialisation of it's 
 | variables and Py_Initialize() and then it fork()s. After forking the 
 | child launches the python program with Py_Main() and with the parent I 
 | want to be able to read the variables of the Python program. I have 
 | tried many ways but cannot find a solution to do this.
 
 That's because there is no solution.  After a fork, the only effect
 observable in the parent process is the return value of fork, which
 will have a non-zero value.  Subsequent execution in the child process
 occurs completely independently from the parent, and leaves no trace
 whatever.  So you can't read variables from memory, that were set by
 the child.

Though there is probably some solution involving a third party 
such as POSIX threads, Linux has a clone(2) procedure which 
fork(2) is a macro of.  It is tricky to use, but allows for 
having the child process have the same pid, memory, memory 
mappings, file tables, etc.  BSD mmap(2) is more portable and can 
be used for interprocess sharing.  The solution which Don Cave 
provided is probably the one that Mr. Entropy needs to start 
with.  More specifically, ...

#else

int main (int argc, char **argv)
{
int fd0, fd1, fd2;
{
int fd_in [2], fd_out [2], fd_err [2];
pipe (fd_in);  fd0 = fd_in  [1];
pipe (fd_out); fd1 = fd_out [0];
pipe (fd_err); fd2 = fd_err [0];
if (!fork ()) {
dup2 (fd_in  [0], 0); close (fd0);
dup2 (fd_out [1], 1); close (fd1);
dup2 (fd_err [1], 2); close (fd2);
execl (python, python, 0);
perror (execution failed);
exit (1);
}
}

write (fd0, print None\n, 11);
write (1, b, read (fd1, b, sizeof (b) /* 5 or more */));

#define write0(q...) write (fd0, print  #q \n,  \
sizeof (#q) + 5 + 1 - 1)
write0 (True);  write (1, b, read (fd1, b, sizeof (b)));
write0 (5, str (5.0), ...);
write (1, b, read (fd1, b, sizeof (b)));
return write0 (True, False, None,
True and False,
True and None,
False and None,
True and False and None)  0;
}

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


problems with python 2.4 help

2005-07-15 Thread [EMAIL PROTECTED]
I've noticed that the listings in help don't take you to correct topic.

anyone else have this problem?  Is there a fix?

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


Re: Native ODBC access for python on linux?

2005-07-15 Thread Thomas Bartkus
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 All,

 This info was very helpful, and I'm up and running with MySQLdb on
 linux, and the native ODBC support on Windows.

 One last question I have:  In vbs (specifically with .asp) I can make a
 connection to an ODBC provide _without_ the need to specify a system
 DSN in the Control Panel.  It's easy to do with MySQLdb.connect(
 host,user,pass,etc), but is this possible with the ODBC module in
 Python on win32?


Ahhh - But that's the point!

If you are up and running with MySQLdb on linux then you should be up and
running with with the same code on Windows.  The exact same Python script
you run on Linux will work for you on windows!  I *think* you might be able
to attach the ODBC driver but it would be a complication and an unnecessary
one at that.  Just point MySQLdb.connect() at the servers IP address.

Go to SourceForge and download  the MySQLdb installation for win32
[MySQL-python.exe-1.2.0.win32-py2.4.exe].

Sometimes you can't believe it because it's too easy :-)
Thomas Bartkus


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


Re: Any Lua Coders About?

2005-07-15 Thread Cameron Laird
In article [EMAIL PROTECTED],
Joseph Garvin  [EMAIL PROTECTED] wrote:
Wendell III wrote:

Hey,

I'm looking for a few good Lua guys with some IM network experience. 
Anyone around fit that criteria?
.
.
.
I'd say it's a no brainer to try lua's mailing list ;)

Incidentally, San Jose will host The Workshop, the big public event in
the Lua world, at the end of the month.

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


ssh popen stalling on password redirect output?

2005-07-15 Thread [EMAIL PROTECTED]
I have a script that I cycle through nodes connect to them and run
uptime to get some information.  I run the script as root so it doesn't
require a password on the rest of the nodes.  It does however barf on
the nodes that are having trouble and require a different password.  Is
there an easy way to skip these nodes?  Maybe redirect the password
prompt to stdout or stderr or even skip them?

Thanks in advance here is the current script.

info=os.popen('ssh node208 uptime')
sys.stderr=info
sys.stderr.write(info)

I'm very new to python if you could give me a link to an article that
would also be helpful.  The documentation on python is very hard to
find as compared with php.net's php documentation.

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


Re: IDLE in Jython

2005-07-15 Thread Casey Hawthorne
How about the following:

- making Jython mostly work up to Python 2.4?

- making a PVM (Python Virtual Machine) for the Palm?


--
Regards,
Casey
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: problems with python 2.4 help

2005-07-15 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 15/07/2005 14:50:
 I've noticed that the listings in help don't take you to correct topic.
 
 anyone else have this problem?  Is there a fix?
 

I'm not sure from your question what exact problem you are 
experiencing. Do you mean:

IDLE 1.1.1
  help()

Welcome to Python 2.4!  This is the online help utility.

snip

help topics

Here is a list of available topics.  Enter any topic name to get more 
help.

ASSERTION   DELETIONLOOPING SEQUENCES
snip
DEBUGGING   LITERALSSEQUENCEMETHODS2

help LOOPING

Sorry, topic and keyword documentation is not available because the Python
HTML documentation files could not be found.  If you have installed them,
please set the environment variable PYTHONDOCS to indicate their location.

help


If so, I posted a similar question a year or so ago to the tutor list. 
I believe that when I resolved it I posted details about the resolution.

I've since got a new computer, and just redid it now to check. Just 
download the html version of the docs and then, as per the 
instructions above, set an environment variable to point to them. (On 
WinXP: Control Panel-System-Advanced-Env. Var. When I had WinME, a 
line in autoexec.bat)

Best,

Brian vdB

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


Re: Python Newbie

2005-07-15 Thread Mitja
On Thu, 14 Jul 2005 12:24:29 +0200, linuxfreak [EMAIL PROTECTED] wrote:

 So heres me asking if anyone has any pointers
 to some good basic python tutorial. Something that teaches one to get
 going.

The official tutorial is quite informal yet effective:
python.org - documentation - tutorial
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Native ODBC access for python on linux?

2005-07-15 Thread callmebill
I know... I'm expecting pain, and when that pain doesn't arrive I
assume that I did something wrong.

Actually, I was using the odbc/dbi stuff that ships with the win32
distribution for my windows work, and using MySQLdb for my linux work.
Most of the code is the same.  But I suppose the big benefit of using
MySQLdb on both (which certainly works) is that there is no abiguity as
to what the user is running for an OS.  You don't have a special case
If you're on Windows, do this;  if you're on linux, do that...
Rather, by having everyone indiscriminately require MySQLdb, then that
forces a unity.  That's probably the way to go, huh?

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


Re: System calls not using correct permissions?

2005-07-15 Thread Dan Sommers
On 15 Jul 2005 07:10:10 -0700,
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Oops, yeah I should have mentioned some of that. It's a Linux
 environment, and it's running Python 2.2. To my knowledge, the batch
 files my program calls run a few processes on some data and generate a
 few temporary files. I believe those files are not correctly being
 generated. There is an error message in one of the scripts that says
 could not find xxx.xxx, which is a temp file it creates. The batch
 files are all executed with tcsh.

Again, just a guess, but one of (the many) reasons not to use tcsh is
that it has some very strange (to me, anyway) rules about which startup
files (e.g., .login) to run when.  Perhaps one of your such files is
being executed in one case and not the other, and is doing something
relevant to an environment variable or umask.

Regards,
Dan

-- 
Dan Sommers
http://www.tombstonezero.net/dan/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ssh popen stalling on password redirect output?

2005-07-15 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with:
 I have a script that I cycle through nodes connect to them and run
 uptime to get some information.  I run the script as root so it
 doesn't require a password on the rest of the nodes.  It does
 however barf on the nodes that are having trouble and require a
 different password.  Is there an easy way to skip these nodes?
 Maybe redirect the password prompt to stdout or stderr or even skip
 them?

Why not set up proper public/private key authentication, and don't
bother with passwords at all?

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
 Frank Zappa
-- 
http://mail.python.org/mailman/listinfo/python-list


What module to use to get a file from a website?

2005-07-15 Thread SolaFide
I'm sure this is builtin, I just don't know what module. Thank you for
any help!

Billt

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


Re: What module to use to get a file from a website?

2005-07-15 Thread [EMAIL PROTECTED]
urllib2.urlopen()

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


Re: ssh popen stalling on password redirect output?

2005-07-15 Thread [EMAIL PROTECTED]

In general, it is good idea to use expect kind of tool to deal with
interactive programs like ssh. You may try using pexpect
(http://pexpect.sourceforge.net).

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


Re: What module to use to get a file from a website?

2005-07-15 Thread Sybren Stuvel
SolaFide enlightened us with:
 I'm sure this is builtin, I just don't know what module. Thank you
 for any help!

urllib, read the excellent free book dive into python at
http://www.diveintopython.org/ for examples and usage.

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
 Frank Zappa
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Native ODBC access for python on linux?

2005-07-15 Thread Grig Gheorghiu
That's exactly the way to go. In my case, I'm using cx_Oracle to
connect from Python to Oracle and the same exact code runs on Windows,
Linux, Solaris and soon on AIX.

Grig

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


Re: Newbie question: Explain this behavior - a followup

2005-07-15 Thread David Smith
First, thanks to those who offered answers.  They didn't really answer
my question, only because I had not worked through the example
sufficiently well.  Doing this, I believe I understand what is
happening, and, if my understanding is correct, have discovered that for
other beginning and ending values for the two range statements, the
example doesn't work.

Given that the beginning and ending values for the inner range statement
are the same, the inner range statement will never be executed for its
first iternation; the else will be.  This is not correct.  Simply make
the beginning value a non-prime number, and the program still prints out
that that number is prime.  Changing both beginning and ending values on
the two statements, the ouput is differentially buggy.


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


Re: How can I import a py script by its absolute path name?

2005-07-15 Thread Terry Hancock
On Thursday 14 July 2005 07:43 am, Thorsten Kampe wrote:
 * Edvard Majakari (2005-07-14 12:52 +0100)
  could ildg [EMAIL PROTECTED] writes:
  I want to import c:\xxx\yyy\zzz.py into my programme,
  What should I do?
  Thank you~
  
  import sys
  sys.path.append('c:\xxx\yyy')
 
 sys.path.append('c:\\xxx\\yyy') or sys.path.append('c:/xxx/yyy')

While this will work, I think the OP may want something simpler:

my_mod = __import__('c:\\xxx\\yyy\\mymodule.py')

especially if this is following up on the relative path workaround (in
which case the result will be buried in the relative path import function).

The sys.path solution is the technique you should be using to
establish a top-level directory for your package.  Once you do
that, you can use __init__.py and dotted imports to get to everything
in your package by absolute paths (that is, relative to the top-level
package, rather than to each sub-package).  This is the preferred
Python approach in the current design.

However, the idea that it would be desireable to import packages by
something like ../main_package/other_subpackage/module2.py
has been suggested, and you can implement something like this using
the __import__ built-in as suggested above.

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com


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


Re: IDLE in Jython

2005-07-15 Thread Bill
You might get better answers if you contact the Jython developers
themselves and look at their wiki -
http://www.jython.org/cgi-bin/wiki/FrontPage. Even though you found the
posting on a Python wiki, you really want to consult the Jython
community, and I'm not sure to what extent they participate in this
newsgroup.

Just by reading the description of the task and your post I'd say the
project is certainly doable, but not trivial. Since IDLE is a Python
application the path of least resistance would be to port it to Jython.
The majority of work would probably be in replacing the Tk GUI with a
Java-based GUI. You say that your people have experience with Swing so
you have a leg up on that part.

Since Jython currently does not support all of the latest Python, you
likely will have to work around some features incorporated in the
latest IDLE. As you say that your team has limited experience with
Python, this might be the most challenging part. I'd ask here just how
much experience your team has had with maintenance programming.
Modifying someone elses code is a different task than writing new code
from specifications, and some programmers dislike this kind of work. I
mention this because I think that designing and building an IDE from
scratch IS more than you want to tackle.

You might want to look at some of the other IDEs that support Python.
One of the things you'll want to do is reverse engineer IDLE. If you
are currently using Eclipse for Java development, there are a couple of
plugins for Python which should support Jython to some extent.

Bill

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


Re: What module to use to get a file from a website?

2005-07-15 Thread SolaFide
Thanks!

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


Re: Generating a list of None

2005-07-15 Thread Bengt Richter
On 14 Jul 2005 19:25:41 -0700, Nicolas Couture [EMAIL PROTECTED] wrote:

Hi,

Is it possible to generate a list of `None' ?

opts.__dict__.values() below could be represented by [None, None, None]

---
def get_options(opts):
Return True or False if an option is set or not
vals = opts.__dict__.values()

for val in vals:
if val is not None:
return True

return False
---

This is how I'd like to see it:

---
def get_options(opts):
Return True or False if an option is set or not
vals = opts.__dict__.values()

for if vals is [None * len(vals)]:
return False

return True
---

how about (untested)

 def get_options(opts):
 Return True or False if an option is set or not
 return [1 for val in vars(opts).values() if val is not None] and True or 
False

Regards,
Bengt Richter
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie question: Explain this behavior - a followup

2005-07-15 Thread max
David Smith [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]: 

 range statements, the example doesn't work.
 
 Given that the beginning and ending values for the inner range
 statement are the same, the inner range statement will never be

Is your question about the semantics of for else blocks or about the 
suitability of the algorithm given in the example? The for else block 
is behaving exactly as expected...

 range(1,1)
[]
 range(500,500)
[]
 

see 
http://groups-
beta.google.com/group/comp.lang.python/browse_frm/thread/d6c084e791a00
2f4?q=for+elsehl=en

for a good explanation of when the else part of the loop is executed. 
Basically, whenever the loop is exited normally, which is what happens 
when you iterate over an empty list like the one returned by 
range(1,1)


max


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


Filtering out non-readable characters

2005-07-15 Thread MKoool
I have a file with binary and ascii characters in it.  I massage the
data and convert it to a more readable format, however it still comes
up with some binary characters mixed in.  I'd like to write something
to just replace all non-printable characters with '' (I want to delete
non-printable characters).

I am having trouble figuring out an easy python way to do this... is
the easiest way to just write some regular expression that does
something like replace [^\p] with ''?

Or is it better to go through every character and do ord(character),
check the ascii values?

What's the easiest way to do something like this?

thanks

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


Re: Snakespell

2005-07-15 Thread Aahz
[posted  e-mailed -- prefer response by posting]

In article [EMAIL PROTECTED],
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

I used to use Snakespell from scriptfoundry to do spellchecking on my
website (www.peterbe.com/search?q=pyton) but now that I've moved server
and wiped the old machine I forgot to take with me the Snakespell code.

www.scriptfoundry.com where it used to live seems to have expired.

I've got a copy, but I'd rather you check with the original author first:
http://starship.python.net/crew/thanos/
-- 
Aahz ([EMAIL PROTECTED])   * http://www.pythoncraft.com/

f u cn rd ths, u cn gt a gd jb n nx prgrmmng.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to create cross-backend python web app

2005-07-15 Thread matt
Thanks Paul-

I'll look into WebStack.

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


Django - Rails killer comes...

2005-07-15 Thread JZ
http://www.djangoproject.com/

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


Re: How can I import a py script by its absolute path name?

2005-07-15 Thread James Dennett
J.Bijsterbosch wrote:

 Hello Edward,
 
 Edvard Majakari [EMAIL PROTECTED] schreef in bericht
 news:[EMAIL PROTECTED]
 
Thorsten Kampe [EMAIL PROTECTED] writes:


sys.path.append('c:\\xxx\\yyy') or sys.path.append('c:/xxx/yyy')

Well, of course. As I said, it was untested :) I just copied the path
 
 string,
 
and didn't remember Windows uses path names which need special
treatment.
 
 
 Hmm, what you call special treatmentg comes from pythons deep underlying C
 and C++ language heietidge I presume. A backslash in a C or C++ string means
 the following character is a so called escape character, like \n represents
 a newline and \r a return to the beginning of a line.
 If you really want a backslash you need to type it twice like so \\. Has
 nothing to do with Windows...;-))

Actually, it does have a connection to Windows.

On Unix, backslashes are rarely used for anything *except* escape
characters.  Pathnames tend not to include backslashes, so in most
cases it's not necessary to escape backslashes in path names.  On
Windows, however, backslash is a valid path separator, and must be
escaped.

So, on Unix, for a path separator, you type /.  On Windows you
can either do the same, or type \\.  (Or (ab)use raw strings.)

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


Python vs. Access VBA

2005-07-15 Thread William Lodge
I'm at a loss on how to compare Python vs. Access VBA for a database
project. I'm estimating 20 tables and several forms and reports. Some of the
tables could grow to many thousands of rows w/i a year or so. The app would
be resident on my client as no network connectivity is needed b/c I'll be
the only user. I'd probably use Access tables for now and plan on scaling up
to Oracle later if necessary (which it probably won't be).

If the project is successful, it may be adopted in the division. There is no
time limit but this is being done on my own time, and my guestimate for a
practical limit would be 3-4 months. I'm not a developer but have done
programming in the academic world as part of MSIS degree. I also want the
app to have a GUI. 

I'm currently reviewing Wingware's Python product. Will review Komodo next.
It doesn't appear that the Wingware product has a GUI builder, but Komodo's
Pro version does (although more costly). Anybody have any recommendations in
this regard? Any thoughts as to whether implementing in Python would be any
harder or easier to do than in Access?

Finally, does anybody know of any Web sites having examples of database apps
in Python?

Thanks for your help. Bill
attachment: winmail.dat-- 
http://mail.python.org/mailman/listinfo/python-list

HTML expect in python

2005-07-15 Thread WGW
I would like to automate some simple browser navigating using python. 
Ideally, I would like a package like pyexpect, but that can handle a 
browser in much the same way as pyexpect handles a terminal (tall 
order!). In short, I want a macro language for a browser (I know about 
the commercial packages such as Easy Bee and Internet macros, but I want 
  more programmability and less cost!)

ClientForms goes in the right direction. Can Grail be scripted (easily)?

What is the best way to run a browser with python? Python would have to 
be able to fill in forms, send them off, click links, and so on. I don't 
really care which browser it is.

Apparently, commandline python scripts can control IE.

Not sure where to find examples

Any suggestions?


(I found the following remark:

A different flavor of client-side Python scripting is that Mark 
Hammond's [ref] hard work has made possible. Internet Explorer (and WSH 
[give ref]) support(s) ActiveScripting [ref] languages, including 
Python. Thus, as Gilles Lenfant enumerated in private correspondence:

 * Command-line Python scripts control IE (but equally well through 
COM [ref]);
 * Client-side scripts interpret Python embedded in HTML as well as 
they do JavaScript [ref];

 * you can write 'hta' applications with full-featured Python (use 
of IE5 for GUI)
)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTML expect in python

2005-07-15 Thread D H
WGW wrote:
 I would like to automate some simple browser navigating using python. 
 Ideally, I would like a package like pyexpect, but that can handle a 
 browser in much the same way as pyexpect handles a terminal (tall 
 order!). In short, I want a macro language for a browser (I know about 
 the commercial packages such as Easy Bee and Internet macros, but I want 
  more programmability and less cost!)

See the mechanize module: http://wwwsearch.sourceforge.net/mechanize/
Or else you can use win32com stuff to automate internet explorer if you 
really need to do it that way.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: problems with python 2.4 help

2005-07-15 Thread Do Re Mi chel La Si Do
Hi !

See :
http://www.gossamer-threads.com/lists/python/bugs/350314




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


[ python-Bugs-1238747 ] subprocess.Popen fails inside a Windows service

2005-07-15 Thread SourceForge.net
Bugs item #1238747, was opened at 2005-07-15 03:31
Message generated for change (Settings changed) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1238747group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Adam Kerrison (adamk550)
Assigned to: Peter Åstrand (astrand)
Summary: subprocess.Popen fails inside a Windows service

Initial Comment:
If you use subprocess.Popen() from within a Windows service and 
you try to redirect stdout or stderr, the call will fail with a TypeError.

The issue appears to be that if you attempt to redirect stdout and/or 
stderr, the module also needs to set up stdin. Since you haven't 
specified what to do with stdin, the code simple duplicates the 
processes stdin handle using GetStdHandle(STD_INPUT_HANDLE)

However, a Windows service doesn't have stdin etc so the returned 
handle is None. This handle is then passed to DuplicateHandle() 
which fails with the TypeError.

A workaround is to explictly PIPE stdin but I have found at least one 
Windows program (the RCMD.EXE utility) that fails if its stdin is a 
pipe! (RCMD says Internal Error 109 ...)

The only other workaround is a to explictly open the NUL device and 
use that for stdin.



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1238747group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1238170 ] threading.Thread uses {} as default argument

2005-07-15 Thread SourceForge.net
Bugs item #1238170, was opened at 2005-07-14 07:37
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1238170group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Threads
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Dahlbacka (sdahlbac)
Assigned to: Reinhold Birkenfeld (birkenfeld)
Summary: threading.Thread uses {} as default argument

Initial Comment:
threading.Thread.__init__ uses {} as default argument
for kwargs,
shouldn't this be the usual
def __init__(...,kwargs=None,...)
if kwargs is None:
kwargs = {}

In normal cases, this is probably not a problem but it
makes it possible to f*ck things up.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-15 03:57

Message:
Logged In: YES 
user_id=80475

This seems reasonable to me.

Reinhold, would you like to do the honors (2.5 only)?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1238170group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1230484 ] tokenize bug

2005-07-15 Thread SourceForge.net
Bugs item #1230484, was opened at 2005-06-30 12:35
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1230484group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Eduardo Aguiar (aguiar)
Assigned to: Tim Peters (tim_one)
Summary: tokenize bug

Initial Comment:
hi,

I have found a bug in 'tokenize' module: it is merging
a COMMENT and a NL token for lines that start with a
comment.

I have made a fell changes and it seems to be working
fine. Follows a patch:

 *** /usr/lib/python2.4/tokenize.py  2005-01-02
03:34:20.0 -0200
--- tokenize.py 2005-06-30 14:31:19.0 -0300
***
*** 216,223 
  pos = pos + 1
  if pos == max: break
  
! if line[pos] in '#\r\n':   # skip
comments or blank lines
! yield ((NL, COMMENT)[line[pos] ==
'#'], line[pos:],
 (lnum, pos), (lnum,
len(line)), line)
  continue
  
--- 216,235 
  pos = pos + 1
  if pos == max: break
  
! if line[pos] == '#':   # skip
comments
! end = len(line) - 1
! while end  pos and line[end] in '\r\n':
!end = end - 1
! end = end + 1
! 
! yield (COMMENT, line[pos:end],
!(lnum, pos), (lnum, end),
line)
! yield (NL, line[end:],
!(lnum, end), (lnum,
len(line)), line)
! continue
! 
! if line[pos] in '\r\n':   # skip
blank lines
! yield (NL, line[pos:],
 (lnum, pos), (lnum,
len(line)), line)
  continue

Best regards,
Eduardo Aguiar ([EMAIL PROTECTED])

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-15 04:00

Message:
Logged In: YES 
user_id=80475

Tim, this affects a line you checked-in, 1.23 on 6/18/2001.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1230484group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1234850 ] Admin privs required for Windows?

2005-07-15 Thread SourceForge.net
Bugs item #1234850, was opened at 2005-07-08 17:52
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1234850group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Distutils
Group: Python 2.3
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Nobody/Anonymous (nobody)
Summary: Admin privs required for Windows?

Initial Comment:
Over in ZopeLand, there's a complaint that the ZODB 
Windows installer requires admin privileges (or 
something like that):

http://www.zope.org/Collectors/Zope/1838

The installer was produced using Python 2.3.5, via

python setup.py bdist_wininst

from the root of a ZODB checkout.  Anyone have a 
guess as to what privs it needs that it might not 
have?  The user says they do have permission to write 
into their Python installation directory, so that's 
not it.  The message they get is You do not seem to 
have sufficient access rights on this machine to 
install this software. 

Status under Python 2.4.1 is unknown.

--

Comment By: Martin v. Löwis (loewis)
Date: 2005-07-15 17:22

Message:
Logged In: YES 
user_id=21627

bsherwood: How is your message related to this bug report?
In this report, the OP reported a problem encountered with
Python 2.3, whereas you seem to suggest a problem with
Python 2.4; the OP indicated that the status of his problem
is unknown for 2.4.

If you want to report a bug in Python 2.4, please create a
new bug report.

--

Comment By: Bruce Sherwood (bsherwood)
Date: 2005-07-15 04:25

Message:
Logged In: YES 
user_id=34881

Debbie Carraway in IT at NCSU gives this important analysis
(she discovered this in the context of using the installer
for VPython, which looks for Python 2.4 in
HKLM\Software\Python\PythonCore\2.4\InstallPath; this used
to work with Python 2.3):

The problem is with the Python 2.4.1 installer. Python will
put the InstallPath registry setting (which indicates where
Python is installed)  under HKEY_CURRENT_USER instead of
HKEY_LOCAL_MACHINE under some circumstances:
 (1) if you are not a member of the Administrators group
 (2) if you choose Install for Just Me rather than
Install for All Users,
 (3) if you automate the Python install using msiexec.exe
/i python-2.4.1.msi /q. The /q (quiet) switch causes
different behavior than the defaults with a manual install
(msiexec.exe /i python-2.4.1.msi).

This is a mistake in the Python installer. The path to an
installed application always belongs under HKLM, because the
path to installed software is a machine-specific setting. If
the path is in HKCU, the InstallPath setting can follow a
user to a machine where Python is not installed. 

--

Comment By: Martin v. Löwis (loewis)
Date: 2005-07-11 18:55

Message:
Logged In: YES 
user_id=21627

The message comes from
PC\bdist_wininst\install.c:OpenLogFile, when attempting to
write to Software\Microsoft\CurrentVersion\Uninstall.
Whether this goes to HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE
apparently depends on whether Python was installed per-user
or per-machine.

In the 2.4.1 version, in CheckRootKey, there is a
HasLocalMachinePrivs function. Mark Hammond added this in
install.c 1.6 in response to #555812 and #555810, so I'm
declaring this bug fixed.

--

Comment By: Tim Peters (tim_one)
Date: 2005-07-08 20:59

Message:
Logged In: YES 
user_id=31435

Bug 1232947 is about installing Python itself.  This one is 
about installing a 3rd-party package that happens to use 
Python (a pre-existing Python), using a Windows installer 
created by Python's distutils package.  It's unlikely the bugs 
have anything in common.

--

Comment By: Patrick Vrijlandt (pvrijlandt)
Date: 2005-07-08 20:48

Message:
Logged In: YES 
user_id=1307917

Did you see bug # 1232947? It provides documentation of 
another failing non-admin install. (2.4.1).


--

Comment By: Tim Peters (tim_one)
Date: 2005-07-08 19:11

Message:
Logged In: YES 
user_id=31435

You should be able to try 2.4.  The Python installer includes 
msvcr71.dll, and should install it into the Python directory 
(instead of into a system directory) is you do a install just 
for me (as opposed to all users) install.

--

Comment By: Alex (hairypalm)
Date: 2005-07-08 18:36

Message:
Logged In: YES 
user_id=1309592

I am the original complainant.  I cannot try python 2.4 

[ python-Bugs-1210326 ] comma separated cookie values

2005-07-15 Thread SourceForge.net
Bugs item #1210326, was opened at 2005-05-28 11:13
Message generated for change (Comment added) made by jjlee
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1210326group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: tvogt (tovo)
Assigned to: A.M. Kuchling (akuchling)
Summary: comma separated cookie values

Initial Comment:
According to RFC 2109

For backward compatibility, the separator in the
Cookie header
is semi-colon (;) everywhere.  A server should also
accept comma (,)
as the separator between cookie-values for future
compatibility.

The Cookie standard module does not support this as it
should.

 import Cookie
 c=Cookie.SimpleCookie()
 c.load('foo=2, bar=3')
 print c['foo'].value
2,



--

Comment By: John J Lee (jjlee)
Date: 2005-07-15 19:12

Message:
Logged In: YES 
user_id=261020

I notice I didn't say explicitly: I think this should be
closed, for the reasons given in my last two comments.


--

Comment By: John J Lee (jjlee)
Date: 2005-06-29 20:53

Message:
Logged In: YES 
user_id=261020

Forgot to add or demo in that CGI script: even

Set-Cookie: abc=def, ghi=jkl

is just one Netscape cookie, name 'abc', value 'def, ghi=jkl'.


--

Comment By: John J Lee (jjlee)
Date: 2005-06-29 20:34

Message:
Logged In: YES 
user_id=261020

Unfortunately one can't take the cookie specs at face value.

Netscape cookies behaviour (the de-facto standard, ie. IE 
Firefox behaviour -- cookie_spec.html is barely worth the
web page it's written on, being flat-out wrong in several
major ways, and very under-specified) has, I'm told, always
simply been simply split on semicolons.  Certainly that's
what IE and Mozilla do now:

(this is just the text of a CGI for viewing: I didn't make
it executable on reportlab.org)

http://www.reportlab.org/~jjlee/cookie_demo.py

IIRC RFC 2965 is only implemented by Opera, and is certainly
now quite dead as an internet standard.  (though I think it
is useful as a guide for writing cookie-handling code, you
can't follow blindly - not even close :-( )


--

Comment By: A.M. Kuchling (akuchling)
Date: 2005-06-02 00:19

Message:
Logged In: YES 
user_id=11375

The updated cookie RFC, RFC 2965, also has this language.


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1210326group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1239120 ] Win registry problem

2005-07-15 Thread SourceForge.net
Bugs item #1239120, was opened at 2005-07-15 15:46
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1239120group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Installation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Bruce Sherwood (bsherwood)
Assigned to: Nobody/Anonymous (nobody)
Summary: Win registry problem

Initial Comment:
Debbie Carraway in IT at NCSU gives this analysis of an
apparent bug in the Python 2.4 installer for Windows.
She discovered this in the context of using the
installer for VPython, which looks for Python 2.4 in

  HKLM\Software\Python\PythonCore\2.4\InstallPath

which used to work with Python 2.3. Here is her report:

The problem is with the Python 2.4.1 installer. Python will
put the InstallPath registry setting (which indicates where
Python is installed)  under HKEY_CURRENT_USER instead of
HKEY_LOCAL_MACHINE under some circumstances:
 (1) if you are not a member of the Administrators group
 (2) if you choose Install for Just Me rather than
Install for All Users,
 (3) if you automate the Python install using msiexec.exe
/i python-2.4.1.msi /q. The /q (quiet) switch causes
different behavior than the defaults with a manual install
(msiexec.exe /i python-2.4.1.msi).

This is a mistake in the Python installer. The path to an
installed application always belongs under HKLM,
because the
path to installed software is a machine-specific
setting. If
the path is in HKCU, the InstallPath setting can follow a
user to a machine where Python is not installed.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1239120group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1239148 ] Win registry problem

2005-07-15 Thread SourceForge.net
Bugs item #1239148, was opened at 2005-07-15 17:01
Message generated for change (Settings changed) made by bsherwood
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1239148group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Installation
Group: Python 2.4
Status: Deleted
Resolution: Duplicate
Priority: 5
Submitted By: Bruce Sherwood (bsherwood)
Assigned to: Nobody/Anonymous (nobody)
Summary: Win registry problem

Initial Comment:
Debbie Carraway in IT at NCSU gives this analysis of an
apparent bug in the Python 2.4 installer for Windows.
She discovered this in the context of using the
installer for VPython, which looks for Python 2.4 in

  HKLM\Software\Python\PythonCore\2.4\InstallPath

which used to work with Python 2.3. Here is her report:

The problem is with the Python 2.4.1 installer. Python will
put the InstallPath registry setting (which indicates where
Python is installed)  under HKEY_CURRENT_USER instead of
HKEY_LOCAL_MACHINE under some circumstances:
 (1) if you are not a member of the Administrators group
 (2) if you choose Install for Just Me rather than
Install for All Users,
 (3) if you automate the Python install using msiexec.exe
/i python-2.4.1.msi /q. The /q (quiet) switch causes
different behavior than the defaults with a manual install
(msiexec.exe /i python-2.4.1.msi).

This is a mistake in the Python installer. The path to an
installed application always belongs under HKLM,
because the
path to installed software is a machine-specific
setting. If
the path is in HKCU, the InstallPath setting can follow a
user to a machine where Python is not installed.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1239148group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1239186 ] Install Error: cannot compute sizeof (int), 77

2005-07-15 Thread SourceForge.net
Bugs item #1239186, was opened at 2005-07-15 18:00
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1239186group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Installation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Bob Gazzale (rgazzale)
Assigned to: Nobody/Anonymous (nobody)
Summary: Install Error: cannot compute sizeof (int), 77

Initial Comment:
Computer: Mac
OS: Tiger 10.4.2

When attempting to install Python 2.4, I get the
following error 
message in the configure stage:

checking size of int... configure: error: cannot
compute sizeof (int), 
77

config.log is attached.

Many thanks,
Bob

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1239186group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com