Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Simon Brunning
-- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: help with my first use of a class

2006-10-20 Thread Simon Brunning
does that. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: cross-linked version of the python documentation

2006-10-20 Thread Simon Brunning
On 10/20/06, tom arnall [EMAIL PROTECTED] wrote: Is there a cross-linked version of the python documentation available? Is anyone interested in starting a project for such? What do you mean by cross-linked? -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog

Re: I like python.

2006-10-20 Thread Simon Forman
not to bother even opening a window. of How do you know this? Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionaries

2006-10-18 Thread Simon Brunning
On 18 Oct 2006 08:24:27 -0700, Lad [EMAIL PROTECTED] wrote: How can I add two dictionaries into one? E.g. a={'a:1} b={'b':2} I need the result {'a':1,'b':2}. a={'a':1} b={'b':2} a.update(b) a {'a': 1, 'b': 2} -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon

Re: Looking for assignement operator

2006-10-17 Thread Simon Brunning
On 10/17/06, Alexander Eisenhuth [EMAIL PROTECTED] wrote: Hello, is there a assignement operator, that i can overwrite? Soirry, no, assignment is a statement, not an operator, and can't be overridden. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http

Re: A Universe Set

2006-10-16 Thread Simon Brunning
On 10/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You're at the mercy of the comparison machinery implemented by individual classes. Plus, if you put a wildcard object into a set (or use it as a dictionary key) you'll confuse yourself horribly. I know I did. ;-) -- Cheers, Simon B

Re: Need a strange sort method...

2006-10-16 Thread Simon Brunning
, 3,6,9] So withouth making this into an IQ test. Its more like 1 4 7 10 2 5 8 3 6 9 a = [1,2,3,4,5,6,7,8,9,10] a.sort(key=lambda item: (((item-1) %3), item)) a [1, 4, 7, 10, 2, 5, 8, 3, 6, 9] -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http

Re: Need a strange sort method...

2006-10-16 Thread Simon Brunning
On 10/16/06, Simon Brunning [EMAIL PROTECTED] wrote: a = [1,2,3,4,5,6,7,8,9,10] a.sort(key=lambda item: (((item-1) %3), item)) a [1, 4, 7, 10, 2, 5, 8, 3, 6, 9] Re-reading the OP's post, perhaps sorting isn't what's required: a[::3] + a[1::3] + a[2::3] [1, 4, 7, 10, 2, 5, 8, 3, 6, 9

Re: string splitting

2006-10-16 Thread Simon Brunning
' -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

curses problem reading cursor keys

2006-10-07 Thread Simon Morgan
Hi, I'm having trouble with the following code. The problem is that the value read by getch() when I hit the up or down keys doesn't match curses.KEY_UP or curses.KEY_DOWN respectively. Other keys, such as 'z' in my example code, work fine. I only seem to have this problem when dealing with

Re: curses problem reading cursor keys

2006-10-07 Thread Simon Morgan
On Sat, 07 Oct 2006 13:12:33 +, Simon Morgan wrote: import curses def main(scr): status = curses.newwin(1, curses.COLS, 0, 0) status.bkgd('0') status.refresh() list = curses.newwin(curses.LINES, curses.COLS, 1, 0) list.bkgd('X') list.refresh() If I use scr.subwin

Re: How do I read Excel file in Python?

2006-10-06 Thread Simon Brunning
On 5 Oct 2006 12:49:53 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Actually was about to post same solution and got same results. (BTW Simon, the OP date is Aug 9th, 2006). Scratched head and googled for excel date calculations... found this bug where it treats 1900 as leap year

Re: How do I read Excel file in Python?

2006-10-05 Thread Simon Brunning
1/1/1900. I'm sure someone can help you figure out how to convert that to a more useful value. excel_date = 38938.0 python_date = datetime.date(1900, 1, 1) + datetime.timedelta(days=excel_date) python_date datetime.date(2006, 8, 11) -- Cheers, Simon B [EMAIL PROTECTED] http

Re: How do I read Excel file in Python?

2006-10-05 Thread Simon Brunning
On 10/5/06, Simon Brunning [EMAIL PROTECTED] wrote: On 5 Oct 2006 10:25:37 -0700, Matimus [EMAIL PROTECTED] wrote: the date( 8/9/2006 ) in Excel file, i am getting the value as 38938.0, which I get when I convert date values to general format in Excel. I want the actual date value. How

