Re: a Haskell a Day

2005-10-26 Thread usenet
Xah Lee wrote: > I hope you will join me in learning Haskell. I think the folks here are more interested in Perl. There's a reason why this newsgroup is called lc("comp.lang.PERL.misc"). -- http://mail.python.org/mailman/listinfo/python-list

Re: a Haskell a Day

2005-10-26 Thread usenet
Xah Lee wrote: > I hope you will join me in learning Haskell. I think the folks here are more interested in Perl. There's a reason why this newsgroup is called lc("comp.lang.PERL.misc"). -- http://mail.python.org/mailman/listinfo/python-list

Re: tool for syntax coloring in html

2005-10-26 Thread usenet
Xah Lee wrote: > Is there a tool that produce codes in html with syntax coloring? Sure. It's called "Cascading Style Sheets" (CSS), which is how these sites have done it (as you can see if you "view source"). See articles on SitePoint.com (and MANY others) for info. But this really has nothing to

net view /domain

2005-08-11 Thread usenet
Hi! Is there a module I can use for "net view /domain" so list all available domains and workgroups in a windows-network? I'm looking for something like win32net.NetServerEnum, because I don't really want to do this by "popen". Kind regards Dirk -- http://mail.python.org/mailman/listinfo/python

Re: net view /domain

2005-08-12 Thread usenet
Hi Tim! Thanks again for your help! I just tried it out and it does exactly what I want it to do :-) Have a nice day! Dirk -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-25 Thread usenet
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > > > the argument that usenet should never change seems a little > > heavy-handed and anachronistic. > > No, simple since there *are* alternatives: web based message boards. Those > alternatives *do*

Re: Jargons of Info Tech industry

2005-08-26 Thread usenet
In comp.lang.perl.misc Ulrich Hobelmann <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > >>> the argument that usenet should never change seems a little > >>> heavy-handed and an

Re: Jargons of Info Tech industry

2005-08-26 Thread usenet
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > >> > >> > the argument that usenet should never change seems a little > >> > he

Re: Usenet, HTML (was Re: Jargons of Info Tech industry)

2005-08-26 Thread usenet
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > > > > I'm talking about using the technology for communication, instead of > > reinventing the wheel with crappy web forums. > > What is exactly crappy about those forums? > They are slow They are inflexible They are slow They do

Re: Jargons of Info Tech industry

2005-08-26 Thread usenet
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > "NNTP and its applications" have evolved to provide a set of much more > > sophisticated means of accessing and giving information than any forum > > I've ever seen. > > Example(s). And do users need tho

Re: Jargons of Info Tech industry

2005-08-26 Thread usenet
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > > > They > > have no downsides I can possibly think of > > Some people never use them, and hence they use memory and add risks. > So they can choose a newsreader that doesn't have these facilities, no extra memory use, no risk. --

Re: Xah's Edu Corner: Unix damage: color names

2006-02-07 Thread usenet
Xah Lee wrote: > usually located in /lib/rgb.txt. on AIX and Linux (SuSE 9.3) the file is in /lib/X11/rgb.txt > neither a continuity in selected color values nor in color names (for > example, darkgray but lightgrey) On AIX and Linux (SuSE 9.3) each color name which contains "gray" is also alias

Re: John Bokma harassment

2006-05-24 Thread usenet
Xah Lee wrote: > I do not like to post off-topic messages Oh REALLY? That's strange, because I don't recall ever seeing an on-topic message (a Perl message in a Perl newsgroup) from Xah. Every one of the many Xah post I've ever seen (including the "Philosopher" message that this thread morphed i

Logging and threading

