Re: python tutorial on a single html page?

2007-11-07 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, BartlebyScrivener <[EMAIL PROTECTED]> wrote: > Is the main Python tutorial posted on single searchable page > somewhere? As opposed to browsing the index and clicking NEXT etc. For completeness (though a bit late), I'll mention that Google can search a group of

Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-04 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Kaz Kylheku <[EMAIL PROTECTED]> wrote: > On May 2, 5:19 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > > On May 3, 2:15 am, Kaz Kylheku <[EMAIL PROTECTED]> wrote: > > > > > Kindly refrain from creating any more off-topic, cross-posted threads. > > > Thanks. > > > >

Re: newbie needs help building Python 2.5 for Fedora Core 6

2007-02-24 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "bobmon" <[EMAIL PROTECTED]> wrote: > Hello, and please be gentle... > > I'm trying to build Python 2.5 on my Fedora Core 6 installation. I > think I've resolved most of my problems, but "make test" reports an > error for test_socket.py, shown below. > > I suppo

Re: Possible to set cpython heap size?

2007-02-23 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Andy Watson" <[EMAIL PROTECTED]> wrote: ... > If I could have a heap that is larger and does not need to be > dynamically extended, then the Python GC could work more efficiently. ... GC! If you're allocating lots of objects and holding on to them, GC will ru

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Michael Hobbs wrote: > > > That is, assume that the expression ends at the colon, not at the > > newline. That would make this type of statement possible: > > if color == red or > > color == blue or > >

Re: E' possibile integrare ironpython con visual studio 2005?

2006-08-05 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > LaGuna <[EMAIL PROTECTED]> wrote: > > > Se si come? > > > > Ciao by Enzo > > Questo newsgroup preferisce l'inglese -- per favore, chiedi su > it.comp.lang.python invece che qui. > > This newsgroup prefers English -- pl

Re: What is the best way to print the usage string ?

2006-08-05 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Simon Forman" <[EMAIL PROTECTED]> wrote: ... > Python also concatenates adjacent strings, but the "real" newlines > between your strings will need to be escaped (otherwise, because the > newlines are statement separators, you will have one print statement > follow

Re: Trace KeyboardInterrupt exception?

2006-06-15 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > if you want to interrupt the code to find out where it is, > you can instead connect to it in gdb and get the python traceback of > each thread. > if you're interested I'll post the necesary gdb-macro for that (didn'

socket and Ctl-C workaround?

2006-06-15 Thread Tony Nelson
I've been trying to figure out why Ctl-C sometimes doesn't interrupt yum. It appears to be unresolved Python bug 926423, unresolved proposed patch 1102879, don't know if anything ever came of it. Note that I cannot ask all yum users to apply the patch. I'm not sure I should be getting rid of

Re: Trace KeyboardInterrupt exception?

2006-06-14 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Tony Nelson wrote: > > I'm trying to find out what is eating some KeyboardInterrupt exceptions > > in a fairly large program (yum). My KeyboardInterrupt handler is called > > for some Ctl-C presses,

Trace KeyboardInterrupt exception?

2006-06-13 Thread Tony Nelson
I'm trying to find out what is eating some KeyboardInterrupt exceptions in a fairly large program (yum). My KeyboardInterrupt handler is called for some Ctl-C presses, but for others nothing seems to happen. Grepping the source (what of it I've found, looking at import statements) doesn't tur

Re: time.sleep(1) sometimes runs for 200 seconds under windows

2006-02-26 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Claudio Grondi <[EMAIL PROTECTED]> wrote: > Claudio Grondi wrote: > > Claudio Grondi wrote: > > > >> Paul Probert wrote: > >> > >>> Peter Hansen wrote: > >>> > Are you saying that you believe the time.sleep(1) call is actually > blocking for 200 seconds

Re: PEP 353: Using ssize_t as the index type

2006-02-12 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: ... > Discussion > == > > Why not size_t > -- > > An initial attempt to implement this feature tried to use > size_t. It quickly turned out that this cannot work: Python > uses negative indices in m

Re: super(...).__init__() vs Base.__init__(self)

2006-02-09 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Jan Niklas Fingerle <[EMAIL PROTECTED]> wrote: > ...Super is a good tool to use, when dealing with > diamond shape inheritance. In any other case I would use the direct > calls to the base classes. In fact, i've yet to find a non-textbook-case > where I really need