Equal to Anything

2006-10-04 Thread Simon Brunning
sure that I know what is going on here - the left hand side object is getting first stab at the equality test, and understandably, it's saying Nah. But is there anything that I can do about it? -- Cheers, Simon B, [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http

Re: Manipulate PDFs

2006-10-03 Thread Simon Brunning
suggestions or recommendations please post, thanks. Does ReportLab do the trick for you? -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to coerce a list of vars into a new type?

2006-10-02 Thread Simon Brunning
? The call-by-whatever concepts don't really apply to Python very well - any attempt to do so seems to result in more confusion than anything else. I'd recommend you take a look at http://effbot.org/zone/python-objects.htm. it explains everything far better than I could. -- Cheers, Simon B, [EMAIL

Pythonic API design: detailed errors when you usually don't care

2006-10-02 Thread Simon Willison
if I've missed a more elegant solution. Thanks, Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: where the extra space comes from on the stdout

2006-10-02 Thread Simon Percivall
alf wrote: Hi, I can not find out where the extra space comes from. Run following: import os,sys while 1: print 'Question [Y/[N]]?', if sys.stdin.readline().strip() in ('Y','y'): #do something pass $ python q.py Question [Y/[N]]?y Question [Y/[N]]?y

Generating unique row ID ints.

2006-10-01 Thread Simon Wittber
I'm building a web application using sqlalchemy in my db layer. Some of the tables require single integer primary keys which might be exposed in some parts of the web interface. If users can guess the next key in a sequence, it might be possible for them to 'game' or manipulate the system in

Re: Can string formatting be used to convert an integer to its binary form ?

2006-09-29 Thread Simon Brunning
On 9/29/06, Steve Holden [EMAIL PROTECTED] wrote: Unfortunately forty years of programming experience has taught me that there's an essentially infinite supply of mistakes to make ... your mistakes just get smarter most of the time. +1 QOTW. -- Cheers, Simon B, [EMAIL PROTECTED] -- http

Re: does anybody earn a living programming in python?

2006-09-27 Thread Simon Brunning
On 26 Sep 2006 13:43:24 -0700, Fuzzyman [EMAIL PROTECTED] wrote: Simon Brunning is a Pythonista in his spare time but uses Java at work. He has got Jython fairly deeply embedded though. Sure do. We also use Python for a lot of internal tools, the most complex probably being a fairly extensive

Re: Extra Newby question - Trying to create md5 File Listing

2006-09-27 Thread Simon Brunning
on? -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Surprise using the 'is' operator

2006-09-27 Thread Simon Brunning
object types. but memory used for integers can be re-used for *other* integers. I think.) -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

London Python Meetup, Wednesday the 4th of October

2006-09-26 Thread Simon Brunning
I'm organising another London Python meetup at The Stage Door, Waterloo, London SE1 8QA (see http://tinyurl.com/ko27s) for Wednesday the 4th of October, anytime after work. Hope to see you there! -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-announce

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Simon Brunning
is a very common, and often very effective performance tweak in database driven systems. -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: concat next line with previous

2006-09-26 Thread Simon Brunning
with some text line2 = line 2 with some text # Simplest way: line3 = line1 + line2 # More general - joining a sequence of strings, with delimiter lines = [line1, line2] line3 = , .join(lines) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http

Re: where are isinstance types documented?

2006-09-26 Thread Simon Brunning
On 9/26/06, Simon Brunning [EMAIL PROTECTED] wrote: On 26 Sep 2006 02:59:07 -0700, codefire [EMAIL PROTECTED] wrote: For example isinstance(a, int) works fine but isinstance(s, string) doesn't - because 'string is not known'. In this case, you want str rather than string. A couple

Re: where are isinstance types documented?

2006-09-26 Thread Simon Brunning
'. In this case, you want str rather than string. I can't find a single page with a list of built-in types (which doesn't mean that one doesn't exist) but I think you can find them all hanging off this page: http://docs.python.org/lib/types.html. -- Cheers, Simon B, [EMAIL PROTECTED], http

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Simon Brunning
latin - http://en.wikipedia.org/wiki/Illegitimi_non_carborundum - though I think you are right about which form is the more common. or is that just due to differences between british latin and american latin ? American Latin? Is that Lingua::Romana::Perligata? -- Cheers, Simon B, [EMAIL PROTECTED

Re: A critique of cgi.escape

