Re: regular expression, unicode

2009-04-30 Thread Simon Strobl
Thanks for your hints. Usually, all my files are utf-8. Obviously, I somehow managed to inadvertently switch the encoding when creating this specific file. I have no idea how this could happen. Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: using zip() and dictionaries

2009-04-30 Thread Simon Forman
On Apr 30, 2:00 pm, Sneaky Wombat wrote: > quick update, > > #change this line: > for (k,v) in zip(header,[[]]*len(header)): > #to this line: > for (k,v) in zip(header,[[],[],[],[]]): > > and it works as expected.  Something about the [[]]*len(header) is > causing the weird behavior.  I'm probably

Re: don't understand namespaces...

2009-04-30 Thread Simon Forman
this is what you might want to do: class App(Frame): def setWidget(self, widget): self.widget = widget root = Tk() app = App(root) win2 = Toplevel(root) app2 = App2(win2) app.setWidget(app2.some_name) root.mainloop() Then code in App can use self.widget to access the widget. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping comments

2009-05-11 Thread Simon Brunning
hings just work then. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Simon Forman
is script on your system. (FYI there's also a crlf.py script in the same directory too.) HTH ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: pushback iterator

2009-05-22 Thread Simon Forman
item def pushback(self, item): if self.has_last: raise Exception("I'm full!") self.last = item self.has_last = True As for putting something like this in the standard library, I'm not sure. I've never needed one before and it's easy enough to write. *shrug* Regards, ~Simon [1] http://www.dabeaz.com/generators/Generators.pdf -- http://mail.python.org/mailman/listinfo/python-list

select.poll returning strange file descriptors.

2009-05-24 Thread Simon Wittber
I'm using the poll object from select.poll to check for events on sockets. It seems to work, however when I call .poll() on the poll objects, I sometimes get a fileno 1 returned, which is strange, because none of the sockets I registered with the poll object have a fileno of 1. In fact, the socket

Re: select.poll returning strange file descriptors.

2009-05-25 Thread Simon Wittber
Solved. I was using poll.register(fileno) without any flags specfied, which means "tell me when _anything_ happens". Because of this, I was receiving OOB data, which seems to use strange fileno values. to fix this, I now use this: poll.register(sock.fileno(), select.POLLIN|select.POLLOUT| selec

Re: Misuse of list comprehensions?

2008-05-20 Thread Simon Forman
ot > necessarily keep the unique characters in the order they are seen. > We'll have to check with the OP to see if this is important (I just > assumed that it was because of the use of list comps). > > -- Paul If order is important, you can use sorted() instead of list() like

Re: feature proposal, debug on exception

2008-05-20 Thread Simon Forman
On May 20, 5:59 pm, Paul Rubin wrote: > There's an occasional question here about how to get python to launch > pdb on encountering an uncaught exception. The answer is to look in > some ASPN recipe and do some weird magic. I guess that works, but > it's another thing t

Re: Misuse of list comprehensions?

2008-05-21 Thread Simon Forman
On May 21, 4:36 am, Bruno Desthuilliers wrote: > Simon Forman a écrit : > > > > > On May 20, 8:58 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > >> On May 20, 10:50 am, [EMAIL PROTECTED] wrote: > > >>> You don't need all those conditionals.

Re: Books for learning how to write "big" programs

2008-05-23 Thread Simon Brunning
re in particular is a bit of a classic. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple and safe evaluator

2008-06-11 Thread Simon Forman
y to extend. http://effbot.org/zone/simple-iterator-parser.htm Just make it recognize the operator tokens you're interested in and if a string parsers w/o errors then you know it's safe to eval(). I probably won't get to writing this myself for a few days or a week, but if you

Re: e-value

2008-06-12 Thread Simon Brunning
On Fri, Jun 13, 2008 at 7:45 AM, Beema shafreen <[EMAIL PROTECTED]> wrote: > ... gi, seq, e_value = line.strip().split('\t') At this point, e_value contains a string value. You'll need to convert it to a float before you can meaningfully compare it. -- Cheers, S

Re: python script for tortoise cvs

2008-06-19 Thread Simon Brunning
e to look for the info.so any help will be > appreciated. I don't know if Tortoise is scriptable, but Subversion certainly is - <http://pysvn.tigris.org/> - and nothing you mention is Tortoise specific. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/bl

Re: Simple and safe evaluator

2008-06-19 Thread Simon Forman
On Jun 16, 8:32 pm, bvdp <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Jun 17, 8:02 am, bvdp <[EMAIL PROTECTED]> wrote: > > >> Thanks. That was easy :) > > >>> The change to the _ast version is left as an exercise to the reader ;) > >> And I have absolutely no idea on how to do this.

