Re: list of range of floats

2007-02-14 Thread Simon Brunning
r < target < upper thing inline. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: c_string missing from ctypes?

2007-02-23 Thread Simon Brunning
On 23 Feb 2007 09:03:21 -0800, Jacob Rael <[EMAIL PROTECTED]> wrote: > I was following along with this site: > > http://www.brunningonline.net/simon/blog/archives/000659.html You don't want to be messing around with that old rubbish. I should know - I wrote it. Instead,

Re: Python, SOAP & SSL

2007-02-28 Thread Simon Brunning
On 2/28/07, Barker, CJ <[EMAIL PROTECTED]> wrote: > Was this ever solved? You might get more feedback about this on the Python web services list at <https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk>. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/si

Re: msvcr71.dll

2007-02-28 Thread Simon Brunning
vcr71.ddl. But IANAL, and neither is anyone else that I've heard discussing the matter. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning MSN: small_values -- http://mail.python.org/mailman/listinfo/python-list

Python IDE

2007-11-03 Thread Simon Pickles
Hi, I have recently moved from Windows XP to Ubuntu Gutsy. I need a Python IDE and debugger, but have yet to find one as good as Pyscripter for Windows. Can anyone recommend anything? What are you all using? Coming from a Visual Studio background, editing text files and using the terminal to

Re: python equivalent to heckle

2007-11-06 Thread Simon Brunning
ce, either that code isn't being covered or it > doesn't do anything. > from http://glu.ttono.us/articles/2006/12/19/tormenting-your-tests-with-heckle > > Is there anything similar for python?? Pester - <http://jester.sourceforge.net/>. -- Cheers, Simon B. [EMAIL PROT

Re: >>>> 911 operation by evil JEWS and Mossad <<<

2007-11-08 Thread Simon Spiegel
On 2007-11-08 04:21:48 +0100, [EMAIL PROTECTED] said: > 911 carried out by evil jews and mossad > http://www.guba.com/watch/2000991770 I'm glad it was carried out by evil jews and not by nice ones. That rules me out. simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Rothschilds own half the worlds wealth directly and indirectly thru zionist proxies Re: Bill Gates was never the Richest man on earth

2007-11-12 Thread Simon Spiegel
em of pigeons >>> for communication and encoded letters, ... >> >> I didn't believe you until I read that part. It all makes sense now! >> < > > You would learn a lot MORE if you listened to the videos whose links > are provided. Ah, good, we don't have to actually *watch* them ... simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Arrays

2007-11-13 Thread Simon Brunning
On Nov 13, 2007 6:58 AM, John Machin <[EMAIL PROTECTED]> wrote: > Hey Bernard, read Gordon's message carefully; he's asking about > arrays, not lists. Chances are a list is exactly what the OP wants. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline

Re: Looking for a good Python environment

2007-11-14 Thread Simon Pickles
Well, I am recent Windows escapee, and was dismayed by lack of Pyscripter for Linux. Hold on... there is hope! Pyscripter works great using WINE. search http://groups.google.com/group/PyScripter?hl=en for "Linux" Enjoy! Paul Rudin wrote: > jwelby <[EMAIL PROTECTED]> writes: > > > >> This

Re: which Python ? asks beginner

2007-11-17 Thread Simon Brunning
want something to play with, steer clear. It'll be an exception to the just-works upgrade that we've been used to in the past, but plans are afoot to make upgrading possible. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN

Re: Excellent sci-fi novel featuring Python

2007-11-17 Thread Simon Brunning
ith a > Python version that would be nearly 10 years old already? If the whole 3.n series is called "Python 3000", then it's very plausible. I can see Python 3.7 or 3.8 being the latest version in 2018. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/bl

Re: creating color gradients using PIL

2007-11-23 Thread Simon Hibbs
m = im.tostring() t = fromstring(m, 'b') tt = asarray(t, typecode) # Note that ysize is first: return reshape(tt, (ysize, xsize)) im = numpy2pil(myarray) im.putpalette(palette_list) im.save('myimage.png') You'll need to import numpy and Image. You'll need to generate the palette (juust a list) and image array (a numpy array) of course. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: python safe scripting