2006-09-26 Thread Simon Brunning
have anything to work with *but* the generated HTML. -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and CORBA

2006-09-21 Thread Simon Brunning
, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-19 Thread Simon Brunning
it be incorporated into the standard tutorial? I think it's very helpful for people who are used to the way C etc handles variables. I agree. These two, also: http://effbot.org/zone/unicode-objects.htm http://effbot.org/zone/import-confusion.htm And probably more... -- Cheers, Simon B, [EMAIL PROTECTED

Re: why a main() function?

2006-09-19 Thread Simon Brunning
, the names are bound to the module's global scope. Access to locals is somewhat faster than access to globals. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to efficiently proceed addition and subtraction in python list?

2006-09-19 Thread Simon Brunning
. If, instead, you are concerned with memory usage, you might instead do something like: for index, value in enumerate(AAA): AAA[index] = value-1 -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: I need some tips to begin a simple project

2006-09-19 Thread Simon Hibbs
programing even easier. Having said all that, Python isn't magic. I'd recommend doing something simple first, such as a calculator or a text editor. These are very easy to do, but will cover the basics of creating a user interface, manipulating data and accessing files. Simon Hibbs -- http

find class where method was defined ?

2006-09-19 Thread Simon Burton
class A(object): ... def foo(self): pass ... class B(A): ... pass ... b=B() b.foo bound method B.foo of __main__.B object at 0xb7b1924c How can I work out what class b.foo was defined in ? Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: find class where method was defined ?

2006-09-19 Thread Simon Burton
'__main__.A' (Turns out equality bypasses the methodwraper trickery.) Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help me use my Dual Core CPU!

2006-09-13 Thread Simon Wittber
Michael wrote: Also, Paul Boddie posted a module for parallel systems a while back as well which might be useful (at least for ideas): * http://cheeseshop.python.org/pypi/parallel I've checked this out, it looks like a good idea which I could build further on. I've just noticed that

Re: Help me use my Dual Core CPU!

2006-09-13 Thread Simon Wittber
Paul Rubin wrote: Simon Wittber [EMAIL PROTECTED] writes: I've just noticed that os.fork is not available on Win32. Ouch. Use the subprocess module. I can't see how subprocess.Popen can replace a fork. Using a manually started process is not really viable, as it does not automatically share

Re: Help me use my Dual Core CPU!

2006-09-13 Thread Simon Wittber
Paul Boddie wrote: Simon Wittber wrote: Michael wrote: Also, Paul Boddie posted a module for parallel systems a while back as well which might be useful (at least for ideas): * http://cheeseshop.python.org/pypi/parallel I've just noticed that os.fork is not available

Re: Unit balancing

2006-09-13 Thread Simon Brunning
you were looking for? http://home.tiscali.be/be052320/Unum.html -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Help me use my Dual Core CPU!

2006-09-12 Thread Simon Wittber
I've just bought a new notebook, which has a dual core CPU. I write cross platform games in Python, and I'd really like to be able to use this second core (on my machine, and on user's machines) for any new games I might write. I know threads won't help (in CPython at least) so I'm investigating

Re: Help me use my Dual Core CPU!

2006-09-12 Thread Simon Wittber
Tim Golden wrote: + Pyro - http://pyro.sf.net + Corba - eg omniorb http://omniorb.sourceforge.net/ + SPyRO - http://lsc.fie.umich.mx/~sadit/spyro/spyro.html + mmap - (built-in module) http://docs.python.org/lib/module-mmap.html + twisted - (because it can do everything), esp.

Re: Random Drawing Simulation -- performance issue

2006-09-12 Thread Simon Forman
that the first and last examples produce values 0..9 while the middle one produces 1..10) I don't know for sure, but I think the random, uh, spread or whatever will be the same for random() as for choice(). If it's important, you should verify that. ;-) Peace, ~Simon -- http

Re: convert loop to list comprehension

2006-09-09 Thread Simon Forman
): if m % 2: res3.append(m) print res3 == [m for n in R for m in range(n) if m % 2] # The above prints True three times. Of course, if your loops get much more complicated than this you should probably spell them out anyway. HTH, ~Simon -- http://mail.python.org/mailman

Re: Map with an extra parameter

2006-09-09 Thread Simon Forman
syntatic short hand for a Python loop. M. Your thinking is correct. :-) Check out http://groups.google.ca/group/comp.lang.python/msg/7a56cf1a052b9c5d wherein Fredrik Lundh shows the difference by bytecode disassembly. Peace, ~Simon P.S. Bottom posts. -- http://mail.python.org/mailman/listinfo