2006-03-31 Thread usenet
I'm having some problems getting the logging module to work with the threading module. I've narrowed the problem down to the following code: import logging, threading update_log = logging.getLogger('update_log') update_log.addHandler(logging.FileHandler("/tmp/update_log")) class dlThread(thread

Re: Logging and threading

2006-04-01 Thread usenet
As simple and as obvious as I expected, thanks Dennis. -Alex -- http://mail.python.org/mailman/listinfo/python-list

OT: google groups bug, or worse?

2005-01-07 Thread aaronwmail-usenet
I'm concerned that google groups is not correctly reflecting the python lists. A month ago I announced the xsdbXML framework to the python list and the python-announce list. As you can see from the links below the python announce submission was approved by the moderators (thanks!) and the python

Re: OT: google groups bug, or worse?

2005-01-08 Thread aaronwmail-usenet
Bengt Richter wrote: > What did you google with? Is this it? > http://groups-beta.google.com/groups?hl=en&ie=UTF-8&q=%22The+xsdbXML+framework+provides+a+flexible+and+well+defined+infrastructure%22&qt_s=Search+Groups That was my *reply* to one of the original posts using Google, which I faked up w

On benchmarks, heaps, priority queues

2005-01-26 Thread aaronwmail-usenet
I've been wondering about benchmarks recently. What is a fair benchmark? How should benchmarks be vetted or judged? I decided to see what you folks thought, so for discussion I compared two priority queue implementations I published for Python in 1995 against the "heap" priority queue implementa

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet
me> PQPython23 - the Lib implementation me> PQ0 - my insertion sort based variant me> PQueue - my "heap" based variant me> (like PQPython23, but different). Tim D: > First of all, you should be running these benchmarks using Python 2.4. > heapq is considerably faster there ... (Raymond Hettinger

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet
(re: http://xsdb.sourceforge.net/bench/pq3.py) nsz> ...bisect is not so fast for large data... Yes I know in theory the insertion sort approach should be bad for large enough values, but the weird thing is that if you mix inserts and deletes (with enough deletes) even 1M elements is not a large

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet
re http://xsdb.sourceforge.net/bench/pq3.py Tim Peters: > If you repair that, and > instrument mixBench() to keep track of queue size statistics, you'll > find that even at 100, the queue at the top of the loop never > exceeds 30 entries, and has a mean size less than 3. Aha. Now that is emb

type() takes one or *three* arguments!?

2005-01-30 Thread jamesthiele . usenet
I was looking at Simon Burton's Povray.py code (part of pypov) and saw this line: globals()[name] = type( name, (KWItem,), {} ) # nifty :) where 'KWItem' was a class. It did seem nifty, but it was unclear to me what was happening. I went to python.org's online documentation which said that type()

Re: type() takes one or *three* arguments!?

2005-01-30 Thread jamesthiele . usenet
Thank you - that explains everything quite nicely. -- http://mail.python.org/mailman/listinfo/python-list

print ending with comma

2005-07-19 Thread jamesthiele . usenet
I recently ran into the issue with 'print' were, as it says on the web page called "Python Gotchas" (http://www.ferg.org/projects/python_gotchas.html): The Python Language Reference Manual says, about the print statement, A "\n" character is written at the end, unless the print statement ends wit

loops -> list/generator comprehensions

2005-02-06 Thread jamesthiele . usenet
I wrote this little piece of code to get a list of relative paths of all files in or below the current directory (*NIX): walkList = [(x[0], x[2]) for x in os.walk(".")] filenames = [] for dir, files in walkList: filenames.extend(["/".join([dir, f]) for f in files]) It works f

Re: loops -> list/generator comprehensions

2005-02-06 Thread jamesthiele . usenet
> HTH, It does. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Mapping operator tokens to special methods

2005-02-24 Thread jamesthiele . usenet
I was starting to write a dictionary to map operator strings to their equivalent special methods such as: { '+' : 'add', '&' : 'and_' } The idea is to build a simple interactive calculator. and was wondering if there is already something like this builtin? Or is there a better way to do what

Re: Mapping operator tokens to special methods

2005-02-24 Thread jamesthiele . usenet
John Machin wrote: >>> eval('1+2') 3 -- Yeah, that's what I decided to do. -- http://mail.python.org/mailman/listinfo/python-list

ANN: xsdbXML python release with C#/.NET port

2005-03-01 Thread aaronwmail-usenet
ANN: xsdbXML release with C#/.NET port Part I: Announcement There is a new release of xsdbXML which provides bugfixes to the Python implementation and also provides a completely separate implementation in C#/.NET. The xsdb framework provides a flexible and well defined infras

Re: ANN: xsdbXML python release with C#/.NET port

2005-03-02 Thread aaronwmail-usenet
Yikes... A couple people pointed out that the upload had no csharp code. That was because sourceforge was uploading the wrong file (but reporting the right filesize). I think it's fixed now (uploaded from paris and minnesota). Sorry!!! --- Aaron Watters -- http://mail.python.org/mailman/l

Catching all methods before they execute

2005-03-07 Thread jamesthiele . usenet
I have run into some cases where I would like to run a class method anytime any class method is invoked. That is, if I write x.foo then it will be the same as writing x.bar x.foo for any method in class x (with the possible exception of 'bar'). The first few times I wanted to print out a data st

Re: Catching all methods before they execute

2005-03-07 Thread jamesthiele . usenet
>[EMAIL PROTECTED] wrote: >> I have run into some cases where I would like to run a class method >> anytime any class method is invoked. > >Perhaps you want __getattribute__ on a new-style class? >-- >Michael Hoffman Perhaps I do. The docs say that __getattribute__ is called on all attribute refer

ANN: xsdb does XML, SQL is dead as disco :)

2004-12-11 Thread aaronwmail-usenet
  The xsdbXML framework provides a flexible and well defined infrastructure to allow tabular data to be published, retrieved, and combined over the Internet. It's a little bit like the daughter of the Gadfly SQL engine in the buff, on steroids.  This is a major departure from the previous releases

RE: xsdb does XML, SQL is dead as disco :) (oops)

2004-12-14 Thread aaronwmail-usenet
Some people pointed out that bighunks of my HUGE ZIP file contained junk that could be regenerated. Thanks! It's now much smaller. Sorry for the screw up. -- Aaron Watters I wrote: > xsdb does XML, SQL is dead as disco :) > >The xsdbXML framework provides a >flexible and well defined infrastru

Re: mathmatical expressions evaluation

2004-12-22 Thread aaronwmail-usenet
> have a task of evaluating a complex series (sorta) of mathematical > expressions and getting an answer ... If we assume that you are looking for functionality and speed is secondary, please have a look at the technique in http://cvs.sourceforge.net/viewcvs.py/xsdb/xsdbXML/xsdbXMLpy/functions.p

Re: Text-to-speech

2005-03-20 Thread jamesthiele . usenet
On some flavors of Windows you can use: import pyTTS tts = pyTTS.Create() tts.Speak('This is the sound of my voice.') On Mac OS X you can use: import os os.system("say 'This is the sound of my voice.'") You could write a wrapper that takes a string and checks to see which OS you are on and exec

ANNOUNCE: xsdb release with N/A support and more

2005-04-01 Thread aaronwmail-usenet
The new xsdbXML_cs_java_py_01 release adds a "not applicable" attribute restriction and completes the same/ifknown/otherwise implementations as well as some bugfixes including a fix for a performance bug in the java implementation. The xsdb framework provides a flexible and well defined infrastruc

Using ssl module over custom sockets

2015-06-08 Thread jbauer . usenet
Hi group, is it possible to use the ssl module using a custom transport? It appears to me as if currently the relationship between ssl.SSLSocket() and socket.socket() is pretty entangled. Suppose I do have some kind of reliable transport (let's say RS232) and a connection that I have wrapped i

Re: Need a compelling argument to use Django instead of Rails

2006-07-24 Thread aaronwmail-usenet
Steve Holden wrote: ... > I wouldn't waste your time. "A man convinced against his will is of the > same opinion still", and they already know they aren't interested in > Python. There are probably many other matters about which they are > uninformed and equally determined This is too true. F

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread aaronwmail-usenet
Jaroslaw Zabiello wrote: > On Wed, 26 Jul 2006 16:25:48 +0200, Bruno Desthuilliers wrote: > > > I have difficulty imagining how a language could be more dynamic than > > Python... > > E.g. try to extends or redefine builtin Python classes on fly. Ruby is so > flexible that it can be used to create

Re: Need a compelling argument to use Django instead of Rails

2006-08-03 Thread aaronwmail-usenet
Paul Rubin wrote: > I didn't realize you could do shared hosting with mod_python, because > of the lack of security barriers between Python objects (i.e. someone > else's application could reach into yours). You really need a > separate interpreter per user. A typical shared hosting place might

Re: Need a compelling argument to use Django instead of Rails

2006-08-04 Thread aaronwmail-usenet
Ben Sizer wrote: > [EMAIL PROTECTED] wrote: > > Paul Rubin wrote: > > > A typical shared hosting place might > > > support 1000's of users with ONE apache/php instance (running in a > > > whole bunch of threads or processes, to be sure). > > > > You just need to run multiple apache > > instances, w

Re: Need a compelling argument to use Django instead of Rails

2006-08-07 Thread aaronwmail-usenet
Damjan wrote: > Yes, but your mod_python programs still run with the privileges of the > Apache process, as are all the other mod_python programs. This means that > my mod_python program can (at least) read files belonging to you - > including your config file holding your database password I

Re: Need a compelling argument to use Django instead of Rails

2006-08-18 Thread aaronwmail-usenet
Damjan wrote:> > Starting a new Apache process with python included (trough mod_python) is > even worse than CGI. Yes, but I think only for the first interaction after being dormant for a period. In fact I've noticed that hitting http://www.xfeedme.com the first time is usually slow. But once th

Re: sum fonction in gadfly

2006-06-29 Thread aaronwmail-usenet
Robert Hicks wrote: > I haven't been keeping up. Is Gadfly still in development? I always find this question a little irritating -- gadfly is perfect the way it is :). If it ain't broke don't fix it. At least until the python guys make another non-backwards-compatible change that makes a patch

Re: sum fonction in gadfly

2006-06-30 Thread aaronwmail-usenet
Robert Hicks wrote: > [EMAIL PROTECTED] wrote: > > why are people so concerned > > that it's not changing? > > > > I didn't mean to be irritating and I wasn't concerned about it not > changing but I could probably have stated the question a little better. > For some reason I thought it was a

Re: Gadfly server startup error

2006-10-02 Thread aaronwmail-usenet
> Is anybody out there who has used the server+client operation > mode successfully? Well, several years ago, yes. Since then the project was taken over by some volunteers and they did an excellent job of restructuring and modernizing (somewhat) the *standalone* part of gadfly, but apparently the

Re: Gadfly server startup error

2006-10-02 Thread aaronwmail-usenet
[EMAIL PROTECTED] wrote: > > Is anybody out there who has used the server+client operation > > mode successfully? > > Well, several years ago, yes. I looked into it and it was mainly a documentation and test issue, I think. The code seems to work. Please go http://gadfly.sourceforge.net/gadf

ANN: Skimpy Gimpy ASCII Web Challenge CAPTCHA

2006-12-18 Thread aaronwmail-usenet
Please check it out and try it: http://skimpygimpy.sourceforge.net/ Find examples, documentation, links to demos and download links there. Skimpy Gimpy is a tool for generating HTML representations for strings which people can read but which web robots and other computer programs will have di

ANN: Skimpy CAPTCHA adds WAVE audio, and a problem

2006-12-27 Thread aaronwmail-usenet
SKIMPY CAPTCHA ADDS AUDIO, AND A PROBLEM [or what I did over xmas weekend at the inlaws -- python/web/audio experts skip to the bottom and solve my problem please.] Skimpy Gimpy CAPTCHA now supports WAVE audio output to help people with visual impairments answer Skimpy challenges. Read more, try

AJAX example code available

2006-02-05 Thread aaronwmail-usenet
I've published sample code that uses Python on the server side to implement AJAX type ahead completion for web forms. Please see documentation with links to examples and downloads at http://xsdb.sourceforge.net/xFeed.html "Type ahead completion" is a form of AJAX (asyncronous javascript with XM

Re: Edit Audio Using Python?

2007-06-20 Thread aaronwmail-usenet
On Jun 20, 12:21 pm, Ultrus <[EMAIL PROTECTED]> wrote: > Ah! I found this on the official > website:http://www.python.org/doc/1.5.2p2/lib/module-audioop.html > > That should keep me occupied. If you think of anything interesting > however, I would be happy to know. :) I think you'll find that you

SkimpyGimpy PNG canvas w/ Javascript mouse tracking

2007-05-07 Thread aaronwmail-usenet
ANN: SkimpyGimpy PNG canvas has Javascript mouse tracking The SkimpyGimpy PNG image canvas now can generate Javascript data structures which allow HTML pages to intelligently respond to mouse events over the image. Please read about the SkimpyGimpy Canvas and look at the mouse tracking example he

Re: SkimpyGimpy PNG canvas w/ Javascript mouse tracking

2007-05-07 Thread aaronwmail-usenet
re: http://skimpygimpy.sourceforge.net On May 7, 7:29 pm, James Stroud <[EMAIL PROTECTED]> asks: > Can you advertise "CAPTCHA" as it is trademarked by Carnegie Mellon? > > James I can easily forward them a generous portion of my earnings from this project if needed :). Actually I think the term

Re: searching algorithm

2007-05-12 Thread aaronwmail-usenet
On May 10, 1:26 pm, Gigs_ <[EMAIL PROTECTED]> wrote: > Hi all! > > I have text file (english-croatian dictionary) with words in it in > alphabetical > order. > This file contains 17 words in this format: > english word: croatian word Let's assume it's okay to have all the data in memory. In m

ANN: PNG image CAPTCHA with PNG canvas available (SkimpyGimpy)

2007-04-18 Thread aaronwmail-usenet
Announcing SkimpyGimpy Support for PNG image CAPTCHA generation and PNG canvases. You can now use SkimpyGimpy to generate CAPTCHA text representations as PNG image files in addition to preformatted text ASCII art, and WAVE format audio streams, either from command lines or within Python programs.

Seattle Python Interest Group Thursday at 7:00 PM

2007-01-11 Thread jamesthiele . usenet
Seattle Python Interest Group Meeting Thursday, Jan 11th at 7:00 PM Bar underneath the Third Place Books in Ravenna. http://www.ravennathirdplace.com/ NE 65th St & 20th Ave NE -- http://mail.python.org/mailman/listinfo/python-list

Re: set partitioning

2006-05-01 Thread aaronwmail-usenet
Something like this, or am I missing something? def partition(List, n, m, k): if n!=m*k: raise "sorry, too many or too few elts" D = {} for x in List: D[x] = 1 if len(D)!=n: raise "sorry (2) you lied about the number" List2 = D.keys() resul

OT: CAD

2006-05-03 Thread Usenet Loser
I am completely empty and shallow. I use no CAD package at all now. I would like to buy one for recreational use, instead of watching American Idol. What CAD package has integrated FEA and rigid body calculations so that I could design a bar stool, and easily determine: a) if it is top-heavy, so

Re: Python's DSLs (was: A critic of Guido's blog on Python's lambda)

2006-05-10 Thread aaronwmail-usenet
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: ... . > >Of course, the choice of Python does mean that, when we really truly > >need a "domain specific little language", we have to implement it as a > >language in its own right,

tracking collection modification

2008-09-07 Thread usenet . tolomea
I'm working on a remote object system, something kinda like Pyro. For the purposes of caching I need to be able to tell if a given dict / list / set has been modified. Ideally what I'd like is for them to have a modification count variable that increments every time the particular collection is mod

Re: tracking collection modification

2008-09-08 Thread usenet . tolomea
On Sep 7, 8:54 pm, [EMAIL PROTECTED] wrote: > I'm working on a remote object system, something kinda like Pyro. > For the purposes of caching I need to be able to tell if a given > dict / list / set has been modified. > Ideally what I'd like is for them to have a modification count > variable that

recycling internationalized garbage

2006-03-08 Thread aaronwmail-usenet
Hi folks, Please help me with international string issues: I put together an AJAX discography search engine http://www.xfeedme.com/discs/discography.html using data from the FreeDB music database http://www.freedb.org/ Unfortunately FreeDB has a lot of junk in it, including randomly mixed char

Re: recycling internationalized garbage

2006-03-14 Thread aaronwmail-usenet
Regarding cleaning of mixed string encodings in the discography search engine http://www.xfeedme.com/discs/discography.html Following 's suggestion I came up with this: utf8enc = codecs.getencoder("utf8") utf8dec = codecs.getdecoder("utf8") iso88591dec = codecs.getdecoder("iso-8859-1") def chec

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-14 Thread aaronwmail-usenet
I agree that more progress is needed on the Python documentation front. For example if you look at the "codecs" module documentation there is no hint of what a codec is anywhere that I can see. Also the distinction between an "encoder" and a "decoder" is not explained. Even though I've used it man

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-14 Thread aaronwmail-usenet
hmmm. Interesting about the wiki. It's unusable in my version of IE. Javascript error on almost every keystroke :(! http://wiki.python.org/moin/ It works in Firefox, which I have, of course, but still... And the patch procedure you described requires a higher degree of motivation (and free tim

Re: Using Classes

2010-06-24 Thread Alf P. Steinbach /Usenet
* Mag Gam, on 24.06.2010 13:58: I have been using python for about 1 year now and I really like the language. Obviously there was a learning curve but I have a programing background which made it an easy transition. I picked up some good habits such as automatic code indenting :-), and making my