2007-11-23 Thread Simon Hibbs
there's a module for this. Those kinds of tests are fairly easy though. import datetime, os filename = 'myfile.log' if (datetime.date.today().weekday() == 0) or (os.stat(filename)[6] > 200): do.whatever() The individual tests would be better wrapped in utility fu

Re: How to Teach Python "Variables"

2007-11-26 Thread Simon Brunning
ps you mean: http://effbot.org/zone/python-objects.htm -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Simon Forman
e the source code of IDLE available so you could just figure out what it's doing and encapsulate that in a script. Regards, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Job Offer: Python Ninja or Pirate!

2007-12-10 Thread Simon Forman
On Dec 10, 6:10 am, "Nikos Vergas" <[EMAIL PROTECTED]> wrote: > > Challenge: > > A valid response will be either a solution to the problem below, or a > > link to some code of which you > > are particularly proud. > > > Problem: In the dynamic language of your choice, write a short program > > that

Re: Odd behavior in Python/Tkinter?

2007-12-21 Thread Simon Forman
On Dec 21, 12:30 pm, Lie <[EMAIL PROTECTED]> wrote: > Inspect the following code: > > --- start of code --- > import Tkinter as Tk > from Tkconstants import * > > root = Tk.Tk() > > e1 = Tk.Entry(root, text = 'Hello World') > e2 = Tk.Entry(root, text = 'Hello World') > > e1.grid(row = 1, column = 1

Re: proposed Python logo

2006-04-21 Thread Simon Brunning
the Garden of Eden. +1. I'd like some variation of <http://tinyurl.com/gj74k> used as a logo. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: gcc errors

2006-04-27 Thread Simon Percivall
It doesn't think you're on an intel box, it thinks you want to compile universal libraries, since you installed a universal python. The problem is likely to be that you haven't installed SDK's for intel as well as powerpc when you installed Apple's Developer Tools. Do that, and it should work ...

Re: elementtidy, \0 chars and parsing from a string

2006-05-09 Thread Simon Percivall
Well, it seems you can do: parser = elementtidy.TidyHTMLTreeBuilder.TidyHTMLTreeBuilder() parser.feed(your_str) tree = elementtree.ElementTree.ElementTree(element=parser.close()) Look at the parse() method in the ElementTree class. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading Soap struct type

2006-05-10 Thread Simon Brunning
f. I suggest you look at it's source. IIRC, SOAPpy's structType has a _keys() function - so somethign like the following (untested) might work: struct_as_a_dict = dict((key, getattr(struct, key)) for key in struct._keys()) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net

Re: syntax for -c cmd

2006-05-10 Thread Simon Brunning
r. Python's syntax doesn't allow you to put multiple > clauses on a single line. if your shell supports it, use a "here document", > or > embedded newlines. if not, use a script. Or there's always this; cool in a "The Dark Side is str

Re: listener program in Python

2006-05-12 Thread simon . hibbs
2" explains how to write Windows services and do basic networking. This article explains one way: http://tinyurl.com/ezjx7 Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the difference between tuple and list?

2006-05-16 Thread Simon Brunning
On 16 May 2006 07:47:24 -0700, daniel <[EMAIL PROTECTED]> wrote: <http://www.python.org/doc/faq/general.html#why-are-there-separate-tuple-and-list-data-types> -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Python and GLSL

2006-05-16 Thread Simon Bunker
Hi I was wondering if there is a Python module for running GLSL (OpenGL shader language) in OpenGL through Python. I think that Cg is available through PyCg - most likely using PyGame for the OpenGL. Has anyone done this with GLSL shaders? thanks Simon -- http://mail.python.org/mailman

realization: no assignments inside expressions

2006-05-18 Thread Simon Burton
op new users of python from writing too obfuscated code. wow. Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread Simon Brunning
On 18 May 2006 22:50:24 -0700, softwindow <[EMAIL PROTECTED]> wrote: > the re module is too large and difficult to study > > i need a detaild introduction. <http://gnosis.cx/publish/programming/regular_expressions.html> -- Cheers, Simon B, [EMAIL PROTECTED], http://www.bru

Re: about py2exe, I installed it, but can't find py2exe.exe in my computer.

2006-05-22 Thread Simon Brunning
On 22 May 2006 04:53:34 -0700, python <[EMAIL PROTECTED]> wrote: > it prompt: invalid command 'py2exe'. > I have import py2exe in setup.py file. Can you show us your setup.py file, the exact command that you typed, and the exact error message that you are getting? -- C

Re: manual http request

2006-05-23 Thread Simon Brunning
r your technical query, take a look at Mechanize - <http://wwwsearch.sourceforge.net/mechanize/>. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex speed

2006-05-27 Thread Simon Percivall
You can gain substantial speed-ups in very certain cases, but the main point of Pyrex is ease of wrapping, not of speeding-up. Depending on what you're doing, rewriting in Pyrex or even in C, using the Python/C API directly, might not gain you much. -- http://mail.python.org/mailman/listinfo/pyt

Treating a unicode string as latin-1

2008-01-03 Thread Simon Willison
in range(128) How can I tell Python "I know this says it's a unicode string, but I need you to treat it like a bytestring"? Thanks, Simon Willison -- http://mail.python.org/mailman/listinfo/python-list

Pythonland documentation

2008-01-18 Thread Simon Pickles
Hi I am new to python (fairly) but can't stop pythonning. c++ seems so far away now from here it looks like a horrid scribble :) Anyway my question is really about doc tools. I've been used to doxygen in c++ land, and although it makes a reasonable stab with a python project in java mo

del self?

2008-01-25 Thread Simon Pickles
Hi, Just curious... What are the implications of a class member calling: del self is that what the __del__ method calls anyway? Thanks Simon -- Linux user #458601 - http://counter.li.org. -- http://mail.python.org/mailman/listinfo/python-list

Hashable

2008-01-26 Thread Simon Pickles
Hi, The term 'hashable'. Am I right in thinking it means it can be indexed? like a string or a dict? Thanks Si -- Linux user #458601 - http://counter.li.org. -- http://mail.python.org/mailman/listinfo/python-list

REALLY simple xml reader

2008-01-27 Thread Simon Pickles
Hi Can anyone suggest a really simple XML reader for python? I just want to be able to do something like this: xmlDoc = xml.open("file.xml") element = xmlDoc.GetElement("foo/bar") ... to read the value of: 42 Thanks Simon -- Linux user #458601 - http://counter

refcount

2008-01-29 Thread Simon Pickles
Hi, Is is possible to access the refcount for an object? Ideally, I am looking to see if I have a refcount of 1 before calling del Thanks Simon -- Linux Counter: User# 424693 -- http://mail.python.org/mailman/listinfo/python-list

Events in Python

2008-01-30 Thread Simon Pickles
Hi, I have a stackless python app, using twisted in parts (.internet and .adbapi). I need a little help getting pythonic after years of c++ hell. I'd like to use a system of events and observers, like c++ boost.signal. I'd like to be able to subscribe multiple callbacks to a single function a

Sudden pyexpat error with ElementTree

2008-02-09 Thread Simon Pickles
ust rebuilt python to see if I had messed it up somehow, but the problem persists. Thanks for your advice. Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2008-02-18 Thread Simon Brunning
://tinyurl.com/22q6cb Not sure if something that ugly counts as a reason for keeping them around, though! -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues -- http://mail.python.org/mailman/listinfo/python-list

Garbage collection

2008-02-18 Thread Simon Pickles
or to perform the delete. However, this doesn't trigger my overloaded __del__ destructor. Can I simply rely on the python garbage collector to take it from here? Is there a way to find how many references exist for an object? Thanks Simon -- Linux user #458601 - http://counter.li.org.

Re: Garbage collection

2008-02-19 Thread Simon Pickles
Ken wrote: > What is your __del__ method doing? > Actually, nothing but printing a message when the object is deleted, just morbid curiosity. I've yet to see one of the destructor messages, tho > > from sys import getrefcount > print getrefcount(x) > >

Re: Sending key-presses to other programs on Windows, and settings of controls?

2008-02-22 Thread Simon Brunning
On Thu, Feb 21, 2008 at 1:20 PM, Tim van der Leeuw <[EMAIL PROTECTED]> wrote: > I'm looking for ways to send keypresses to another application on Windows > XP, and to set values of Windows Controls (all of them text-boxes). Try <http://pywinauto.openqa.org/>. --

Re: Tkinter: Missing the last piece of the puzzle

2008-02-23 Thread Simon Forman
gt; > Now I want to [en/dis]able those options. Can I ask the text to notify > me when the modified flag changes? yes! check out http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/464635 HTH, ~Simon > Can I set the statuses when the > user clicks File, before the options are d

How to make "rainbow" RGB values?

2008-02-24 Thread Simon Forman
ing sines, but this resulted in too much red and blue, and no indigo/violet. Any suggestions? I'm searching on the web now but not coming up with much, so I thought I'd ask here. TIA, ~Simon Here's the sinecode I tried: def g(n): ''' map sine [-1.0 .. 1.0

Re: How to make "rainbow" RGB values?

2008-02-24 Thread Simon Forman
effect. > > -- > Andrew McNamara, Senior Developer, Object Crafthttp://www.object-craft.com.au/ Hey thank you very much, that worked like a charm! :] There's even a library function in the colorsys module (http:// docs.python.org/lib/module-colorsys.html) Cheers, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: List all files using FTP

2008-03-06 Thread Simon Brunning
; > anyone that has a program that will do this? > > Not offhand, but you can look at the ftpmirror.py script for > inspiration. > It should be in your Tools/scripts/ subdirectory of your Python > installation. This might be of use: <http://ftputil.sschwarze

Re: Regarding coding style

2008-03-07 Thread Simon Brunning
On Fri, Mar 7, 2008 at 4:31 PM, K Viltersten <[EMAIL PROTECTED]> wrote: > > 1. When writing English, Strunk and > White apply. I apply Fowler, PEP 8 be damned. ;-) -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/m

Re: lowercase u before string in "python for windows"

2008-03-10 Thread Simon Brunning
On Mon, Mar 10, 2008 at 5:20 PM, davidj411 <[EMAIL PROTECTED]> wrote: > why does this occur when using the python windows extensions? There's nothing Windows specific about this - it just means that you have unicode strings. See <http://effbot.org/zone/unicode-objects.htm>,

Re: Check For SELF Variable Existance

2008-03-11 Thread Simon Brunning
ttr(self, 'chips'): print 'got chips!' ... >>> spam = Spam() >>> spam.egg() >>> spam.chips = 'beans' >>> spam.egg() got chips! -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Big file

2008-03-12 Thread Simon Forman
c) 2000 BeOpen.com.\nAll Rights Reserved.\n \nCopyright (c) 1995-2001 Corporation for National Research Initiatives.\nAll Rights Reserved.\n\nCopyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\nAll Rights Reserved.' HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