Re: Tkinter canvas drag/drop obstacle

2008-06-22 Thread Simon Forman
On Jun 22, 7:41 pm, Peter Pearson <[EMAIL PROTECTED]> wrote: > On Fri, 20 Jun 2008 13:41:35 -0300, Guilherme Polo <[EMAIL PROTECTED]> wrote: > > On Fri, Jun 20, 2008 at 1:11 PM, Peter Pearson <[EMAIL PROTECTED]> wrote: > >> Tkinter makes it very easy to drag jpeg images around on a > >> canvas, but

Re: urllib tutorial or manual

2008-06-26 Thread Simon Brunning
you would submit a search term into the search field on a site, such as > google. This is for urllib2: <http://www.voidspace.org.uk/python/articles/urllib2.shtml> If you must stick with urllib: <http://effbot.org/librarybook/urllib.htm> -- Cheers, Simon B. [EMAIL PROTECTED] http://

Re: Recursive wildcard file search

2008-07-06 Thread Simon Brunning
under Pythion 3K, though: <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/499305> -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns -- http://mail.python.org/mailman/listinfo/python-list

handling unexpected exceptions in pdb

2008-07-10 Thread Simon Bierbaum
b) sys.last_traceback *** AttributeError: 'module' object has no attribute 'last_traceback' Thanks, Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: handling unexpected exceptions in pdb

2008-07-10 Thread Simon Bierbaum
Am 10.07.2008 um 20:52 schrieb R. Bernstein: Simon Bierbaum <[EMAIL PROTECTED]> writes: Hi all, I'm in an interactive session in pdb, debugging my code using pdb.runcall. Somewhere, an exception is raised and lands uncaught on stdout. Is there any way of picking up this excep

Re: Strange problem ....

2008-07-23 Thread Simon Brunning
#x27;ll need this line in any module using them: from __future__ import generators As of Python 2.3, this is no longer necessary, and I'd imagine that whatever you are running was targeted at a post 2.2 release. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTa

Re: Is it allowed to use function results as default arguments ?

2008-07-28 Thread Simon Forman
On Jul 28, 1:28 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I've a perfect working procedure, > at least as far I've tested it it works perfect. > > But I was just experimenting with inspect, > and saw that the default argument was not parsed correctly. > > So I wonder if this is allow

Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Simon Willison
I'm having a horrible time trying to get xml.dom.pulldom to consume a UTF8 encoded XML file. Here's what I've tried so far: >>> xml_utf8 = """ Simon\xe2\x80\x99s XML nightmare """ >>> from xml.dom import pulldom >>> p

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Simon Willison
Follow up question: what's the best way of incrementally consuming XML in Python that's character encoding aware? I have a very large file to consume but I'd rather not have to fall back to the raw SAX API. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Simon Willison
2008, 21:48:13) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin I just tried it out on Python 2.4.2 on an Ubuntu machine and it worked fine! I guess this must be an OS X Python bug. How absolutely infuriating. Thanks, Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Simon Willison
On Jul 30, 4:59 pm, Simon Willison <[EMAIL PROTECTED]> wrote: > I just tried it out on Python 2.4.2 on an Ubuntu machine and it worked > fine! I guess this must be an OS X Python bug. How absolutely > infuriating. Some very useful people in #python on Freenode pointed out tha

very large dictionary

2008-08-01 Thread Simon Strobl
Hello, I tried to load a 6.8G large dictionary on a server that has 128G of memory. I got a memory error. I used Python 2.5.2. How can I load my data? SImon -- http://mail.python.org/mailman/listinfo/python-list

