Re: python vs java

2006-09-06 Thread Simon Hibbs
also popular. I'd say that Python 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

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

2006-09-08 Thread Simon Brunning
ed out, that it wouldn't really be very useful at all. -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: convert loop to list comprehension

2006-09-09 Thread Simon Forman
] for n in R: for m in range(n): 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

Re: Map with an extra parameter

2006-09-09 Thread Simon Forman
of speed my thinking was that using map would move the > loop out of Python and into C, is that the case when using list > comprehension? I'd always thought it was just syntatic short hand for > a Python loop. > > M. Your thinking is correct. :-) Check out http://groups.google.ca/group

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. > http://twi

Re: Random Drawing Simulation -- performance issue

2006-09-12 Thread Simon Forman
est of 3: 13 usec per loop [EMAIL PROTECTED]:~ $ python -mtimeit -s'import random; n=range(10)' 'random.choice(n)' 10 loops, best of 3: 6.07 usec per loop (Note 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://mail.python.org/mailman/listinfo/python-list

Re: Help me use my Dual Core CPU!

2006-09-12 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 os

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 pro

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/paralle

Re: Unit balancing

2006-09-13 Thread Simon Brunning
stop and point out his > error. This what you were looking for? <http://home.tiscali.be/be052320/Unum.html> -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a varargs tuple to a list - a definite pitfall for new comers to Python

2006-09-14 Thread Simon Forman
[EMAIL PROTECTED] wrote: > The following program does not work if you uncomment #lis = > ["xmms2"] + list(args) > > Evidently Python is opting for the nullary constructor list() as > opposed to the other one which takes a sequence. But no newcomer would > know this. And the Python docs dont gi

Re: Help me use my Dual Core CPU!

2006-09-15 Thread Simon Wittber
Wolfgang Keller wrote: > > Are there any other concurrency options I've not discovered yet? > > PyMPI? > > Ironpython? > I'm looking at IronPython right now. I'm attempting to get it to run pybench, but first, I think I have to work out how to enable tracebacks... When the dual core notebook fina

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

2006-09-19 Thread Simon Brunning
27;ve referred to, or paraphrased, > that article. Shouldn't 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://

Re: why a main() function?

2006-09-19 Thread Simon Brunning
the module's top level, 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
y "efficient" you mean in terms of CPU. 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
ame 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 Hi

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 > 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
ass(b.foo) (Turns out equality bypasses the methodwraper trickery.) Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and CORBA

2006-09-21 Thread Simon Brunning
search?q=python+corba>. ;-) -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Simon Brunning
ing, frequently-read tables 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
t line 2 with some text line1 = "line 1 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 PR

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 th

Re: where are isinstance types documented?

2006-09-26 Thread Simon Brunning
oesn't - because 'string is not known'. 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

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Simon Brunning
orundum According to the Wikipedia, neither is actually correct 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?

Re: A critique of cgi.escape

2006-09-26 Thread Simon Brunning
n a browser?". Unit tests suitable for automation don't have anything to work with *but* the generated HTML. -- Cheers, Simon B, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

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 be

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

2006-09-27 Thread Simon Brunning
ry', 'c') Why not put a "print fn" line in just before the open, so you can see what it's choking 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
ory used for integers won'tr be re-used for other 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

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

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 unexp

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

2006-10-02 Thread Simon Brunning
hing 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 PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

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

2006-10-02 Thread Simon Willison
run with it, but I thought I'd ask here to see 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

Re: Manipulate PDFs

2006-10-03 Thread Simon Brunning
guys > have any 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

Equal to Anything

2006-10-04 Thread Simon Brunning
pam True >>> "hello!" == spam True But... >>> datetime.datetime.now() == spam False I'm fairly 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

Re: python vs java & eclipse

2006-12-01 Thread Simon Brunning
annoying, 'cos I feel the compiler isn't trusting me. Python usually trusts me, even if I don't always deserve it. ;-) FWIW, I spend perhaps 80% of my coding time with Java (and Eclipse), and 20% with Python. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

per instance descriptors