finding items that occur more than once in a list

2008-03-18 Thread Simon Forman
Is there a more efficient way to do this? def f(L): '''Return a set of the items that occur more than once in L.''' L = list(L) for item in set(L): L.remove(item) return set(L) |>> f([0, 0, 1, 1, 2, 2, 3]) set([0, 1, 2]) -- http://mail.python.org/mailman/listinfo/pyth

Re: finding items that occur more than once in a list

2008-03-18 Thread Simon Forman
I love you guys, thanks! ;-) ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: PODCasts

2008-03-19 Thread Simon Brunning
o late to fight it. > Does anyone have any recommended net casts on Python, or programming in > general? > > Whats everyone listening to? Python411: <http://www.awaretek.com/python/index.xml> This Week in Django: <http://media.djangonetcasts.com/twid_mp3.xml> Plus a

Re: Using threads in python is safe ?

2008-03-19 Thread Simon Brunning
On Wed, Mar 19, 2008 at 7:43 AM, Deepak Rokade <[EMAIL PROTECTED]> wrote: > If jobs to be processed by threds is I/O bound would multithreading help > python to improve speed of application ? Probably, yes. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/bl

Re: changing names of items in a list

2008-03-19 Thread Simon Brunning
to the original list. See <http://effbot.org/zone/python-objects.htm>. I'd rewrite that as (untested): def renamefiles(self, extn): self.origlist = list((x + "." + extn) for x in self.origlist) or def renamefiles(self, extn): self.origlist = list((&qu