Re: very large dictionary

2008-08-01 Thread Simon Strobl
> What does "load a dictionary" mean? I had a file bigrams.py with a content like below: bigrams = { ", djy" : 75 , ", djz" : 57 , ", djzoom" : 165 , ", dk" : 28893 , ", dk.au" : 854 , ", dk.b." : 3668 , ... } In another file I said: from bigrams import bigrams > How about using a database in

Re: Project Question

2008-08-03 Thread Simon Brunning
would have > methods to do this kind of stuff? Take a look at Mechanize: <http://wwwsearch.sourceforge.net/mechanize/>. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns -- http://mail.python.org/mailman/listinfo/python-list

Re: very large dictionary

2008-08-04 Thread Simon Strobl
a python file that contained the dictionary. The size of this file was 6.8GB. I thought it would be practical not to create the dictionary from a text file each time I needed it. I.e. I thought loading the .pyc-file should be faster. Yet, Python failed to create a .pyc-file Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: very large dictionary

2008-08-05 Thread Simon Strobl
> Have you considered that the operating system imposes per-process limits > on memory usage? You say that your server has 128 GB of memory, but that > doesn't mean the OS will make anything like that available. According to our system administrator, I can use all of the 128G. > > I thought it wo

Create 2D character matrix

2008-08-07 Thread Simon Parker
Hello.   I want to be able to create a 2D character matrix, ThisMatrix, like :     a A b B c C d D   and to be able to pick out elements, or rows or columns.   I have become used to programming in R where I can easily refer to a row as :   ThisMatrix [1,]   and a column as   ThisMa

From Ruby to Python?

2008-08-13 Thread Simon Mullis
Hi All, I just finally found 30 minutes to try and write some code in Python and realized after a couple of minor syntactic false starts that I'd finished my initial attempt without needing to refer to any documention... And after the first few minutes I stopped noticing the whitespace thing that

Re: Regarding Telnet library in python

2008-08-13 Thread Simon Mullis
Hi there, This works (but bear in mind I'm about only 30 minutes into my Python adventure...): -- def connect(host): tn = telnetlib.Telnet(host) return tn def login(session,user,password): session.write("\n") session.read_until("Login: ") sessi

Re: gasp

2008-08-13 Thread Simon Brunning
2008/8/13 kumwaka <[EMAIL PROTECTED]>: > I am a beginner in Python. Please tell me how to go about in > downloading and installing the module gasp.I am using Python 2.5.2. Does this work? easy_install gasp -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon

Re: gasp

2008-08-13 Thread Simon Brunning
o go on. And please keep the conversation on-list. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns -- http://mail.python.org/mailman/listinfo/python-list

Re: From Ruby to Python?

2008-08-14 Thread Simon Mullis
In case anyone else has the same question: This has been very useful: http://www.poromenos.org/tutorials/python Short, concise. Enough to get me going. SM 2008/8/13 Simon Mullis <[EMAIL PROTECTED]> > Hi All, > > I just finally found 30 minutes to try and write some cod

Re: Learning curve for new database program with Python?

2008-04-07 Thread Simon Brunning
e single most transferable skill in IT.. No matter what language and platform you find yourself working on, you'll find an SQL driven relational database somewhere in the mix. Learning SQL isn't a waste of time, I guarantee it. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningo

Re: Looking for Conferences/Events on Django, Python, MySQL, etc in Europe 2008?

2008-04-08 Thread Simon Brunning
gt; Do you have any suggestions? PyCon UK 2008 - 12th to 14th September 2008 - <http://www.pyconuk.org/>. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning curve for new database program with Python?

2008-04-08 Thread Simon Brunning
;t have to understand what's going on underneath. When you need to hand craft a performance critical query, or when you are chasing down a bug, you need to know SQL, and know it well. C.F. The Law of Leaky Abstractions - http://tinyurl.com/bmvn. It's not either SQL or ORM. It's b

python-gammu for Python 2.4 on Windows

2008-04-15 Thread Simon Kagwi
Hi everyone, I am looking for binaries (.exe) of python-gammu (any version) for Python 2.4. What I'm getting from the download website is only for Python 2.5. Does anyone know where I can get what I'm looking for? Google isn't really helping :-C

problem with dictionaries

2008-04-23 Thread Simon Strobl
different from the value that key has in the file 'my_frqlist.txt'. I am using Python 2.5.1 Any hints? Simon #!/usr/bin/python import sys frqlist = open('my_frqlist.txt', 'r') # my_frqlist looks like this:

Re: problem with dictionaries

2008-04-23 Thread Simon Strobl
too fast between too many and too seldom saved emacs buffers. Thanks to all for your hints. Simon -- http://mail.python.org/mailman/listinfo/python-list

How to convert unicode string to unsigned char *

2008-05-05 Thread Simon Posnjak
m working on Windows] Regards Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert unicode string to unsigned char *