2006-12-06 Thread Simon Bunker
f the attributes will essentially be doing the same thing - they should not have individual set/get commands. Is there any way of doing this nicely in Python? thanks Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: per instance descriptors

2006-12-07 Thread Simon Bunker
George Sakkis wrote: > [EMAIL PROTECTED] wrote: > > >>George Sakkis wrote: >> >>>Simon Bunker wrote: >>> >>> >>>>Hi I have code similar to this: >>>> >>>>class Input(object): >>>> >>>

Re: per instance descriptors

2006-12-07 Thread Simon Bunker
Carl Banks wrote: > Simon Bunker wrote: > >>Hi I have code similar to this: >> >>class Input(object): >> >> def __init__(self, val): >> self.value = val >> >> def __get__(self, obj, objtype): >> return self.value

Re: Problem in reading a URL

2006-12-08 Thread Simon Brunning
ause it has expired or because > your system cannot accept href='/entrez/query/static/faq.html#Acceptscookies'>cookies Have you tried that URL on your browser? -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

problem while going through a tutorial

2006-12-11 Thread Simon Schuster
I'm new to python, and almost new to programming in general. I'm at http://www.pasteur.fr/formation/infobio/python/ch04.html in that tutorial, and my 'count' function (if it's called a function?) isn't working suddenly. >>> x = "fljshfjh" >>> x 'fljshfjh' >>> count(x, 'h') Traceback (most recent c

not a big deal or anything, but, curiously:

2006-12-12 Thread Simon Schuster
following this tutorial, I copied and pasted: from string import * cds = """atgagtgaacgtctgagcattagctccgtatatcggcgcacaaa tttcgggtgccgacctgacgcgcccgttaagcgataatcagtttgaacagctttaccatgcggtg ctgcgccatcaggtggtgtttctacgcgatcaagctattacgccgcagcagcaacgcgcgctggc ccagcgggcgaattgcatattcaccctgttta

Re: YouTube written in Python

2006-12-13 Thread Simon Brunning
On 12/13/06, Terry Reedy <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote: > > Really? > > It's awful! > > Awesome? Well, it's got some pretty awful clips on it, but I don't think you can blame that on the technology. ;-) -- Cheers, Simon B

Re: tuple.index()

2006-12-14 Thread Simon Brunning
columns are of the same type - say, strings - it doesn't mean that they are interchangeable. Their position has semantic significance - it means something. Make sense? -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-14 Thread Simon Brunning
were possible, and you are supposed to know where in the tuple things are, so it makes no sense to search for it. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple inheritance and __slots__

2006-12-14 Thread Simon Brunning
as a performance tweak only, to minimise the memory footprint of classes of which you are going to have a great number of instances. In short - don't do that. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-14 Thread Simon Brunning
e supposedly "for" strikes me as being irrelevant. Tell that to Guido. They are his arguments. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-14 Thread Simon Brunning
On 12/14/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > Tell that to Guido. They are his arguments. On 2nd thoughts, don't. He has enough on his plate at the moment. ;-) -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/ma

Re: tuple.index()

2006-12-14 Thread Simon Brunning
Eiffel, perhaps? <http://en.wikipedia.org/wiki/Design_by_contract> -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-15 Thread Simon Brunning
m the perpective of somone not interested in Football, the offside rule looks very strange - but I'm not making any suggestions as to how it should be changed. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-15 Thread Simon Brunning
eaking down your doors in the small hours if you choose to go your own way[1]. I can use a spreadsheet to write a letter if I want to - but it would be foolish to complain that the word wrapping was a bit dodgy. -- Cheers, Simon B [EMAIL PROTECTED] [1] The PSU, on the other hand, [EMAIL PROTECTED]( --

Re: tuple.index()

2006-12-15 Thread Simon Brunning
ould better use lists". Oh, absolutely, it's not a hard and fast rule. But I find that if I try to decide whether to use a tuple or a list based on lists for homogeneous collections and tuples for heterogeneous collections where position carries semantic meaning, then I end up using the type

Python Interactive Interpreter Breakage

2006-12-15 Thread Simon Eves
mental ray libraries which are subsequently loaded, so it could be that something is trashing memory somewhere. There is no hard crash I can debug, though (especially since the problem doesn't happen AT ALL with a Debug build). Maybe I need BoundsChecker to trap it. Shame I can't afford it

Re: Python Interactive Interpreter Breakage

2006-12-15 Thread Simon Eves
Simon Eves wrote: I am trying to write a Python module to embed the functionality of Maya (the 3D modelling and animation application from Autodesk, formerly Alias) for doing scripted scene manipulation and rendering processes in Python. Here are both versions of the code, in case what I

Re: tuple.index()

2006-12-19 Thread Simon Brunning
em as you will, but don't complain if the API doesn't support what you want to do. I've had enough of this thread. You can lead a horse to water... -- Cheers, Simon B [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: permutations - fast & with low memory consumption?

2006-12-19 Thread Simon Brunning
problem, because the list > passed ("atomlist") can be some 1e5 items long: Anything here? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 -- Cheers, Simon B [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Simon Brunning
e PEP 8 module name standards. >>> from __future__ import lottery_numbers [1, 16, 19, 20, 21, 39] -- Cheers, Simon B [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-09 Thread Simon Brunning
On 1/9/07, Tim Peters <[EMAIL PROTECTED]> wrote: > Well, just about any technical statement can be misleading if not qualified > to such an extent that the only people who can still understand it knew it > to begin with <0.8 wink>. +1 QTOW -- Cheers, Simon B [EMAI

Re: www.mywebsite.py

2006-01-24 Thread Simon Brunning
k spanish... > > If someone has more informations... This any help? <http://translate.google.com/translate?hl=fr&u=http%3A%2F%2Fwww.nic.py> If it's as bad as the English translation, probably not. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re:

2006-02-02 Thread Simon Brunning
in Python needs the Python software around in order to work. > Should I keep it on my puter??? Yup. It's probably used by some of the vendor supplied tools, which will stop working if you remove Python. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonl

Compiling

2006-02-03 Thread Simon Faulkner
Pardon me if this has been done to death but I can't find a simple explanation. I love Python for it's ease and speed of development especially for the "Programming Challenged" like me but why hasn't someone written a compiler for Python? I guess it's not t

Python on Windows

2006-02-03 Thread Simon Faulkner
I've just written my first (simple) WxPython program - yy! What would folks suggest is the easiest way to package it to run on other windows PCs? I would love a single .exe file that would run without ANY OTHER FILES even if it was 50 Mb! TIA Simon -- http://mail.python.org/ma

Re: Compiling

2006-02-03 Thread Simon Faulkner
>>I love Python for it's ease and speed of development especially for the >>"Programming Challenged" like me but why hasn't someone written a >>compiler for Python? > > > But there *is* a compiler for Python. > http://www.python.org/doc/2.4.2/lib/module-compiler.html ty Bruno, I must confes that

Re: python

2006-02-07 Thread Simon Brunning
- and I'm prepaired tlo be proved wrong on those last two. What do you *want* to program? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: winguiauto

2006-02-07 Thread Simon Brunning
;m not doing any work on Windows automation any more, but others are taking it forward. You might look at <http://www.tizmoi.net/watsup/intro.html> or <http://sourceforge.net/projects/pywinauto>. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-08 Thread Simon Brunning
t it. a little > is > all it takes. why is that so hard to understand ? "The only 'intuitive' user interface is the nipple. After that, it's all learned." - Bruce Ediger -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python good for web crawlers?

2006-02-08 Thread Simon Brunning
On 2/8/06, Alex Martelli <[EMAIL PROTECTED]> wrote: > > Bot? me? did I fail a Turing test again without even noticing?! If you'd noticed the test, you'd have passed. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.pytho

Re: low level data types

2006-02-15 Thread Simon Brunning
ta structures that look like this: > > 32-bit unsigned int MSG_LENGTH > 32-bit unsigned int MSG_CODE > 64-bit signed int DATA > 32-bit length + utf-8 characters STRING_DATA > etc. > > What's the right way to do this in Python? Look at the struct modul

Re: Using ElementTree to tidy up an XML string to my liking

2006-02-23 Thread Simon Dahlbacka
..I hope that you are aware that xml is *case sensitive* -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError when subclassing 'list'

2006-02-26 Thread Simon Percivall
The error you're seeing is because you've rebound 'list' to something else. Try putting "list = type([])" somewhere above your code. -- http://mail.python.org/mailman/listinfo/python-list

Re: sort one list using the values from another list

2006-02-27 Thread Simon Sun
27;t know it is a just a plain variable or like something pattern matching in Haskell. -- Simon Sun you can logout any time you like, but you can never leave... -- http://mail.python.org/mailman/listinfo/python-list

Re: calling a class method

2006-03-01 Thread Simon Percivall
Read this: http://users.rcn.com/python/download/Descriptor.htm Long story short: The type of the instance is passed along together with the instance itself. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie in python

2006-03-02 Thread Simon Brunning
ing python quickly. You'll find plenty to choose from here: <http://www.python.org/doc/Intros.html>. Welcome to Python! -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie errors :-( Need help

2006-03-02 Thread Simon Brunning
erator - in fact that's not a bad idea - but generators are an advanced subject, so I'd steer clear for the moment) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Shell Navigation

2006-03-02 Thread Simon Brunning
printed. Any ideas > what is going on? Sounds like a readline problem. Your OS? How did you install Python? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple System Tray Icon

2006-03-02 Thread Simon Brunning
ks again, > I will keep trying. > Louis This is untested, 'cos I'm on a Mac these days, but what you want should look something like: from SysTrayIcon import SysTrayIcon icon = SysTrayIcon('parh/to/icon.ico', "Hover text", {}) How simple do you want? -- Cheer

Re: Py2Exe security

2005-05-03 Thread Simon Brunning
cker can access them too, regardless of what you do. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting list and then return the index of the sorted item

2005-05-03 Thread Simon Brunning
need [2,0,1,3,4] to be returned >>> spam = [2,3,1,4,5] >>> list(index for index, item in sorted(enumerate(spam), key=lambda item: item[1])) [2, 0, 1, 3, 4] -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (May 3)

2005-05-03 Thread Simon Brunning
QOTW: "The security 'droids have decided that since the MS Office Suite is a 'standard' application then software written in MS Office VBA must be 'safe.' Any other development environments (such as Java, Perl, Cygwin) are 'unsafe' and can't be installed." - Peter Olsen "There's nothing wrong with

Dr. Dobb's Python-URL! - weekly Python news and links (May 3)

2005-05-03 Thread Simon Brunning
QOTW: "The security 'droids have decided that since the MS Office Suite is a 'standard' application then software written in MS Office VBA must be 'safe.' Any other development environments (such as Java, Perl, Cygwin) are 'unsafe' and can't be installed." - Peter Olsen "There's nothing wrong with

Re: py2exe and library.zip

2005-05-04 Thread Simon Brunning
e tiny pyc files, not a great big zip file > with everything in it ( 99% of which never changes) The zip file is a generated artifact. I've always found it a good rule of thumb that you should keep source artifacts in your version control system, not generated artifacts. --

Re: py2exe and library.zip

2005-05-04 Thread Simon Brunning
On 5/4/05, Timothy Smith <[EMAIL PROTECTED]> wrote: > Simon Brunning wrote: > >The zip file is a generated artifact. I've always found it a good rule > >of thumb that you should keep source artifacts in your version control > >system, not generated artifacts. >

Re: Variable option count

2005-05-04 Thread Simon Brunning
t it is the same for > function like: > > f(1, 2, 3) > > How can I do that? f(*A) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie] how to look up functions

2005-05-05 Thread Simon Brunning
thon+documentation -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: handling more databases with ZEO

2005-05-07 Thread Simon Percivall
You should take a look at http://www.zope.org/Wikis/ZODB/FrontPage/guide/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: clear the files using python

2005-05-09 Thread Simon Brunning
rovide little help here. Oh, we don't hate novices here, not at all. On the other hand, we aren't going to write your script for you. ;-) Why not take a look at the Python beginners guide (at <http://www.python.org/moin/BeginnersGuide>), and come back to us when you have a specifi

Re: Trouble saving unicode text to file

2005-05-09 Thread Simon Brunning
On 5/9/05, Max M <[EMAIL PROTECTED]> wrote: > Fredrik Lundh wrote: > > > (I just noticed that there's no euro sign on my swedish keyboard. I've > > never missed it ;-) > > It's probably "AltGR + E" like here in DK My UK keyboard has it as

Dr. Dobb's Python-URL! - weekly Python news and links (May 9)

2005-05-09 Thread Simon Brunning
QOTW: "It's not perfect, but then nobody in this thread has offered anything even remotely resembling perfect documentation for regular expressions yet. " - Peter Hansen "Python's flavor of OO is perfectly valid and usable, even though it doesn't follow the Java Holy Bible of Object Orientation (g

Dr. Dobb's Python-URL! - weekly Python news and links (May 9)

2005-05-09 Thread Simon Brunning
QOTW: "It's not perfect, but then nobody in this thread has offered anything even remotely resembling perfect documentation for regular expressions yet. " - Peter Hansen "Python's flavor of OO is perfectly valid and usable, even though it doesn't follow the Java Holy Bible of Object Orientation (g

Re: Module on Getting the Date & Time

2005-05-10 Thread Simon Brunning
On 5/10/05, Sara Khalatbari <[EMAIL PROTECTED]> wrote: > Is there a Modules in Python that returns the time & > date of today when ran? http://www.google.com/search?q=python+time+date -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http:/

Re: MacOS X drag & drop?

2005-05-15 Thread Simon Percivall
Take a look at Platypus at http://sveinbjorn.sytes.net/platypus. It will make it easier for you. -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (May 16)

2005-05-16 Thread Simon Brunning
QOTW: "As you learn Python, you will find that your PHP code will improve, possibly becoming more and more concise until it disappears completely." - Jorey Bump (Responding to a quotaton of Sturgeon's law: "Ninety percent of everything is crap.") "fwiw, this is of course why google displays 10 res

Dr. Dobb's Python-URL! - weekly Python news and links (May 16)

2005-05-16 Thread Simon Brunning
QOTW: "As you learn Python, you will find that your PHP code will improve, possibly becoming more and more concise until it disappears completely." - Jorey Bump (Responding to a quotaton of Sturgeon's law: "Ninety percent of everything is crap.") "fwiw, this is of course why google displays 10 res

Re: readline module and white-space

2005-05-19 Thread Simon Percivall
Take a look at readline.get_completer_delims() and readline.set_completer_delims(). -- http://mail.python.org/mailman/listinfo/python-list

Re: XML Newbie needing some serious help..

2005-05-20 Thread Simon Brunning
doesn't appear to be well-formed XML, which isn't a good start... -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Access lotus notes using Python

2005-05-23 Thread Simon Brunning
On 5/23/05, Sateesh <[EMAIL PROTECTED]> wrote: > Hi, > Is it possible to access Lotus notes using Python? Can anyone provide me > some pointers? http://www.google.com/search?q=python+lotus+notes&btnI=Lucky -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/s

Re: line-by-line output from a subprocess

2005-05-23 Thread Simon Percivall
Okay, so the reason what you're trying to do doesn't work is that the readahead buffer used by the file iterator is 8192 bytes, which clearly might be too much. It also might be because the output from the application you're running is buffered, so you might have to do something about that as well.

Re: overhead of starting threads

2005-05-23 Thread Simon Percivall
How much you gain by starting threads is also determined by what you're doing in those threads. Remember (or learn): In CPython only one thread at a time can execute python code, so depending on your task threading might gain you little. If you're doing I/O or calling functions written in C (and if

Re: line-by-line output from a subprocess

2005-05-23 Thread Simon Percivall
Jp Calderone wrote: > Or, doing the same thing, but with less code: Hmm ... What have I been smoking? -- http://mail.python.org/mailman/listinfo/python-list

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