Re: if __name__ == '__main__':

2008-03-20 Thread Simon Brunning
On Thu, Mar 20, 2008 at 4:12 PM, Bhagwat Kolde <[EMAIL PROTECTED]> wrote: > Hi, > I am new to the python and not getting meaning of following line, > > if __name__ == '__main__': > main() <http://www.python.org/doc/faq/programming/#how-do-i-find-the-current

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-20 Thread Simon Forman
ering to "port" Tkinter to Python 3.0, I hadn't noticed that there was any discussion of removing it. It would be a shame IMHO. Sure it has warts, but it /works/ and good for quick and dirty GUIs as well as elaborate (even totally visually customized) fancy applications. ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Do any of you recommend Python as a first programming language?

2008-03-26 Thread Simon Brunning
rofessional kitchen as "a left-over warming > room". +1 QOTW. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic code problem

2008-03-28 Thread Simon Brunning
On Thu, Mar 27, 2008 at 4:13 PM, <[EMAIL PROTECTED]> wrote: > My dynamic code failed at this site http://playwide1.extra.hu/, need > some help thank you. <http://catb.org/~esr/faqs/smart-questions.html> -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net

changing URLs in webpages, python solutions?

2009-01-17 Thread Simon Forman
ent solution in a day or so, like with Beautiful Soup or something, but I'd much rather re- use someone else's work if I can. I'm pretty sure this falls into the category of "someone else has had, and solved, this problem before." Any recommendations? Thanks in advance,

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-17 Thread Simon Forman
On Jan 11, 1:22 pm, "Madhusudan.C.S" wrote: >   I am sorry all I am not here to just blame Python. This is just an > introspection of whether > what I believe is right. Being a devotee of Python from past 2 years I > have been writing only > small apps and singing praises about Python where ever I