2008-05-05 Thread Simon Posnjak
On Mon, May 5, 2008 at 4:16 PM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > On Mon, 5 May 2008 16:05:08 +0200, Simon Posnjak <[EMAIL PROTECTED]> wrote: > > > On Mon, May 5, 2008 at 3:48 PM, Jean-Paul Calderone <[EMAIL PROTECTED]> > wrote: > > >

Writing elapsed time as a string

2008-05-05 Thread Simon Pickles
time elapsed between accesses of certain data. These are in seconds since the epoch, as produced by time.time() It is probable right in front of me in the docs but I am spinning off into outer space (mentally!) Thanks for the temporary loan of your clarity and experience. Simon --

Writing elapsed time as a string

2008-05-05 Thread Simon Pickles
time elapsed between accesses of certain data. These are in seconds since the epoch, as produced by time.time() It is probable right in front of me in the docs but I am spinning off into outer space (mentally!) Thanks for the temporary loan of your clarity and experience. Simon --

Re: Bizarre method keyword-arg bug.

2008-08-18 Thread Simon Brunning
2008/8/18 Jasper <[EMAIL PROTECTED]>: > I'm stumped. I'm calling a method that has keyword args, but not > setting them, and yet one of them starts off with data?! <http://www.python.org/doc/faq/general/#why-are-default-values-shared-between-objects> -- Cheers, Sim

Re: How to use win32com to convert a MS WORD doc to HTML ?

2008-08-19 Thread Simon Brunning
s should be a useful starting point: <http://code.activestate.com/recipes/279003/>. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns -- http://mail.python.org/mailman/listinfo/python-list

Re: Python String Immutability Broken!

2008-08-25 Thread Simon Brunning
l.com/5hcnwl>. You can use it to crash the OS, too. My advice - don't. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop inside an xml template

2008-08-25 Thread Simon Brunning
2008/8/25 Amie <[EMAIL PROTECTED]>: > Hi, > > Is it possible to have a for loop within an xml template? Python has a whole bunch of template libraries. Which are you using? -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MS

Equivalents of Ruby's "!" methods?

2008-08-25 Thread Simon Mullis
I ask is that I have some fairly complex data-structures and this would make my code alot cleaner... If this is not an accepted and pythonic way of doing things then please let me know... and I'll stop! Thanks in advance SM -- Simon Mullis _ [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Equivalents of Ruby's "!" methods?

2008-08-25 Thread Simon Mullis
Normally I would use a Ruby symbol as a hash key: h = { :key1 => "val1", :key2 => "val2" } >From the stdlib docs: "The same Symbol object will be created for a given name or string for the duration of a program's execution, regardless of the context or meaning of that name. Thus if Fred is a constant in one context, a method in another, and a class in a third, the Symbol :Fred will be the same object in all three contexts. " There is no equivalent in Python (as far as I know, and I'm only in my second week of Python so I'm more than likely incorrect!). If you're interested: http://www.randomhacks.net/articles/2007/01/20/13-ways-of-looking-at-a-ruby-symbol Thanks again for the pointers. -- Simon Mullis _ [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to manipulate list of dictionary

