wxpython problems using GLCanvas

2006-10-08 Thread nelson
ersections... thanks, nelson -- http://mail.python.org/mailman/listinfo/python-list

3D Vector Type Line-Drawing Program

2006-10-11 Thread nelson -
shaded > shapes? And with or without hidden line removal? > i'm goind the same. I looked to vpython, but i can't make it go with wxpython. So i make a slightly different question. There is a library that fits well with wxpython that have features similar to vpython? thanks,

3d programming without opengl

2006-10-30 Thread nelson -
x27;t find nothing interesting... (the best would be a pure python solution) Thanks, nelson -- http://mail.python.org/mailman/listinfo/python-list

Re: 3d programming without opengl

2006-10-31 Thread nelson -
Hi paul, i look at slut and it seem very good... Can i embed it into a wxpython application? thanks, nelson -- http://mail.python.org/mailman/listinfo/python-list

ANN: pyfuzzylib 0.1.3 Released

2006-09-16 Thread nelson -
/pyfuzzylib good afternoon, nelson -- http://mail.python.org/mailman/listinfo/python-list

Window, Windows, Linux, client and server...

2006-12-07 Thread nelson -
picture of the desktop client. Is it a thing that i can do in python? any advice? I googled but i can't find something too useful... II know i can use vnc, but i want a pure python solution... if it's possibile... Doing it using VNC it seems not so "clear"... :) thanks, nel

FloatCanvas in a wxpython application.... layout problems

2007-02-21 Thread nelson -
e floatcanvas in the right position... it is'n displaied... can annyone give me an example of use of floatcanvas in an application with more than one panel... thanks a lot! nelson -- http://mail.python.org/mailman/listinfo/python-list

Integrating python with smalltalk

2006-03-23 Thread nelson
g if there is a standard mechanism to do it. On windows i know i can create in python a COM server and call it from smalltalk, but i wonder if there is a more general solution (platform independent). thanks for any advice, nelson -- http://mail.python.org/mailman/listinfo/python-list

COM Server & wxPython

2006-04-01 Thread nelson
it's true, from which? wx.App, wx.Frame, wx.Panel. The important thing is that i would to have the same effect that you have when you the calendar OLE control on a Delphi or VB form (you see the graphics ;) ) thanks, nelson -- http://mail.python.org/mailman/listinfo/python-list

strange TypeError exception in function compiled from a string

2010-12-01 Thread nelson
Hi all, I have this function, defined in a string and ecetuted through ad exec call def cell1(d): x=d.get('x') print x import y return y.add(y.add(self.adf0(x),self.adf0(x)),self.adf0(x)) d is a dict of this kind {'x':2} I receive the following exception, that i find very st

Remote audio recording in a multiuser environment

2009-07-14 Thread nelson -
le solution? I will surely use wxpython for the UI on the client and on the server. Thank for any advice, nelson -- Consulenze Linux e Windows http://nelsonenterprise.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Python presentations

2012-09-18 Thread Trent Nelson
On Thu, Sep 13, 2012 at 09:00:19AM -0700, andrea crotti wrote: > I have to give a couple of Python presentations in the next weeks, and > I'm still thinking what is the best approach. > > In one presentation for example I will present decorators and context > managers, and my biggest doubt is how

Re: Are ABCs an anti-pattern?

2012-10-05 Thread Trent Nelson
On Tue, Oct 02, 2012 at 07:23:05AM -0700, Demian Brecht wrote: > I don't use them anymore, but I'm curious about others opinions on this > list... I like them. In particular, I like that I can enumerate all the subclasses that happen to implement the ABC via the metaclass's __subclas

AI Example Help

2012-10-11 Thread Trevor Nelson
Hello all, For the first time in well... a very long time I am coming to a loss on where to really get started here on the project I wish to undertake to help me really get into Python programming. A quick explanation of how I learn. I learn best with example working small code bits. With the

Re: AI Example Help