Re: *Advanced* Python book?

2009-01-18 Thread Simon Brunning
he important areas that the more introductory books rightly leave out, -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: changing URLs in webpages, python solutions?

2009-01-18 Thread Simon Forman
On Jan 18, 8:40 am, Stefan Behnel wrote: > Simon Forman wrote: > > I want to take a webpage, find all URLs (links, img src, etc.) and > > rewrite them in-place, and I'd like to do it in python (pure python > > preferred.) > > lxml.html has functions specifi

Re: Why I'm getting the date of yesterday

2009-01-20 Thread Simon Brunning
2009/1/20 Hussein B : > Hey, > I'm trying to get the get the date before today, I tried this: > d = datetime.now() - timedelta(days = -1) > But I got the date of tomorrow. That's because you are taking away a negative value. This is like doing: >>> 0 - (-1)

Re: Odd syntactic NON-error?

2009-01-30 Thread Simon Brunning
2009/1/30 Alaric Haag : > So, is the "secret" that the period is syntactically an "operator" like > + or * ? Exactly that: <http://users.rcn.com/python/download/Descriptor.htm>. Sh! -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading text file with wierd file extension?

2009-02-02 Thread Simon Brunning
anything magic with filenames, so this must be some sort of a fileysytem oddity, I think. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

parse date/time from a log entry with only strftime (and no regexen)

2009-02-03 Thread Simon Mullis
Hi All I'm writing a script to help with analyzing log files timestamps and have a very specific question on which I'm momentarily stumped I'd like the script to support multiple log file types, so allow a strftime format to be passed in as a cli switch (default is %Y-%m-%d %H:%M:%S). When i

Re: Date Comparison

2009-02-03 Thread Simon Brunning
2009/2/3 Diez B. Roggisch : > Use the java API of java.util. Or better still, use Joda. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: JDBC in CPYTHON

2009-02-03 Thread Simon Brunning
on/javaclass.html> might be of help. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: v 3.0 mpkg

2009-02-04 Thread Simon Brunning
an't follow how to install it without a .mpkg file. Any help > would be really appreciated. AFAIK there's no Python 3.0 installer for the Mac. You'll have to build it yourself - see <http://tinyurl.com/6zkem7>. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: parse date/time from a log entry with only strftime (and no regexen)

2009-02-05 Thread Simon Mullis
n the .args > attribute to find the extra data. you could then find the extra data > in the original string, use the index to remove it, and re-parse the > time. > > ugly, but should work. > andrew > -- > http://mail.python.org/mailman/listinfo/python-list > -- Si

Should "open(sys.stdin)" and "open(file, 'r')" be equivalent?