2008-08-26 Thread Simon Brunning
t;Insulator","Po #":"AE0013","qty":190}] > > How to manipulate the table? > > I need to search for the Po #, and display the result as below. > > > Part # : Mouse > Po # : AE00207 > Qty: 120 pcs Well, that's a really bad data

Re: Python and database unittests

2008-08-27 Thread Simon Brunning
#x27;s a number of mocking modules for Python - my current favorite is Mox. See <http://tinyurl.com/57hzr4>. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and database unittests

2008-08-27 Thread Simon Brunning
as well as unit tests, but the unit tests ought to isolate the code under test, so stubbing out external dependencies is the norm. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter:

Re: finding out the number of rows in a CSV file

2008-08-27 Thread Simon Brunning
2008/8/27 SimonPalmer <[EMAIL PROTECTED]>: > anyone know how I would find out how many rows are in a csv file? > > I can't find a method which does this on csv.reader. len(list(csv.reader(open('my.csv' -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunning

Re: finding out the number of rows in a CSV file

2008-08-27 Thread Simon Brunning
2008/8/27 Jon Clements <[EMAIL PROTECTED]>: >> len(list(csv.reader(open('my.csv' > Not the best of ideas if the row size or number of rows is large! > Manufacture a list, then discard to get its length -- ouch! I do try to avoid premature optimization. ;-)

Re: Getting references to obect instances into a list

2008-08-27 Thread Simon Brunning
ucture and need to use the same elsewhere. A list only *ever* contains references to objects, so there's nothing special to do. I do strongly recommend this article: <http://effbot.org/zone/python-objects.htm>. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting references to obect instances into a list

2008-08-27 Thread Simon Brunning
come q is not updated after I deleted p? You deleted the *name* "p". The object that it was referring too, the list, still has a live reference - it's an element of q - so it sticks around. It'll only go away once the last reference to it goes. Please, read the article. ;-) -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Coming from .NET and VB and C

2008-09-03 Thread Simon Brunning
2008/9/3 ToPostMustJoinGroup22 <[EMAIL PROTECTED]>: > Any suggestions for someone new to the scene like me? Welcome! There's a number of resources that you might find useful here: http://wiki.python.org/moin/BeginnersGuide -- Cheers, Simon B. -- http://mail.python.org/mailman/l

Re: Coming from .NET and VB and C

2008-09-04 Thread Simon Brunning
>> Into Python" which I will be reading shortly. >> >So one question: what RDBMs are supported in that space? ... and the Google's BigTable (see <http://en.wikipedia.org/wiki/BigTable>) is one of them. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: handling uncaught exceptions with pdb?

2008-09-12 Thread Simon Brunning
2008/9/10 Paul Rubin <"http://phr.cx"@nospam.invalid>: > I think I've asked about this before, but is there a way to set up > Python to handle uncaught exceptions with pdb? http://code.activestate.com/recipes/65287/ -- Cheers, Simon B. [EMAIL PROTECTED] http://www.br

Python OOP advice

2008-09-17 Thread Simon Hibbs
there a way to cleanly implement a parent-child relationship between objects that gives child objects limited access to members of the parent? Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: recursive using the os.walk(path) from the os module

2008-09-17 Thread Simon Brunning
> module, I need some ideal how the algorithm should look like, maybe > recursive ..any deal? This help? http://code.activestate.com/recipes/499305/ -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalue

Re: Python OOP advice

2008-09-17 Thread Simon Hibbs
Great contributions, thanks both of you. I'm self-tought when it comes to Python and OOP and I haven't yet grown an intuitive feel for how to do things sensibly. Simon -- http://mail.python.org/mailman/listinfo/python-list

dict generator question

2008-09-18 Thread Simon Mullis
unt", as I cannot do x += 1 or x++ as x may or may not yet exist, and I haven't found a way to create default values. I'm most probably not thinking pythonically enough... (I know I could do this pretty easily with a couple more lines, but I'd like to understand if there's a way to use a dict generator for this). Thanks in advance SM -- Simon Mullis -- http://mail.python.org/mailman/listinfo/python-list

Re: dict generator question

2008-09-18 Thread Simon Mullis
Haha! Thanks for all of the suggestions... (I love this list!) SM 2008/9/18 <[EMAIL PROTECTED]>: > On Sep 18, 10:54 am, "Simon Mullis" <[EMAIL PROTECTED]> wrote: >> Hi, >> >> Let's say I have an arbitrary list of minor software versions of an >

Re: How to make a reverse for loop in python?

2008-09-20 Thread Simon Brunning
2008/9/20 Alex Snast <[EMAIL PROTECTED]>: > I'm new to python and i can't figure out how to write a reverse for > loop in python > > e.g. the python equivalent to the c++ loop > > for (i = 10; i >= 0; --i) for i in range(10, 0, -1): print i -- Cheer

Re: Inheritance but only partly?

2008-10-03 Thread Simon Brunning
X, and *can't* be used anywhere an X can. See <http://en.wikipedia.org/wiki/Liskov_substitution_principle>. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns | Facebook:

Caching in memory for Apache

2006-03-24 Thread Simon Johnson
for me to store values inside memory so I can look it up on the next GET request? Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: COM object pointer cast

2006-03-27 Thread Simon Brunning
get what I want? There's an easy way - use win32com.client.CastTo(). See the convert_tracks.py script on this page - <http://www.brunningonline.net/simon/blog/archives/001742.html> for an example. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Service SOAP - Unknown element v1

2006-04-11 Thread Simon Brunning
DVD(title="Fight Club") I've guessed at 'title' for the keyword here, 'cos I can't see your WSDL to find out what the real one is. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Service SOAP - Unknown element v1

2006-04-11 Thread Simon Brunning
#x27;m using SOAPpy to talk to an Axis SOAP service (also Java), and it works fine, so if you are using keywords, I doubt the problem is on the Python side. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Service SOAP - Unknown element v1

2006-04-11 Thread Simon Brunning
velope/"; > xmlns:xsd="http://www.w3.org/1999/XMLSchema"; > > > > > BENHUR > > > > Clearly it isn't. Your Python snippet uses the keyword "title", whereas the outgoing SOAP message uses "titulo". What does the WSDL say i

Re: Best Python web-hosting?

2006-04-11 Thread Simon Brunning
7;ll be getting your support (should you need any) from someone who knows Python, and knows what he's talking about. And the control panel has to be seen to be believed. Setting up new Django, TurboGears or Zope applications is a point and click operation, taking seconds. -- Cheers,

Re: reading from a text file

2009-11-30 Thread Simon Brunning
2009/11/27 baboucarr sanneh : > hi all > > i would like to create a python program that would read from a text file and > returns one result at random. This might be of use: http://code.activestate.com/recipes/426332/#c2 -- Cheers, Simon B. -- http://mail.python.org/mailman/lis

Re: can python do this?

2009-12-02 Thread Simon Brunning
see <http://appscript.sourceforge.net/py-appscript/index.html>. And, naturally, very much more. I have some driving iTunes examples I'd be happy to send you off-list if you're interested. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: pbs scripts

2009-12-02 Thread Simon Brunning
lose this file Do you actually need to open the file, or just run a command on it? Sounds like the latter to me. >       move on to next file. Give it a go. Any problems, I'm sure we'd be happy to help. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: postgresql_autodoc in Python?

2009-12-07 Thread Simon Brunning
2009/12/6 Wolfgang Keller : > Hello, > > has anyone ever implemented something similar to postgresql_autodoc in Python? Dunno - what is it? -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is my namespace?

2009-12-07 Thread Simon Brunning
says: The from statement is really an assignment to names in > the importer's scope--a name-copy operation, not a name aliasing.   I > don't fully understand what he means. Could anybody explain? Does the above help? -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is my namespace?

2009-12-07 Thread Simon Brunning
2009/12/7 Steven D'Aprano : > On Mon, 07 Dec 2009 16:25:39 +0000, Simon Brunning wrote: >> If you do "from blah import" the imported module itself isn't bound to >> any name in the importing module - you can't get at it at all. > > Not quite -- you c

Re: OS independent way to check if a python app is running?

2009-12-14 Thread Simon Brunning
2009/12/14 : > Is there an os independent way to check if a python app is running? if True: print "I'm running." ;-) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

web development in python 2.6 and 3.0

2009-12-21 Thread Simon Moses
postgresql) for web development thanks and regards, Simon Moses. The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/-- http://mail.python.org/mailman/listinfo/python-list