2012-10-11 Thread Trevor Nelson
> > An interesting concept. AI monitoring systems have never really > > appealed to me; I personally prefer something with simpler and clearer > > rules (eg "if server load exceeds 3.0, raise an alert"), coupled with > > information retrieval commands that read like commands, not natural > >

Re: Questions about GIL and web services from a n00b

2011-04-19 Thread Lamont Nelson
> 1. Are you sure you want to use python because threading is not good due > to the Global Lock (GIL)?  Is this really an issue for multi-threaded > web services as seems to be indicated by the articles from a Google > search?  If not, how do you avoid this issue in a multi-threaded process > to t

RE: Coolest Python recipe of all time

2011-05-09 Thread Trent Nelson
> What are your favorites? I think I've posted this before, but I love my 3-lines-if-you-ignore-the-scaffolding language translator. Not because it's clever code -- quite the opposite, the code is dead simple -- but because it encompasses one of the things I love about Python the most: it gets

Re: Ann: New Python curses book

2021-04-11 Thread Daniel Nelson
On Tue, Mar 30, 2021 at 12:12:19PM +0100, Alan Gauld via Python-list wrote: > I've just published, in Kindle and paperback formats, > my book on "Programming curses with Python". > > https://www.amazon.co.uk/dp/B091B85B77/ > > (It should be available in most other Amazon stores too) This looks h

stat_result.st_ino from os.stat isn't constant on a network drive.