Re: Decorators, with optional arguments

2010-07-02 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 02.07.2010 19:41: Okay, so! I actually never quite got around to learning to do deep and useful magic with decorators. I've only ever done the most basic things with them. Its all been a little fuzzy in my head: things like what order decorators end up being called in if the

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 03.07.2010 16:24: On Sat, 03 Jul 2010 08:46:57 -0400, D'Arcy J.M. Cain wrote: On Fri, 02 Jul 2010 22:40:34 -0700 John Nagle wrote: Not according to Vex's published package list: http://www.vex.net/info/tech/pkglist/ Hold on. That *is* the generated list

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-06 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 06.07.2010 17:50: Just a little reminder: Microsoft has withdrawn VS2008 in favor of VS2010. The express version is also unavailable for download.>:(( We can still get a VC++ 2008 compiler required to build extensions for the official Python 2.6 and 2.7 binary installers her

Argh! Name collision!

2010-07-06 Thread Alf P. Steinbach /Usenet
Donald Knuth once remarked (I think it was him) that what matters for a program is the name, and that he'd come up with a really good name, now all he'd had to do was figure out what it should be all about. And so considering Sturla Molden's recent posting about unavailability of MSVC 9.0 (aka

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-06 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 06.07.2010 19:35: On 6 Jul, 19:09, Thomas Jollans wrote: Okay, you need to be careful with FILE*s. But malloc and free? You'd normally only alloc& free something within the same module, using the same functions (ie not mixing PyMem_Malloc and malloc), would you not? You h

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 07.07.2010 21:10: Python 3.1.1, file [pymem.h]: PyAPI_FUNC(void *) PyMem_Malloc(size_t); #define PyMem_MALLOC(n)(((n)< 0 || (n)> PY_SSIZE_T_MAX) ? NULL \ : malloc((n) ? (n) : 1)) The problem with the latter that it seems that it's intended for

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 07.07.2010 21:12: On 7 Jul, 06:54, "Alf P. Steinbach /Usenet" wrote: PyAPI_FUNC(void *) PyMem_Malloc(size_t); #define PyMem_MALLOC(n) (((n)< 0 || (n)> PY_SSIZE_T_MAX) ? NULL \ : malloc((n) ? (n) : 1)) I wa

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 07.07.2010 21:46: On 7 Jul, 21:41, "Alf P. Steinbach /Usenet" wrote: You still have two CRTs linked into the same process. So? CRT resources cannot be shared across CRT borders. That is the problem. Multiple CRTs are not a problem if CRT resources are ne

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 07.07.2010 21:56: Perhaps (if it isn't intentional) this is a bug of the oversight type, that nobody remembered to update the macro? Update in what way? I was guessing that at one time there was no PyMem_Malloc. And that it was introduced to fix Windows-specific problem

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Christian Heimes, on 07.07.2010 22:47: The main problem that the required MSVC redistributables are not necessarily present on the end user's system. It's not a problem for Python anymore. It took a while to sort all problems out. Martin and other developers have successfully figured out how

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Alf P. Steinbach /Usenet, on 07.07.2010 23:19: However developing an extension with MSVC 10 the extension will use the 10.0 CRT, which is not necessarily present on the end user's system. As I see it there are five solutions with different trade-offs: A Already having Visual Studio

Re: Argh! Name collision!

2010-07-07 Thread Alf P. Steinbach /Usenet
* rantingrick, on 07.07.2010 07:42: On Jul 6, 9:11 pm, "Alf P. Steinbach /Usenet" wrote: "pyni"! Pronounced like "tiny"! Yay! hmm, how's about an alternate spelling... "pyknee", or "pynee", or "pynie" ... considering those

Re: Argh! Name collision!

2010-07-07 Thread Alf P. Steinbach /Usenet
* Alf P. Steinbach /Usenet, on 08.07.2010 01:47: enum DoAddRef { doAddRef }; class Ptr { private: PyObject* p_; public: Ptr( PyObject* p = 0 ): p_( p ) {} Ptr( PyObject* p, DoAddRef ): p_( p ) { assert( p

How do I add method dynamically to module using C API?

2010-07-07 Thread Alf P. Steinbach /Usenet
The code below, very much work in progress, just trying things, is C++. Sorry about the formatting, I had to reformat manually for this posting: class Module { private: Ptr p_; public: Module( PyModuleDef const& def ) : p_( ::PyModule_Create( co

Re: How do I add method dynamically to module using C API?

2010-07-07 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 08.07.2010 07:23: And since things work for a single method when I declare 'def' as 'static', I suspect that means that the function object created by PyCFunction_NewEx holds on to a pointer to the PyMethodDef structure? Correct; it doesn't make a copy of the struct. So w

Re: How do I add method dynamically to module using C API?

2010-07-08 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 08.07.2010 09:13: I tried (1) adding a __del__, but no dice, I guess because it wasn't really an object method but just a free function in a module; and (2) the m_free callback in the module definition structure, but it was not called. m_free will be called if the module

Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-09 Thread Alf P. Steinbach /Usenet
[Cross-posted comp.lang.python and comp.lang.c++] I lack experience with shared libraries in *nix and so I need to ask... This is about "cppy", some support for writing Python extensions in C++ that I just started on (some days ago almost known as "pynis" (not funny after all)). For an extens

Re: Hello

2010-07-09 Thread Alf P. Steinbach /Usenet
* Dani Valverde, on 09.07.2010 18:31: Hello! I am new to python and pretty new to programming (I have some expertise wit R statistical programming language). I am just starting, so my questions may be a little bit stupid. Can anyone suggest a good editor for python? Cheers! If you're working in

Re: Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-09 Thread Alf P. Steinbach /Usenet
* Ian Collins, on 09.07.2010 23:22: On 07/10/10 03:52 AM, Alf P. Steinbach /Usenet wrote: [Cross-posted comp.lang.python and comp.lang.c++] I lack experience with shared libraries in *nix and so I need to ask... This is about "cppy", some support for writing Python extensions in

Not-quite-the-module-name qualified names in extension modules? What?

2010-07-10 Thread Alf P. Steinbach /Usenet
Hi. I built the [xxmodule.c] from the source distribution, as suggested by the Python 3.1.1 docs. I named this [xx.pyd], as I believed the module name was just "xx". Indeed importing xx works fine, but when I do help(xx) I get ... >>> help( xx ) Help on module xx: NAME

Re: any issues with long running python apps?

2010-07-10 Thread Alf P. Steinbach /Usenet
* John Nagle, on 10.07.2010 20:54: On 7/9/2010 12:13 PM, Les Schaffer wrote: i have been asked to guarantee that a proposed Python application will run continuously under MS Windows for two months time. And i am looking to know what i don't know. The app would read instrument data from a serial

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-11 Thread Alf P. Steinbach /Usenet
* rantingrick, on 11.07.2010 08:50: On Jul 11, 1:22 am, Stephen Hansen wrote: Utter nonsense. No one does that unless they are coming from C or some other language without a True/False and don't know about it, or if they are using a codebase which is supporting a very old version of Python bef

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-11 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 11.07.2010 09:19: On 7/10/10 11:50 PM, rantingrick wrote: It was a typo not an on purpose misspelling If this had been the first time, perhaps. If you had not in *numerous* previous times spelled my name correctly, perhaps. If it were at all possible for "f" to be a typo

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Alf P. Steinbach /Usenet
* rantingrick, on 11.07.2010 09:26: Another source of asininity seems to be the naming conventions of the Python language proper! True/False start with an upper case and i applaud this. However str, list, tuple, int, float --need i go on...?-- start with lowercase. Q: Well what the hell is your

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the bytecode compiler optimize away expressions like: if is_my_extra_debugging_on: print ... when "is_my_extra_debugging" is set t

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* MRAB, on 12.07.2010 00:37: Alf P. Steinbach /Usenet wrote: * Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the bytecode compiler optimize away expressions like: if

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 12.07.2010 04:02: On 7/11/10 6:12 PM, Alf P. Steinbach /Usenet wrote: However, as stated up-thread, I do not expect facts, logic or general reasoning to have any effect whatsoever on such hard-core religious beliefs. Grow up, and/or get a grip, and/or get over yourself

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* MRAB, on 12.07.2010 04:09: Alf P. Steinbach /Usenet wrote: * MRAB, on 12.07.2010 00:37: Alf P. Steinbach /Usenet wrote: * Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 12.07.2010 06:52: On 11 Jul, 21:37, "Alf P. Steinbach /Usenet" wrote: Oh, I wouldn't give that advice. It's meaningless mumbo-jumbo. Python works like Java in this respect, that's all; neither Java nor Python support 'swap'. x,y = y,

Design questions for C++ support for Python extensions (cppy)

2010-07-12 Thread Alf P. Steinbach /Usenet
Hi. With the current cppy code the Python 3.1.1 doc's spam example extension module looks like this (actual working code): #include #include using namespace progrock; namespace { class Spam: public cppy::Module { public: Spam(): cppy::M

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 12.07.2010 16:59: On 12 Jul, 07:51, "Alf P. Steinbach /Usenet" wrote: We're talking about defining a 'swap' routine that works on variables. I did not miss the point. One cannot make a swap function that rebinds its arguments in the callin

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 12.07.2010 04:39: On Mon, 12 Jul 2010 03:12:10 +0200, Alf P. Steinbach /Usenet wrote: * MRAB, on 12.07.2010 00:37: [...] In Java a variable is declared and exists even before the first assignment to it. In Python a 'variable' isn't declared and w

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Rhodri James, on 12.07.2010 22:19: On Mon, 12 Jul 2010 13:56:38 +0100, bart.c wrote: "Steven D'Aprano" wrote in message news:4c3aedd5$0$28647$c3e8...@news.astraweb.com... On Mon, 12 Jul 2010 09:48:04 +0100, bart.c wrote: That's interesting. So in Python, you can't tell what local variabl

  1   2   >