Re: Wingide is a beautiful application

2006-01-05 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > My goal is to make my conf files into a decent drop-in so you just pu

Re: Wingide is a beautiful application

2005-12-22 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > So, you bind check_current_block() to the Enter key? > > Yeah. The binding's not quite just "check_current_block()" > because you nee

Re: Wingide is a beautiful application

2005-12-21 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > OK, I can tell that this is Python code, not VI script stuff. I'll need > > to see how your vimrc sets this up. > > vim has a Python interp

Re: Wingide is a beautiful application

2005-12-21 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > > 1. Python syntax checking: as I'm typing along, if I input a syntax > > > error then the line is immediately highlighted in red. > > >

Re: Wingide is a beautiful application

2005-12-19 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: ... > I get the feeling that a ot of people working with heavy IDEs don't > realize how capable vim/emacs are, so I'll give a brief rundown of what > my Vim environment does for me. (I do Python web development)--if y

Re: OO in Python? ^^

2005-12-10 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Matthias Kaeppler <[EMAIL PROTECTED]> wrote: ... > obj = Base() # I want a base class reference which is polymorphic obj now refers to an instance of Base. > if (): > obj = D1() obj now refers to an instance of D1(). The Base instance is unreferenced. >

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Dave Hansen <[EMAIL PROTECTED]> wrote: > On 2 Dec 2005 10:08:21 -0800 in comp.lang.python, [EMAIL PROTECTED] > wrote: > > >Here it is again... Python bypassed/discounted because, of all things, > >scoping by indentation!?!? > > > >This used to surprise me. Until

How to keep Pydoc from listing too much?

2005-12-02 Thread Tony Nelson
How can I tell Pydoc not to list information for some of the base classes? For example, when a class inherits from gtk.Widget, lots of GTK stuff gets added that doesn't really need to be there. Is there some option to Pydoc to tell it to skip some classes? Is there something I can put in my

Pydoc: restrict base class doc?

2005-11-30 Thread Tony Nelson
I'd like to prevent Pydoc from adding base class documentation for some of my classes. Specifically, I have a couple of classes that derive from GTK widgets, and dumping all that documentation in doesn't have much benefit. Is there some thing I can do in my source, or to Pydoc, to tell it to

Re: wxPython : getting started