Re: web development in python 2.6 and 3.0

2009-12-21 Thread Simon Moses
to code a web page which connects to a database and displays some rows, what minimum software and libraries i should install? python 2.6, mysql 5.0, apache 2.2 and Django? thats enough? From: Stephen Hansen To: Simon Moses Cc: python-list@python.org Sent

Re: web development in python 2.6 and 3.0

2009-12-21 Thread Simon Moses
so python 2.6, mysql 5.0, apache 2.2, mod_wsgi, MySQL-python-1.2.2.win32-py2.6 and Django should be sufficient for my requirement. The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/-- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with win32ui

2009-12-23 Thread Simon Hibbs
32ui.pyc", line 10, in __load > ImportError: DLL load failed: This application has failed to start > because the a > pplication configuration is incorrect. Reinstalling the application may > fix this >   problem. > > Dependencie walker does not find any major issues. what am i missing here. > > thank you in advance for your help. You could try and find out what the __load statement in line 10 in win32ui.py does. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl to Python conversion

2009-12-28 Thread Simon Brunning
2009/12/25 Aahz : > > I'd write an imperial to metric converter in Python  ;-) Should be possible to use unum (<http://bit.ly/4X0PwR>) to do the conversions. The SI units are already defined - adding in any necessary imperial units should be easy enough. -- Cheers,