Re: how do you get the name of a dictionary?

2006-09-08 Thread Simon Brunning
, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs java

2006-09-06 Thread Simon Hibbs
is easier to learn and more productive as a language, but Java has a much larger selection of add-ons and libraries available. I can't give you much more help without knowing what the app will do, and therefore what language features or library/framework support would be helpful. Simon Hibbs -- http

Re: CONSTRUCT -

2006-09-05 Thread Simon Forman
Fredrik Lundh wrote: Simon Forman wrote: I'm sorry, your post makes very little sense. you're somewhat new here, right ? ;-) /F Yah, I've been posting here about three months now. Why, did I miss something? :-) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: str.isspace()

2006-09-03 Thread forman . simon
: if offset = len(line) or line[offset].isspace(): if offset = len(line) or line[offset].strip(): * it's symetrical with the rest of the isfoo() string methods. IMHO, it would be odd if it wasn't there. My $0.02 Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT -

2006-09-02 Thread Simon Forman
: http://case.lazaridis.com/wiki/Lang http://case.lazaridis.com/ticket/6 I'm sorry, you post makes very little sense. If all you want to do is implement a less ugly verision of if __name__ == '__main__':, a quick search on google should turn up several ways. Peace, ~Simon -- http

Re: Syntax suggestion.

2006-09-01 Thread Simon Forman
samir wrote: Bonan tagon! George Sakkis wrote: It's been done; it's called IPython: http://ipython.scipy.org/doc/manual/manual.html Thank you for the link! It's just what I've needed but... Roberto Bonvallet wrote : ...so finally you get something that is exactly like any Unix

Re: pictures as characters in a Tk text box?

2006-09-01 Thread Simon Forman
HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: disgrating a list

2006-09-01 Thread Simon Forman
jwaixs wrote: Thank you for all your reply and support. Neil's fits the most to me. I shrinked it to this function: def flatten(x): for i in range(len(x)): if isinstance(x[i], list): x[i:i+1] = x[i] Thank you all again. If someone could find even a cuter way, I'd

Re: Assignment-in-conditional

2006-08-31 Thread Simon Forman
/Python/Recipe/66061 HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2 features

2006-08-30 Thread Simon Forman
/mailman/listinfo/psycopg Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: TNEF decoder

2006-08-30 Thread Simon Forman
Hendrik van Rooyen wrote: Simon Forman [EMAIL PROTECTED] wrote: 8- | A place I once worked at had a project that included some TNEF | handling. There was one developer assigned fulltime to it. He was the | one who sat at his desk hurling curses at his

Re: Is this a good idea or a waste of time?

2006-08-29 Thread Simon Forman
Antoon Pardon wrote: On 2006-08-28, Scott David Daniels [EMAIL PROTECTED] wrote: Antoon Pardon wrote: On 2006-08-25, Simon Forman [EMAIL PROTECTED] wrote: ... Generally asserts should be used to enforce invariants of your code (as opposed to typechecking), or to check certain things

Re: naive misuse? (of PyThreadState_SetAsyncExc)

2006-08-29 Thread Simon Forman
to misuse the function. Thanks, Johan I *was* going to say that if you didn't already know the answer to that question then your use would almost certainly be naive. But I thought that'd be more nasty than funny, so I bit my tongue. ~Simon -- http://mail.python.org/mailman/listinfo/python

Re: newbe question about removing items from one file to another file

2006-08-29 Thread Simon Forman
and of course you could say lines = csin.string.splitlines() to get a list of the lines. That doesn't take you all the way, but it's something. Hope that helps, Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess woes

2006-08-29 Thread Simon Forman
],stdin=sp.PIPE, stdout=sp.PIPE) p1.stdin.write(x) p1.stdin.close() But I think communicate() would be better for you in this case. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: TNEF decoder

2006-08-29 Thread Simon Forman
some TNEF handling. There was one developer assigned fulltime to it. He was the one who sat at his desk hurling curses at his workstation at the top of his lungs, later he developed a pretty severe drinking problem. Good luck. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python

Re: newbe question about removing items from one file to another file

2006-08-28 Thread Simon Forman
. Also, there's the elementtree package for parsing XML that could help here too. ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Firewire comms using Python?