2005-11-29 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, David Sulc <[EMAIL PROTECTED]> wrote: > Hi ! > > I've looked all over (internet, books, etc.) and I haven't found a very > good ressource to get started with wxPython (yes, I've been through > their tutorial). > > What I would basically like to do for starters

Re: unicode speed

2005-11-29 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, David Siroky <[EMAIL PROTECTED]> wrote: > Hi! > > I need to enlighten myself in Python unicode speed and implementation. > > My platform is AMD [EMAIL PROTECTED] (x86-32), Debian, Python 2.4. > > First a simple example (and time results): > > x = "a"*5000 >

Re: ncurses' Dark Devilry

2005-11-29 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Jeremy Moles <[EMAIL PROTECTED]> wrote: > I'm working on a project using ncurses w/ Python. As an aside, I > implemented addchstr in the cursesmodule.c file in Python SVN, if anyone > wants me to try and get that made permanent. > > AT ANY RATE... > > I was wonde

Re: Mixed types and variants

2005-11-23 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: ... > - Maybe someone here can suggest some other variant type, or some other > solution. Pyrex? Pyrex is mostly like Python with the possibility of C types. It handles mixed types just like Python, and the C code it produces is sort

Re: Using gettext to provide different language-version of a script

2005-11-22 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Thomas W" <[EMAIL PROTECTED]> wrote: > I'm trying to wrap my head around the docs at python.org related to the > gettext-module, but I'm having some problem getting it to work. Is > there any really simple, step-by-step on how to use this module > available? > >

Re: os.path.expanduser('~/foo') and MSWindows "My Documents"

2005-11-18 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > python > > >>> import os > >>> help(os.path.expanduser) > >>> import platform > >>> platform.system() > 'Windows' > >>> platform.release() > 'XP' > >>> platform looks good. ___

Re: os.path.expanduser('~/foo') and MSWindows "My Documents"

2005-11-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Try this: > > > from win32com.shell import shell, shellcon > HOMEDIR = shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_PERSONAL) > myfile_location = os.path.join(HOMEDIR, myfile_name) > > Define a HOMEDIR for your various platforms (use

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Sam Pointon" <[EMAIL PROTECTED]> wrote: > > print "a string which is very loo" \ > > + "ong." > > Minor pedantry, but the plus sign is redundant. Python automatically > concatenates string literals on the same logical line separated by only > whitespa

os.path.expanduser('~/foo') and MSWindows "My Documents"

2005-11-17 Thread Tony Nelson
On *nix, ~/foo refers to a file in a user's home directory. On MSWindows, users normally look at "My Documents" in their home directory. ISTM that a file that my program would put in ~/. on Linux should be put in "~/My Documents/" (modulo os.path.normpath()) on MSWindows, where a user would e

Re: Python Library Reference - question

2005-11-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > The "Python LIbrary Reference" at > http://docs.python.org/lib/contents.html seems to be an important > document. I have two questions > > Q1. How do you search inside "Python LibraryReference" ? Does it exist > in pdf or chm form? ...

Re: modifying small chunks from long string

2005-11-14 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "MackS" <[EMAIL PROTECTED]> wrote: > Hello everyone > > I am faced with the following problem. For the first time I've asked > myself "might this actually be easier to code in C rather than in > python?", and I am not looking at device drivers. : ) > > This progr

Re: Validate string as UTF-8?

2005-11-06 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > > I'd like to have a fast way to validate large amounts of string data as > > being UTF-8. > > define "validate". All data confor

Re: Validate string as UTF-8?

2005-11-06 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, david mugnai <[EMAIL PROTECTED]> wrote: > On Sun, 06 Nov 2005 18:58:50 +0000, Tony Nelson wrote: > > [snip] > > > Is there a general way to call GLib functions? > > ctypes? > http://starship.python.net/crew/theller/cty

Validate string as UTF-8?

2005-11-06 Thread Tony Nelson
I'd like to have a fast way to validate large amounts of string data as being UTF-8. I don't see a fast way to do it in Python, though: unicode(s,'utf-8').encode('utf-8) seems to notice at least some of the time (the unicode() part works but the encode() part bombs). I don't consider a RE

Re: ? MDI depreciated

2005-11-06 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "LenS" <[EMAIL PROTECTED]> wrote: > Hate to ask this dum question (since I've been hiding under a rock). > But if the MDI UI model is/was depreciated. What is the new UI model. > > Would love some links that explain in gerneral and specific terms. In article <[E

Re: when and how do you use Self?

2005-11-04 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Tieche Bruce A MSgt USMTM/AFD" <[EMAIL PROTECTED]> wrote: > I am new to python, > Could someone explain (in English) how and when to use self? > I have been reading, and haven't found a good example/explanation is a good explanati

Re: NTFS reparse points

2005-11-03 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Stanislaw Findeisen <[EMAIL PROTECTED]> wrote: ... > However I can't see FILE_ATTRIBUTE_REPARSE_POINT turned on in any file / > directory shortcuts I create. In fact the only attribute set in > shortcuts created using Windows Explorer is FILE_ATTRIBUTE_ARCHIVE. (

Re: Scanning a file

2005-10-30 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Steve Holden wrote: > > Indeed, but reading one byte at a time is about the slowest way to > > process a file, in Python or any other language, because it fails to > > amortize the overhead cost of function calls over many characters. > >

Re: Any Pythonic GTK Undo library?

2005-10-29 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Dave Cook <[EMAIL PROTECTED]> wrote: > On 2005-10-29, Tony Nelson <[EMAIL PROTECTED]> wrote: > > > I'm looking for a "pythonic" GTK Undo library/class. It would have a > > You might ask the authors of Kiwi if

Any Pythonic GTK Undo library?

2005-10-29 Thread Tony Nelson
I'm looking for a "pythonic" GTK Undo library/class. It would have a framework for Undo/Redo, and would provide Undo/Redo for TextView, Entry, and containers and other classes. In a "batteries included" fashion, just instantiating a "UndoableTextView" or "UndoableEntry" or "UndoableContainer"

Re: How best to reference parameters.

2005-10-25 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "David Poundall" <[EMAIL PROTECTED]> wrote: > I am writing a scada package that has a significant amount of user > defined parameters stored in text files that I wish to cleanly access > in code. By way of an example, a few lines from the configuration file > woul

Re: Stripping ASCII codes when parsing

2005-10-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, David Pratt <[EMAIL PROTECTED]> wrote: > This is very nice :-) Thank you Tony. I think this will be the way to > go. My concern ATM is where it will be best to unicode. The data after > this will go into dict and a few processes and into database. Because

Mutual module imports

2005-10-17 Thread Tony Nelson
How does one normally make a Python extension module that has some parts in Python and some functions in C share globals between the Python and C functions? Will that approach work with Pyrex? I have written a Python module that uses some C functions. I wrote the module in two parts, one Pyth

Re: Stripping ASCII codes when parsing

2005-10-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, David Pratt <[EMAIL PROTECTED]> wrote: > I am working with a text format that advises to strip any ascii control > characters (0 - 30) as part of parsing data and also the ascii pipe > character (124) from the data. I think many of these characters are > from a

Re: How do you draw this layout with wxpython?

2005-10-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Young H. Rhiu" <[EMAIL PROTECTED]> wrote: > See: http://hilug.org/img/app_layout.GIF > > I'm implementing an album-like application with wxpython but I'm new to > wxPython though I know how to program with python. The problem is that > it's not easy for me to dea

[ANN] Speed up Charmap codecs with fastcharmap module

2005-10-16 Thread Tony Nelson
Fastcharmap is a python extension module that speeds up Charmap codecs by about 5 times. Usage: import fastcharmap fastcharmap.hook('codec_name') Fastcharmap will then speed up calls that use that codec, such as unicode(str, 'codec_name') an

Re: Can module access global from __main__?

2005-10-14 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Neal Norwitz" <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > > Neal Becker wrote: > > > > > > Still curious about the answer. If I know that I am imported from > > > __main__, > > > then I can do access X as sys.modules[__main__].X. In general, I don't > >

Re: how to make this code faster

2005-10-14 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > def f(x,y): > return math.sin(x*y) + 8 * x > I have code like this: > > def main(): > n = 2000 > a = zeros((n,n), Float) > xcoor = arange(0,1,1/float(n)) > ycoor = arange(0,1,1/float(n)) > > >

Re: C Wrapper Function, crashing Python?

2005-10-14 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Java and Swing" <[EMAIL PROTECTED]> wrote: > one more update... > > if I remove PyMem_Free and free(...) ...so no memory clean up...I can > still only call doStuff 4 times, the 5th attemp crashes Python. > > Java and Swing wrote: > > update: > > if I use C's fre

Re: Controlling who can run an executable

2005-10-04 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Cigar" <[EMAIL PROTECTED]> wrote: > I am developing a program for a client. She runs a shop where her > clients bring in items for sale or short term buyback. Development of > the program has been going great but she's mentioned that there is a > 'feature' comin

Re: Exception raising, and performance implications.

2005-10-03 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "leo" <[EMAIL PROTECTED]> wrote: > Hello all - > > I was wondering about the performance implications of explicitly > raising exceptions to get information about the current frame. > Something like what the inspect module does, with: Python uses exceptions intern

Re: Unicode charmap decoders slow

2005-10-03 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > I had seen iconv. Even if my system supports it and it is faster than > > Python's charmap decoder, it might not be available on other systems. >

Re: Unicode charmap decoders slow

2005-10-03 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > Is there a faster way to decode from charmaps to utf-8 than unicode()? > > You could try the iconv codec, if your system supports iconv: > > http://c

gtk.TextView.move_mark_onscreen() broken?

2005-10-02 Thread Tony Nelson
Is gtk.TextView.move_mark_onscreen() broken? Perhaps only in Python's gtk module, in Python 2.3, gtk 2.4.14? I'm asking here because I'm using gtk from Python and don't want to write a C program to verify my issue. I've also tried gtk.TextView.scroll_to_mark() and gtk.TextView.place_cursor_o

Unicode charmap decoders slow

2005-10-02 Thread Tony Nelson
Is there a faster way to decode from charmaps to utf-8 than unicode()? I'm writing a small card-file program. As a test, I use a 53 MB MBox file, in mac-roman encoding. My program reads and parses the file into messages in about 3..5 seconds, but takes about 13.5 seconds to iterate over the c