2020-08-26 Thread Andrew Nelson
OS: windows 7 Python: 3.8 I am trying to track which files have been modified in a directory on a network mount. When I call the os.stat function for a given file in that directory the stat_result.st_ino changes every time I call it: ``` >>> os.stat('U:\data\current\myfile') os.stat_result(st_mod

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

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

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

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

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

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

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

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

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

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

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

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: 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: 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? ...

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

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

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

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

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

Re: Python! Is! Truly! Amazing!

2005-01-02 Thread Nelson Minar
"Erik Bethke" <[EMAIL PROTECTED]> writes: > I have NEVER experienced this kind of programming joy. Yep, I feel the same way since learning Python. It's really a productive and pleasant language. Congratulations on all your game successes! -- http://mail.python.org/mailman/listinfo/python-list

Help Optimizing Word Search

2005-01-11 Thread Case Nelson
Hi there I've just been playing around with some python code and I've got a fun little optimization problem I could use some help with. Basically, the program needs to take in a random list of no more than 10 letters, and find all possible mutations that match a word in my dictionary (80k words).

XPath and XQuery in Python?

2005-01-11 Thread Nelson Minar
Could someone help me get started using XPath or XQuery in Python? I'm overwhelmed by all the various options and am lacking guidance on what the simplest way to go is. What library do I need to enable three line Python programs to extract data with XPath expressions? I have this problem a lot wit

Re: XPath and XQuery in Python?

2005-01-14 Thread Nelson Minar
Nelson Minar <[EMAIL PROTECTED]> writes: > Could someone help me get started using XPath or XQuery in Python? I figured this out. Thanks for the help, John! Examples below. I used this exercise as an opportunity to get something off my chest about XML and Python - it's kind of a m

Re: Python and SOAP

2005-01-20 Thread Nelson Minar
Peter Schaefer <[EMAIL PROTECTED]> writes: > Is SOAPy still the way to go, or are there better methods? SOAPy hasn't been maintained in awhile. The two contemporary options are ZSI or SOAPpy, both at http://pywebsvcs.sourceforge.net/ ZSI seems to have more serious development now, but neither is

Re: What is print? A function?

2005-01-23 Thread Nelson Minar
Frans Englich <[EMAIL PROTECTED]> writes: > The reason I thinks about this is I need to implement a debug print for my > program; very simple, a function/print statement that conditionally prints > its message whether a bool is true. Not overly complex. As several folks have said, print is a sta

Re: Where are list methods documented?

2005-02-03 Thread Nelson Minar
You're not the only one with a hard time finding the list documentation. It's even crazier for string docs. If you want to see how to strip strings in Python you have to go to the library docs, then click "sequence types" (betcha don't think of strings as sequences), then scroll to the bottom, the

Re: time.clock() or time.time()

2005-08-03 Thread Nelson Minar
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I'm trying to benchmark some function calls for Zope project Other folks have explained time() vs. clock(), so I'll leave that. But rather than roll your own timer functions, consider using timeit. -- http://mail.python.org/mailman/listinfo/pyth

Re: Getting the word to conventional programmers

2005-03-23 Thread Christopher Nelson
Hey, Jeff Hobbs got the last word. ;-) -- http://mail.python.org/mailman/listinfo/python-list

new to mac OS10

2005-04-14 Thread Thomas Nelson
I'm on a mac OS X (10.3.8), and I seem to have accidentally destroyed the default python installation. How should I put it on? Do I need to use the unix version? any help would be greatly appreciated. THN -- http://mail.python.org/mailman/listinfo/python-list

Re: new to mac OS10

2005-04-14 Thread Thomas Nelson
Maurice LING wrote: I'm using OSX 10.3.8 as well. Just wondering, how did you "destroy" it? What I am thinking is, it may not be as destroyed as you think it might have... cheers maurice I was actually trying to update to the newest python version, and I had read something saying it would confl

Re: new to mac OS10

2005-04-15 Thread Thomas Nelson
The main thing I would like is to be able to use tkinter with python on my mac. will the command-line-style source allow this? Does it come with IDLE? How is the fink version different from the source i can download at python.org? Here's the result of the requested commands on my Terminal.

Extension of while syntax

2014-12-11 Thread Nelson Crosby
I was thinking a bit about the following pattern: value = get_some_value() while value in undesired_values: value = get_some_value() I've always hated code that looks like this. Partly due to the repetition, but partly also due to the fact that without being able to immediately recognise th

Free vs proprietary (was Re: NumPy, SciPy, & Python 3X Installation/compatibility issues)

2014-05-10 Thread Nelson Crosby
I also believe in this more 'BSD-like' view, but from a business point of view. No one is going to invest in a business that can't guarantee against piracy, and such a business is much less likely to receive profit (see Ardour). Don't get me wrong - I love free software. It's seriously awesome t

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

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

statistical analysis tools in python?

2006-07-12 Thread Thomas Nelson
Sorry if this is a FAQ, but I couldn't find a good summary through google. What kinds of statistical analysis tools exist in python? I really just need t-tests, chi-squared test, and other such tests of statistical significance. A few things point to numpy and scipy, but I was surprised to find

Re: execute a shell script from a python script

2006-07-17 Thread Thomas Nelson
If your script is foo.sh and takes args: import subprocess subprocess.call(["foo.sh","args"],shell=True) Should work fine. check out http://www.python.org/dev/doc/maint24/lib/module-subprocess.html Enjoy, THN spec wrote: > Hi all, I know nothing about Python. What I need to do is to get a > Pyth

Re: execute a shell script from a python script

2006-07-18 Thread Thomas Nelson
As described in the docs I pointed to before: subprocess.call("foo.sh",shell=True) Is the way to do it without args. I think it is simplest to learn the subprocess module because (quoting from the docs) this module intends to replace several other, older modules and functions, such as: os.system o

Re: statistical analysis tools in python?

2006-07-18 Thread Thomas Nelson
Actually, after a little looking, the simple stats.py module at http://www.nmr.mgh.harvard.edu/Neural_Systems_Group/gary/python.html is exactly what I needed. It may not be as fast or as comprehensive as scipy or R, but installation simply involves downloading the module and importing into the cod

Re: looking for a regular expression

2006-08-01 Thread Thomas Nelson
How about my_string = "We the people of the United States, in order to form a more perfect union, establish justice, insure domestic tranquility,.." print (x for x in my_string.split(",") if "justice" in x).next() This isn't a regular expression, but it gives what you're looking for. THN --

Re: Programming newbie coming from Ruby: a few Python questions

2006-08-03 Thread Thomas Nelson
I strongly recommend trying to come up with your own projects. Just pick small things that reflect something you actually want to do: maybe make a simple board game, or a few scripts to help you keep all your files organized, etc. Generally speaking I think it's easier to teach yourself a languag

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: 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: Two Classes In Two Files

2006-08-10 Thread Thomas Nelson
Perhaps __init__.py has what you're looking for? THN [EMAIL PROTECTED] wrote: > I just started working with Python and ran into an annoyance. Is there > a way to avoid having to use the "from xxx import yyy" syntax from > files in the same directory? I'm sure it's been asked a million times, > b

Re: Memory problem

2006-08-14 Thread Thomas Nelson
Yi Xing wrote: > On a related question: how do I initialize a list or an array with a > pre-specified number of elements, something like > int p[100] in C? I can do append() for 100 times but this looks silly... > > Thanks. > > Yi Xing Use [0]*100 for a list. THN -- http://mail.python.org/ma

Re: can I import the module twice (under differnet names)

2006-11-01 Thread Thomas Nelson
alf wrote: > Hi, > > wonder if in the python I could treat modules imorts like classes > instances. It means I could import it twice or more times under > different names. > > -- > alfz1 You can always give any object as many names as you want: >>> import sys >>> s1 = sys >>> s2 = sys >>> s1.path

Re: Python in sci/tech applications

2006-11-03 Thread Thomas Nelson
How hard would it be to have numpy/ scipy part of the python standard library? Tom mattf wrote: > I've discovered Python and have been trying it out lately as a possible > replacement for computations that would ordinarily be done with a > commercial package like Matlab or IDL. I'd like to mentio

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: calling functions style question

2006-06-06 Thread Thomas Nelson
The difference becomes clear when you import your program into another program (or the command line python editor). __name__!='__main__' when you import, so the functions will not be called if they're inside the block. This is why you see this block so often at the end of scripts; so that the scr

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

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

how can I avoid abusing lists?

2006-07-07 Thread Thomas Nelson
I have this code: type1 = [0] type2 = [0] type3 = [0] map = {0:type1, 1:type1, 2:type3, 3:type1, 4:type2} # the real map is longer than this def increment(value): map[value][0] += 1 increment(1) increment(1) increment(0) increment(4) #increment will actually be called many times through

Re: how can I avoid abusing lists?

2006-07-07 Thread Thomas Nelson
Thanks to everyone who posted. First, I don't think my question was clear enough: Rob Cowie, Ant, Simon Forman, [EMAIL PROTECTED], and Jon Ribbens offered solutions that don't quite work as-is, because I need multiple values to map to a single type. Tim Chase and Bruno Destuilliers both offer ver

Re: Best command for running shell command

2006-07-11 Thread Thomas Nelson
Yes, I highly recommend the subprocess module. subprocess.call() can do almost anything you want to do, and the options are all pretty intuitive Whenever I need to write quick scripts for myself, it's what I use. THN Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > Donald Duck <[EMAIL PRO

Re: Non greedy regex

2006-12-14 Thread Thomas Nelson
There's an optional count argument that will give what you want. Try re.sub('a.*b','','ababc',count=1) Carsten Haese wrote: > On Thu, 2006-12-14 at 06:45 -0800, [EMAIL PROTECTED] wrote: > > Can someone please explain why these expressions both produce the same > > result? Surely this means that

Re: newbieee

2007-01-08 Thread Thomas Nelson
lee wrote: > I getting familiarised with python...can any one suggest me a good > editor available for python which runs on windows xpone more > request guys...can nyone tell me a good reference manual for python.. I think vim is a very good editor for python, and it's certainly available for

  1   2   >