2006-08-28 Thread Simon Forman
Fraggle69 wrote: Hi, Does anyone have any idea of how I can use Python to get images from my firewire camera?? I am using python under winXP pro Cheers Fraggle Have you tried google? Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation Fault

2006-08-28 Thread Simon Forman
[EMAIL PROTECTED] wrote: Simon Forman [EMAIL PROTECTED] writes: pycraze wrote: I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our testcases we

Re: Middle matching - any Python library functions (besides re)?

2006-08-28 Thread Simon Forman
Andrew Robert wrote: Simon Forman wrote: Paul Rubin wrote: EP [EMAIL PROTECTED] writes: Given that I am looking for matches of all files against all other files (of similar length) is there a better bet than using re.search? The initial application concerns files in the 1,000's, and I

Re: Firewire comms using Python?

2006-08-28 Thread Simon Forman
PetDragon wrote: yeah man no joy there Simon Forman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Fraggle69 wrote: Hi, Does anyone have any idea of how I can use Python to get images from my firewire camera?? I am using python under winXP pro Cheers Fraggle

Re: Middle matching - any Python library functions (besides re)?

2006-08-28 Thread Simon Forman
Andrew Robert wrote: Because I was lazy.. The checksume_compare came from something else I wrote that had special logging and e-mailer calls in it. Should have ripped the reference to caller and file name out.. Aaaahh the subtle joys of cut-and-paste programming... :-D (I've done it

Re: Twisted server and protocol question

2006-08-28 Thread Simon Forman
Benry wrote: Hi guys. I hope I can discuss Twisted here. If not, direct me to the correct place please. Twisted mailing list: http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python ;-) ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for text

2006-08-28 Thread Simon Forman
return True if checkfile(f): # File passes... pass Be sure to close your file object when you're done with it. And you might want fewer or different print statements. HTH Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: eval() woes

2006-08-28 Thread Simon Forman
rdrink wrote: Hey Simon, Thanks for the reply. Simon Forman wrote: You must be doing something weird, that equation works for me: Try posting the minimal code example that causes the error and the full, exact traceback that you get. I appreciate the offer... but at this point my code

Re: eval() woes

2006-08-28 Thread Simon Forman
passed in... but I could be wrong) Can anyone see something I can't? Learn to read tracebacks. They're your friends. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Simon Forman
Antoon Pardon wrote: On 2006-08-28, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Antoon Pardon wrote: There seem to be enough problems that work with ints but not with floats. In such a case enforcing that the number you work with is indeed an int seems fully appropiate. I've _never_

Re: import function from user defined modules

2006-08-27 Thread Simon Forman
COMMAND should invoke a function defined in some other module say Y. thanks a lot to all who will look into problem, any help would be appreciated. from X import func Then you can call func() in your module. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question. Class definitions on the fly.

2006-08-27 Thread Simon Forman
/exec.html for the exec statement and http://docs.python.org/lib/built-in-funcs.html#l2h-59 for the reload() function. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: eval() woes

2006-08-27 Thread Simon Forman
passed a bare '-', i.e. at some point you're calling int('-')... HTH Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation Fault

2006-08-27 Thread Simon Forman
standard lib is fairly robust but of course not bullet-proof. If there's a way to make it seg fault (and it's in the standard lib and not your C code) people will want to know. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Middle matching - any Python library functions (besides re)?

2006-08-27 Thread Simon Forman
to perform. Of course, if your files are large it may not be feasible to do this with all of them. But they'd have to be really large, or there'd have to be lots and lots of them... :-) More information on your actual use case would be helpful in narrowing down the best options. Peace, ~Simon -- http

Re: rollover effect

2006-08-26 Thread Simon Forman
information about the type of text(event). Another thign i am looking for is to have a right click on that very text as well If somebody can put some light on it, then it would be really great for my project. Thank you in advance. What GUI system are you using? Peace, ~Simon -- http

Re: Out-dated compiled modules (*.pyc)?

2006-08-26 Thread Simon Forman
the interpreter (manually or through some IDE option), 2) call reload() on your modules, or 3) del the modules from sys.modules before re-importing them. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: rollover effect

2006-08-26 Thread Simon Forman
groves wrote: Simon Forman wrote: groves wrote: hi I am trying to get a roll over effect on my canvas.(this is a virtual program which will eventually fit into my final program) Exactly i have a text on my screen and I want to have a brief discription across it whenever

Re: rollover effect