Re:

2009-12-28 Thread Simon Brunning
reason it's not available (Anti-virus software? That quarantine directory name is very suspicious.) There's not really enough to go on to say more at the moment. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Absolute beginner

2009-12-30 Thread Simon Brunning
lly - Python 3 is the first non-trivially backward incompatible version for a very long time - at least a decade and a half. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: pywinauto to show the dialog , menu, etc

2010-01-01 Thread Simon Brunning
inspector might be worth a try: http://www.windows-spy.com/ -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting access to the process table from python?

2010-01-14 Thread Simon Brunning
unning, and owner. > > Has anybody written a module to do this?  I know I can run ps and > parse the output, or troll /proc directly, but if somebody's already > written all that, I'd rather not reinvent the wheel. <http://www.psychofx.com/psi/> -- Cheers, Simon B. -- h

Re: Author of a Python Success Story Needs a Job!

2010-01-15 Thread Simon Brunning
l productivity, in my experience. The programmer-to-code step is only one of many parts of the process. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a list compression in Python?

2010-01-18 Thread Simon Brunning
ping_lists.html>. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: use of super

2010-01-19 Thread Simon Brunning
why Entry and self are passed as arguments to super > ().Can someone please explain? Does <http://docs.python.org/library/functions.html#super> make anything clearer? -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Create list/dict from string

2010-01-19 Thread Simon Brunning
2010/1/19 Peter Otten <__pete...@web.de>: > Both eval() and json.loads() will do. eval() is dangerous as it allows the > user to run arbitrary python code. Something like <http://code.activestate.com/recipes/364469/> might be worth a look too. -- Cheers, Simon B. -- http

Re: Is python not good enough?

2010-01-25 Thread Simon Brunning
2010/1/25 Albert van der Horst : > If Go was to compete with anything, they would have give it a name > that was Googleable. ;-) If they want it Googleable, it will be. ;-) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: My experiences building a small app on Python

2010-01-26 Thread Simon Brunning
2010/1/26 Cascade3891 : > It's a bit of a read. But insightful. We'll be the judge of that, surely? ;-) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help parsing a page with python

2010-01-27 Thread Simon Brunning
0100125/saber-comer---salsa-verde-judiones-25-01-10/676590.shtml"; > > The video is > http://www.rtve.es/resources/TE_SSAC011/flv/8/2/1264426362028.flv > Could you help me please? That URL doesn't appear to be in the HTML - it must be being brought in by the JavaScript somehow.

<    8   9   10   11   12   13   14   15   16   >