2009-02-05 Thread Simon Mullis
h.py", line 35, in main() File "./test_fh.py", line 26, in main T = TestParse() File "./test_fh.py", line 8, in __init__ self.scan_data(sys.stdin) File "./test_fh.py", line 18, in scan_data for line in fileobject: KeyboardInterrupt # echo $? 1 So, what am I doing wrong? Thanks in advance SM -- Simon Mullis _ si...@mullis.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Should "open(sys.stdin)" and "open(file, 'r')" be equivalent?

2009-02-05 Thread Simon Mullis
Hi Chris 2009/2/5 Chris Rebert > > I'd add some print()s in the above loop (and also the 'for f in files' > loop) to make sure the part of the code you didn't want to share ("do > stuff with the line") works correctly, and that nothing is improperly > looping in some unexpected way. The point is

[SOLVED] Re: Should "open(sys.stdin)" and "open(file, 'r')" be equivalent?

2009-02-05 Thread Simon Mullis
Forget it all... I was being very very daft! The "default = 'False'" in the options for stdin was not being evaluated as I thought, so the script was waiting for stdin even when there was the glob switch was used...No stdin equals the script seeming to "hang". Ah well. SM -- http://mail.python.o

Re: Should "open(sys.stdin)" and "open(file, 'r')" be equivalent?

2009-02-05 Thread Simon Mullis
Last try at getting the indenting to appear correctly.. #!/usr/bin/env python import glob, os, sys class TestParse(object): def __init__(self): if options.stdin: self.scan_data(sys.stdin) if options.glob: self.files = glob.glob(options.glob)

Re: A little bit else I would like to discuss

2009-02-13 Thread Simon Hibbs
t has to offer, with full native support for MacOS X, Linux and Windows. The only fly in the ointment in licensing. The QT toolkit will be fully GPL and LGPL from version 4.4, but PyQT itself has a dual GPL/ commercial licensing structure. Still, it's relatively cheap and well worth it

Re: [Help] The pywinauto Can't select the MDI's menu using the MenuItems() which return [].

2008-12-18 Thread Simon Brunning
iving is always a last resort. -- Cheers, Simon B. si...@brunningonline.net -- http://mail.python.org/mailman/listinfo/python-list

Re: [Help] The pywinauto Can't select the MDI's menu using the MenuItems() which return [].