2006-08-26 Thread Simon Forman
that are not specific to python. But you still haven't answered my question? Are you using Tkinter? wxWidgets? Gtk bindings? Assuming that you're using Tkinter, what prevents you from using Pmw? Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: rollover effect

2006-08-26 Thread Simon Forman
SuperHik wrote: groves wrote: Simon Forman wrote: groves wrote: Sorry, as I am new to python so couldn't understand what yu were asking. Now the problem is that i annot use pmw in my project..is thre anyother alternative by which I can have a rollover mouse effect on the canvas

Re: Dive into Python question

2006-08-26 Thread Simon Forman
when you access it. If you were to delete a key-value pair and then set it again and print out your dict again it would quite likely appear in a different order. I've only ever skimmed DiP, but I'm sure Mark will get to that detail, probably in section 3.1. Peace, ~Simon -- http

Re: lazy arithmetic

2006-08-25 Thread Simon Forman
, so you're really calling Add(y), nothing more nor less. x+y = x.__add__(y) = (x.__add__)(y) = Add(Y) = Hello new Add instance, here's a y for you... :-) z=x+y is translated to z.__add__(y) Nope. Just plain wrong. Not sure why you'd think that. (No offense intended.) Peace, ~Simon F

Re: lazy arithmetic

2006-08-25 Thread Simon Forman
[EMAIL PROTECTED] wrote: Simon Forman wrote: Item.__add__ = Add is a very strange thing to do, I'm not surprised it didn't work. Yes it is strange. I also tried this even stranger thing: class Item(object): class __add__(object): def __init__(self, a, b=None): print

Re: Is this a good idea or a waste of time?

2006-08-25 Thread Simon Forman
, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Open Office and Python

2006-08-25 Thread Simon Brunning
at the csv module? http://docs.python.org/lib/module-csv.html. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Duck typing alows true polymorfisim

2006-08-25 Thread Simon Forman
the '*' mean multiply? and what are the pipe symbols for? (Feel free to ignore these questions. I should really go look it up myself if I'm so curious..) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: List comparison help please

2006-08-25 Thread Simon Forman
Bucco wrote: Simon Forman wrote: 1) Don't use dir, file, and list as variable names, those are already python built in objects (the dir() function, list type, and file type, respectively.) Thanks. My own stupidity on this one. 2) 'r' is the default for open(), omit it. self.flist

Re: Fw: Is this a good idea or a waste of time?

2006-08-25 Thread Simon Forman
Hendrik van Rooyen wrote: Simon Forman [EMAIL PROTECTED] wrote: 8- | BTW, speaking of strictness, more stricter is invalid English, | just stricter is the correct form. ;-) or alternatively the construct more strict is also

Re: Duck typing alows true polymorfisim

2006-08-25 Thread Simon Forman
[EMAIL PROTECTED] wrote: What was i thinkinng repace * with + i was'nt thinking i origanaly thaught of sum of squares so i put a * insted of a + But again, what's your question? -- http://mail.python.org/mailman/listinfo/python-list

Re: Avoiding if..elsif statements

2006-08-25 Thread Simon Forman
unexpected wrote: I have a program where based on a specific value from a dictionary, I call a different function. Currently, I've implemented a bunch of if..elsif statements to do this, but it's gotten to be over 30 right now and has gotten rather tedious. Is there a more efficient way to do

Re: When is a subclass not right?

2006-08-24 Thread Simon Forman
the developer *tells* you it won't work, that's a good indication. :-) You haven't missed anything: the developer was talking about his specific code, not python in general. (I'm on the Twisted list too. ;-) ) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor

2006-08-24 Thread Simon Forman
Jason Jiang wrote: Hi, Could someone recommend a good Python editor? Thanks. Jason There have just been one or two long-ish threads on exactly this question. Search the google groups version of this group for them. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: lazy arithmetic

2006-08-24 Thread Simon Forman
= Item() y = Item() print x, y c = x+y # This time, the Add constructor gets only the first two arguments: self and y. # So, what happened to x ? Is this some kind of property voodoo going on ? # Simon. Look at the signature for __add__: __add__(self, other) Now look at the signature

Re: RE Module

2006-08-24 Thread Simon Forman
trying to strip html markup to get plain text from a file, w3m -dump some.html works great. ;-) HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you get the name of a dictionary?

2006-08-23 Thread Simon Brunning
paying. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

<    6   7   8   9   10   11   12   13   14   15   >