2008-12-22 Thread Simon Brunning
, give it up. For automating Word, COM (with Mark Hammond's excellent Python/COM bridge) is the only way to go. -- Cheers, Simon B. si...@brunningonline.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Doubt on creating threads

2009-01-03 Thread Simon Forman
On Jan 3, 8:39 am, koranth...@gmail.com wrote: > I was going through Python posts and this post caught my > attentionhttp://groups.google.com/group/comp.lang.python/browse_thread/thread/... > > >  You have missed an important point. A well designed application does >  neither create so many threa

Re: Returning a string

2009-01-03 Thread Simon Forman
On Jan 3, 11:20 am, Kless wrote: > On 3 ene, 19:12, "Diez B. Roggisch" wrote: > > > Kless schrieb: > > > > How is possible that I can print a variable, but when I use *return > > > var* it returns an empty string > > > >http://paste.pocoo.org/show/97588/ > > > I don't see anything that indicates

Re: Returning a string

2009-01-06 Thread Simon Brunning
2009/1/3 Kless : > How is possible that I can print a variable, but when I use *return > var* it returns an empty string What makes you think it's returning an empty string? You aren't doing anything with the return value in line 26 of your example. -- Cheers, Simon B. -- http:/

Re: [Python-Dev] compiling python2.5 on linux under wine

2009-01-08 Thread Simon Cross
to being able to compile Python software for Windows under Wine (using for example, py2exe) it would make my life a lot easier. Schiavo Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to spawn process on back end computer

2008-10-16 Thread Simon Brunning
k is the best way to do this? I have a few ideas but I'm sure > there is a "best" way to go about this. http://edit.kamaelia.org/ might be qworth a look. -- Cheers, Simon B. [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

do export statement in Python script

2008-10-22 Thread Simon Strobl
/data/") import nltk This doesn't work, although running "export NLTK_DATA=/opt/nltk/data/" on the command line before running the program works. Why? Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: do export statement in Python script

2008-10-22 Thread Simon Strobl
On 22 Okt., 13:24, "James Mills" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 22, 2008 at 9:19 PM, Simon Strobl <[EMAIL PROTECTED]> wrote: > > #!/usr/bin/ > > python > > > import os > > > os.system("export NLTK_DATA=/opt/nltk/data/") >

Re: Extracting name strings from assigned objects

2008-10-28 Thread Simon Brunning
2008/10/28 Shannon Mayne <[EMAIL PROTECTED]>: > I would like to ask how one might obtain the assigned name of an > assigned object as a string. That's in the FAQ: <http://tinyurl.com/3xkeac>. -- Cheers, Simon B. [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

import foo vs. python -m foo

2008-10-28 Thread Simon Bierbaum
in the second version but succeeds in the first. Thanks, Simon -- http://mail.python.org/mailman/listinfo/python-list

Syntax error when importing a file which starts with a number

2009-03-23 Thread simon . woolf
e "", line 1 import 1foo ^ SyntaxError: invalid syntax Is this just me, or has anyone else run into it? Is it a known bug? (If so, I can't find it on a bug tracker or in any Google searches). It's a bit annoying, as I have an enforced naming scheme. Any way r

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread simon . woolf
Forgot to mention: I'm on Python 2.5.2, on Ubuntu 8.10. Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread simon . woolf
Many thanks to all for explanations. I'm going to take everyone's advice and ignore the naming scheme (especially as, on rereading, the naming scheme is apparently only mandatory if you're using C or Maple, for some reason). Thanks again. Simon (For those interested: > Do

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread simon . woolf
ddition to the electronic submission) has to contain printed listings of all your programs. Thanks again. Simon -- http://mail.python.org/mailman/listinfo/python-list

Converting a PIL image object to a buffer

2009-04-01 Thread Simon Hibbs
dData(win32clipboard.CF_BITMAP, img) It fails, telling be that "The object must support the buffer interface". How can I convert a PIL image into a buffer object? I can't find any clues. Help appreciated, Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a PIL image object to a buffer

2009-04-01 Thread Simon Hibbs
On 1 Apr, 21:43, Gary Herron wrote: > Simon Hibbs wrote: > > I'm trying to dump a snapshot of my application window to the > > clipboard. I can use ImageGrab in PIL to get the screen data into a > > PIL image object, which i have converted to a bitmap using ImageWin,

Re: Converting a PIL image object to a buffer

2009-04-02 Thread Simon Hibbs
On 2 Apr, 08:28, "Diez B. Roggisch" wrote: > Simon Hibbs schrieb: > > > > > On 1 Apr, 21:43, Gary Herron wrote: > >> Simon Hibbs wrote: > >>> I'm trying to dump a snapshot of my application window to the > >>> clipboard. I can

Problem with COM and variants

2009-04-21 Thread Simon Carter
he COM browser, but don't appear in the generated interface file. - I'm running 32bit python 2.6 and pywin32 build 213, on Vista 64. Any help much appreciated. Thanks! Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with COM and variants

2009-04-21 Thread Simon Carter
Doh! Ta. Simon "John Machin" wrote in message news:023fcc82-6e98-4ddd-9977-06d95ab44...@c18g2000prh.googlegroups.com... On Apr 21, 7:37 pm, "Simon Carter" wrote: Hullo! I'm having a problem interfacing with a proprietary COM library on Windows, and I was hoping s

Re: Return value usage

2009-04-29 Thread Simon Brunning
se 1. The api is already widely used and 2. I would > like to keep the complexity of the api to a bare minimum. Why not return a proxy, and have the proxy do the retrieval of the needed data if it's used? Delegation is ridiculously easy in Python. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

regular expression, unicode

2009-04-29 Thread Simon Strobl
f._decoder.decode(input_chunk, eof)) File "/usr/lib64/python3.0/codecs.py", line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: invalid data Simon -- http://mail.python.org/mailman/listinfo/python-list

regular expression, unicode

2009-04-29 Thread Simon Strobl
f._decoder.decode(input_chunk, eof)) File "/usr/lib64/python3.0/codecs.py", line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-3: invalid data Simon -- http://mail.python.org/mailman/listinfo/python-list

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