Re: Help parsing a page with python

2010-01-27 Thread Simon Brunning
automating a real browser. WebDriver (<http://bit.ly/crAEPu>) has Python bindings these days. It's primarily intended for functional testing, but it might be a good fit here too. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help parsing a page with python

2010-01-27 Thread Simon Brunning
2010/1/27 mierdatutis mi : > Hello again, > > What test case for Windmill? Can you say me the link, please? http://lmgtfy.com/?q=windmill+test -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Ruby

2010-01-27 Thread Simon Brunning
one language over the other - it's a very minor point. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Most "active" coroutine library project?

2009-09-25 Thread Simon Forman
On Fri, Sep 25, 2009 at 2:07 PM, Jason Tackaberry wrote: > On Fri, 2009-09-25 at 15:42 +, Grant Edwards wrote: >> You can't call a function that yields control back to the other >> coroutine(s).  By jumping through some hoops you can get the >> same effect, but it's not very intuitive and it s

Re: flow control and nested loops

2009-09-25 Thread Simon Forman
On Fri, Sep 25, 2009 at 3:01 PM, kj wrote: > > > In Perl, one can label loops for finer flow control.  For example: > > X: for my $x (@X) { >  Y: for my $y (@Y) { >    for my $z (@Z) { >      next X if test1($x, $y, $z); >      next Y if test2($x, $y, $z); >      frobnicate($x, $y, $z); >    } >  

Re: Business issues regarding adapting Python

2009-09-27 Thread Simon Forman
good people is a (the?) crucial factor in the success of programming endeavors. "Good" programmers, almost by definition, will be able to handle learning python without problems. Just my $0.02, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting changes to a dict

2009-09-27 Thread Simon Forman
[4]: d['cats'] = 'lol' In [5]: check() Out[5]: True In [6]: check() Out[6]: False In [7]: d.clear() In [8]: check() Out[8]: True In [9]: check() --- StopIteration Traceback (most recent call last) /home/sforman/ in () StopIteration: HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Simon Forman
en simpler solution. I don't want the user to define > __pretty__. Is there a tool that can automatically print the content > of an object without defining such a member function like __pretty__. > > Regards, > Peng Have you examined the pprint module? http://docs.python.org/library/pprint.html The repr module might also be of interest: http://docs.python.org/library/repr.html HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Multidimensional arrays/lists

2009-09-27 Thread Simon Forman
On Sun, Sep 27, 2009 at 12:40 PM, Someone Something wrote: > I'm trying to write a little tic-tac-toe program I need a array/list such > that I can represent the tic tac toe board with an x axis and y axis and i > can access each square to find out whether there is an X or an O. I have > absolutel

Re: Multidimensional arrays/lists

2009-09-28 Thread Simon Forman
On Mon, Sep 28, 2009 at 3:27 PM, Ethan Furman wrote: > Simon Forman wrote: >> >> On Sun, Sep 27, 2009 at 12:40 PM, Someone Something >> wrote: >> >>> I'm trying to write a little tic-tac-toe program I need a array/list such >>> that I can represe

Re: Repeated output when logging exceptions

2009-09-28 Thread Simon Forman
On Mon, Sep 28, 2009 at 4:38 PM, John Gordon wrote: > In <6bce12c3-f2d9-450c-89ee-afa4f21d5...@h30g2000vbr.googlegroups.com> Vinay > Sajip writes: > >> The logging package allows you to add tracebacks to your logs by using >> the exception() method, which logs an ERROR with a traceback and is >>

Re: Split string but ignore quotes

2009-09-29 Thread Simon Forman
On Tue, Sep 29, 2009 at 11:11 AM, Scooter wrote: > I'm attempting to reformat an apache log file that was written with a > custom output format. I'm attempting to get it to w3c format using a > python script. The problem I'm having is the field-to-field matching. > In my python code I'm using spli

Re: How different are a generator's send and next methods

2009-10-01 Thread Simon Forman
On Wed, Sep 30, 2009 at 4:24 PM, Andrey Fedorov wrote: > As far as I can tell, a generator's .next() is equivalent to .send(None). Is > this true? They are equivalent AFAIK. > If so, [why] aren't they unified in a method with a single argument which > defaults > to None? > - Andrey next() pred

Re: iterate over list while changing it

2009-10-01 Thread Simon Forman
On Wed, Sep 30, 2009 at 11:19 PM, Daniel Stutzbach wrote: > On Thu, Sep 24, 2009 at 3:32 PM, Torsten Mohr wrote: >> >> a = [1, 2, 3, 4, 5, 6] >> >> for i, x in enumerate(a): >>    if x == 3: >>        a.pop(i) >>        continue >> >>    if x == 4: >>        a.push(88) >> >>    print "i", i, "x",

Re: hii

2009-10-01 Thread Simon Forman
On Thu, Oct 1, 2009 at 7:55 AM, padmapriya sekaran wrote: > I have a problem in using interp from numpy for which i need 3 array. > my first array is > x = scipy.linspace(0.009,0.53,100) > > and the other two array should be read from my file with 100x2 dimension > (file1_lines) but it is read as

Re: emptying a list

2009-10-01 Thread Simon Forman
On Thu, Oct 1, 2009 at 11:30 AM, lallous wrote: > Hello > > What is faster when clearing a list? > > del L[:] > > or > > L = [] > > -- > Elias > -- > http://mail.python.org/mailman/listinfo/python-list > The first form actually clears the list, the second for just re-binds the name 'L' to a new,

Re: New Python Novice

2009-10-02 Thread Simon Brunning
becoming a python guru..Am a > novice so i would welcome any suggestions etc.. You might want to start with <http://wiki.python.org/moin/BeginnersGuide>. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python struct issue

2009-10-02 Thread Simon Forman
t see what it > is! > > Here's the original code: > http://onlamp.com/python/2001/01/31/graphics/pysono.py > > Thanks! In: struct.unpack("%dB" % (fft_length), tempb) tempb is not length 256. Also, note that (foo) is the same as just foo. To create a tuple of length 1 you must say (foo,) HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python struct issue

2009-10-02 Thread Simon Forman
On Fri, Oct 2, 2009 at 12:35 PM, Carlo DiCelico wrote: > On Oct 2, 12:15 pm, Simon Forman wrote: >> On Fri, Oct 2, 2009 at 12:07 PM, Carlo DiCelico >> wrote: >> > I saw an article on O'Reilly about using NumPy and Dislin to analyze >> > and visualize WAV

Re: Opinions, please, on PEP 8 and local, 3rd party imports

2009-10-02 Thread Simon Forman
On Fri, Oct 2, 2009 at 3:50 PM, Philip Semanchuk wrote: > Hi all, > Our project uses some libraries that were written by 3rd parties (i.e. not > us). These libraries fit into a single Python file and live in our source > tree alongside other modules we've written. When our app is distributed, > th

Re: creating class objects inside methods

2009-10-03 Thread Simon Forman
On Sat, Oct 3, 2009 at 11:32 PM, horos11 wrote: > All, > > I've got a strange one.. > > I'm trying to create a class object inside another class object by > using the code template below (note.. this isn't the exact code.. I'm > having difficulty reproducing it without posting the whole thing) > >

Re: defaults for function arguments bound only once(??)

2009-10-04 Thread Simon Forman
On Sun, Oct 4, 2009 at 2:29 AM, horos11 wrote: > All, > > Another one, this time a bit shorter. > > It looks like defaults for arguments are only bound once, and every > subsequent call reuses the first reference created. Hence the > following will print '[10,2]' instead of the expected '[1,2]'. >

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-04 Thread Simon Forman
On Sun, Oct 4, 2009 at 5:29 AM, Martien Verbruggen wrote: > On Sun, 4 Oct 2009 01:17:18 + (UTC), >        Grant Edwards wrote: >> On 2009-10-03, ryniek90 wrote: >> >>> So, whether it is or has been planned the core Python >>> implementation of *scanf()* ? >> >> One of the fist things I remem

Re: creating class objects inside methods

2009-10-04 Thread Simon Forman
what it does differently than other languages. IMHO it's hands-down the most useful. productive language out there for a tremendous number of problem domains. Treat yourself to it. ;] And second, please don't /teach/ python until you've learned it... Regards, ~simon > Run it (a

Re: creating class objects inside methods

2009-10-04 Thread Simon Forman
the problem, and have to backtrack on realizing that what you just typed won't actually tell the language to do what you're thinking. An important measure of good language design is how rapidly the percentage of missteps of this kind falls as you gain experience with the language." I can v

Re: Walking an object/reference graph

2009-10-05 Thread Simon Forman
//mail.python.org/mailman/listinfo/python-list > Look in the pickle module. It has to do this to serialize arbitrary python objects I think. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Simon Forman
On Mon, Oct 5, 2009 at 11:14 PM, Paul Rubin wrote: > Steve Holden writes: >> It seems to me that the biggest sin in databases is a failure to use >> rigorous design techniques. If somebody doesn't understand relational >> theory > > Where does one find out about this

Re: Object Relational Mappers are evil (a meditation)

2009-10-06 Thread Simon Forman
On Tue, Oct 6, 2009 at 2:00 AM, Carl Banks wrote: > On Oct 5, 7:25 am, Aaron Watters wrote: >> This is a bit off topic except that many Python >> programmers seem to be allergic to typing SQL. >> >> RESOLVED:  Using ORMs leads lazy programmers >> to make bad database designs.  It's better to >> c

Re: del an imported Class at EOF... why?

2009-10-08 Thread Simon Forman
On Thu, Oct 8, 2009 at 1:42 AM, Terry Reedy wrote: > Hans Mulder wrote: > >> Errrhm, no.  He is not deleting the PyQt4 module from sys.modules; >> he's only deleting the name QtGui from his own namespace.  Next >> time Python comes across >> >>    from PyQt4 import QtGui >> >> , it finds that the

Re: threading module, call thread.interrupt_main()

2009-10-08 Thread Simon Forman
2009/10/7 找尋自己的一片天 : > Sorry to ask, but i don't know how to solve it. > > I try to call thread.interrupt_main() function in my child thread's run method > which is inherit threading.Thread class. > > But it didn't work, does anyone know why? > > Thanks a lot!! > "it didn't work" i

Re: Cashing in PythonWin name space?... seems unexpected to me

2009-10-08 Thread Simon Forman
ect this to be the > case.  Can someone explain what is happening? > >>>> dir(spam) > [clip..., 'ello', 'insult'] >>>> spam.ello() > Your father smells of elderberrys >>>> spam.insult() > Your father smells of elderberrys/n and your mother was a kiniggit >>>> > > > Thanks for your help. > > Bill Sneddon The reload() function might be what you need: http://docs.python.org/library/functions.html#reload HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Simon Forman
On Thu, Oct 8, 2009 at 12:41 PM, Dr. Phillip M. Feldman wrote: > > I currently have a function that uses a list internally but then returns the > list items as separate return > values as follows: > > if len(result)==1: return result[0] > if len(result)==2: return result[0], result[1] > > (and so

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-08 Thread Simon Brunning
ython an alternative, really great implementation of scanf() ? Write one, post it on Google Code, the Python cookbook or somewhere, and if the world beats a path to your door then we'll talk. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Simon Forman
On Thu, Oct 8, 2009 at 7:14 PM, Dr. Phillip M. Feldman wrote: > > I'm amazed that this works.  I had not realized that > > x,y= [3,4] > > is equivalent to > > x= 3; y= 4 > > Python is rather clever. > > Thanks! > Python is very clever: >>> (a, b), c = (1, 2), 3 >>> a, b, c (1, 2, 3) :D -- http

Re: Persistent Distributed Objects

2009-10-10 Thread Simon Forman
On Fri, Oct 9, 2009 at 1:11 AM, John Haggerty wrote: > I am interested in seeing how it would be possible in python to have > persistent objects (basically be able to save objects midway through a > computation, etc) and do so across multiple computers. > > Something that would allow for memory, d

Re: Why ELIF?

2009-10-11 Thread Simon Forman
Commands: >      Commands[cmd](args) >  else: >      raise SyntaxWarning("Syntax error in above program") > > I'll often do that this way: args = re.split('\s', line) cmd = args.pop(0) def no_cmd(*a, **b): raise SyntaxWarning("Syntax error in above program") Commands.get(cmd, no_cmd)(args) ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Persistent Distributed Objects

2009-10-11 Thread Simon Forman
On Sun, Oct 11, 2009 at 12:46 PM, John Haggerty wrote: > Does pyro work inside of stackless? I have no idea, but you wouldn't need both. Only one or the other. ~Simon > On Sat, Oct 10, 2009 at 9:54 AM, Simon Forman wrote: >> >> On Fri, Oct 9, 2009 at 1:11 AM, John Hag

Re: a=[1,2,3,4].reverse() - why "a" is None?

2009-10-13 Thread Simon Forman
with list objects. Note that string objects do work that way: In [1]: "FOO".lower().replace('o', 'a') Out[1]: 'faa' But this is because string objects are immutable in python, so their methods must return new strings. Bottom line: read the documenta

Re: Iterators

2009-10-16 Thread Simon Forman
On Fri, Oct 16, 2009 at 8:22 AM, Duncan Booth wrote: > Chris Rebert wrote: > >> Essentially, file iterators are dumb and don't keep track of where in >> the file the next line starts, instead relying on their associated >> file object to keep track of the current position in the file; the >> iter

Re: Simple audio

2009-10-20 Thread Simon Forman
On Tue, Oct 20, 2009 at 4:04 PM, Peter Chant wrote: > What are recommendations for simple audio playback?  I want to play back on > linux (Slackware), which uses alsa.  There seem to be many ways - but some > are a couple of years old and won't compile, like pymedia, or seem not > widely used and

Re: python web service or Apache?

2009-10-25 Thread Simon Forman
pythonwebserver.php Both "best" and "better" (that website and you, respectively) omit mention of the criteria used for the evaluation. To determine what is "best" you must first answer "for what?" (Also, it is reasonable to use /both/ apache and pyt

Re: python web service or Apache?

2009-10-26 Thread Simon Forman
On Mon, Oct 26, 2009 at 10:00 AM, Peng Yu wrote: > On Sun, Oct 25, 2009 at 11:09 PM, Simon Forman wrote: >> On Sun, Oct 25, 2009 at 4:47 PM, Peng Yu wrote: >>> Although, python can be used to provide web service. The following >>> webpage also mentioned, "Apac

Re: Python 2.6 Deprecation Warnings with __new__ — Can someone explain why?

2009-10-26 Thread Simon Forman
On Mon, Oct 26, 2009 at 12:04 AM, rh0dium wrote: [snip] > > > Now the real question I have on this is scalability.  The real What you're describing isn't "scalability". It could be called "extensibility". > advantage to using *args and **kwargs is that down the road (through > inheritance/polym

Re: handling PAMIE and lxml

2009-10-26 Thread Simon Forman
On Mon, Oct 26, 2009 at 3:05 AM, elca wrote: > > Hello, > i was open anther new thread ,old thread is too long. Too long for what? > first of all,i really appreciate other many people's help in this newsgroup. > im making webscraper now. > but still problem with my script source. > http://elca.p

Re: how to modify row content of file in python?

2009-10-27 Thread Simon Hibbs
work so no Mac. *sob*). One thing to look out for is that 'columns' is being created each time through the loop, which works fine. If you modified the code to append to it instead, you would need to create it before entering the loop as you can't append to something that doesn'

Re: What IDE has good git and python support?

2009-10-28 Thread Simon Forman
On Tue, Oct 27, 2009 at 11:56 AM, Aweks wrote: > what do you use? I use IDLE for python and Bash for GIT. Regards, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: disutils, project structure & developing - n00b question

2009-10-29 Thread Simon Forman
s' works) Note, although it's not mentioned in the site module docs you can include an absolute path and it will be added to sys.path. There is additional good information about .pth files on Bob Ippolito's blog: http://bob.pythonmac.org/archives/2005/02/06/using-pth-fil

Re: disutils, project structure & developing - n00b question

2009-10-29 Thread Simon Forman
On Thu, Oct 29, 2009 at 3:45 PM, Simon Forman wrote: > In order for "from pymlb import fetcher" no work you must make the s/no/to/ D'oh! -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with SOAPpy and WSDL.

2009-11-02 Thread Simon Brunning
sted.org/suds/>. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with SOAPpy and WSDL.

2009-11-02 Thread Simon Brunning
s not > supplied. >   at WebServicex.country.GetCurrencyByCountry(String CountryName) >   --- End of inner exception stack trace ---: > > > > It is as if it doesn't get the name "Zimbabwe". Try server.GetCurrencyByCountry(name='Zimbabwe') -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: self.__dict__ tricks

2009-11-03 Thread Simon Brunning
2009/11/1 Steven D'Aprano : > > The only stupid question is the one you are afraid to ask. I was once asked, and I quote exactly, "are there any fish in the Atlantic sea?" That's pretty stupid. ;-) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Command parsing... best module to use?

2009-11-03 Thread Simon Hibbs
odule of the week" series of articles. http://www.doughellmann.com/PyMOTW/cmd/index.html Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Calling a method with a variable name

2009-11-04 Thread Simon Mullis
Hi All, I'm collating a bunch of my utility scripts into one, creating a single script to which I will symbolic link multiple times. This way I only have to write code for error checking, output-formatting etc a single time. So, I have ~/bin/foo -> ~/Code/python/mother_of_all_utility_scripts.

Re: Calling a method with a variable name

2009-11-04 Thread Simon Mullis
May I be the first to say "Doh!" Problem solved, many thanks to both Carsten and Diez! SM 2009/11/4 Carsten Haese : > Simon Mullis wrote: >> def main(): >>     stats_obj = Statistic() >>     name = re.sub("[^A-Za-z]", "", sys.argv[0]) >&

Re: regexp help

2009-11-04 Thread Simon Brunning
filter(), and you should be good to go. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp help

2009-11-04 Thread Simon Brunning
2009/11/4 Nadav Chernin : > Thanks, but my question is how to write the regex. re.match(r'.*\.(exe|dll|ocx|py)$', the_file_name) works for me. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp help

2009-11-04 Thread Simon Brunning
2009/11/4 Nadav Chernin : > No, I need all files except exe|dll|ocx|py not re.match(r'.*\.(exe|dll|ocx|py)$', the_file_name) Now that wasn't so hard, was it? ;-) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do you use python?

2009-11-05 Thread Simon Forman
On Sat, Oct 31, 2009 at 2:11 AM, sk wrote: > What would be your answer if this question is asked to you in an > interview? > > a modified version might be: > "Where would you use python over C/C++/Java?" > > (because my resume says I know C/C++/Java)? Mark Miller has some adages posted on his ho

Re: why does "help(import)" not work?

2009-11-06 Thread Simon Brunning
2009/11/6 Robert P. J. Day : > >  i'm sure there's a painfully obvious answer to this, but is there a > reason i can't do: > >>>> help(import) >  File "", line 1 >    help(import) >              ^ > SyntaxError: invalid syntax impor

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Simon Forman
On Mon, Nov 9, 2009 at 12:44 PM, Victor Subervi wrote: > Did you give up on me? > V > Please don't top-post. -- http://mail.python.org/mailman/listinfo/python-list

Re: Choosing GUI Module for Python

2009-11-09 Thread Simon Hibbs
ense (it was free for GPL projects). That's rapidly becoming a non-issue as the core QT framework is now LGPL and Nokia have a project underway to produce PyQT compatible LGPL python bindings under the PySide project. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: NEWB problem with urllib2

2009-11-09 Thread Simon Forman
On Mon, Nov 9, 2009 at 6:29 PM, Penn wrote: > I just installed PyDev into Eclipse using the 'update' method and did > the standard installation.  I allowed it to Auto Configure itself and > ran a "Hello World" module to make sure I was in the ballpark. > > I got an starting module up and have run

Re: Choosing GUI Module for Python

2009-11-10 Thread Simon Hibbs
recomending PyQT to know that there is so much work being put in to make sure it has a great future. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Calendar Stuff

2009-11-10 Thread Simon Forman
On Tue, Nov 10, 2009 at 12:53 PM, Victor Subervi wrote: > Hi; > I have the following code: > > import calendar, datetime > > def cal(): >   ... >   myCal = calendar.Calendar(calendar.SUNDAY) >   today = datetime.date.today() >   day = today.day >   mo = today.month >   yr = today.year > #  month =

Re: QuerySets in Dictionaries

2009-11-12 Thread Simon Brunning
7;] = query1 > d['b'] = query2 > d['c'] = query3 > > Is there a way to do this that I'm missing? Untested: wanted = (('a', 1), ('b', 2), ('c', 2)) d = dict((key, Myobject.objects.filter(status=number)) for (key, number) in wanted) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & Go

2009-11-15 Thread Simon Forman
On Sat, Nov 14, 2009 at 5:10 PM, Terry Reedy wrote: > Paul Rubin wrote: > >> Mark Chu-Carroll has a new post about Go: >> >> >>  http://scienceblogs.com/goodmath/2009/11/the_go_i_forgot_concurrency_an.php > > In a couple of minutes, I wrote his toy prime filter example in Python, > mostly from the

Re: python gui builders

2009-11-17 Thread Simon Hibbs
n and Qt" is very helpful with that. I wouldn't completely dismiss Tkinter. It's too simple for complex GUIs but I still think it has it's place for basic utilities. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Anything equivalent to cassert in C++?

2009-11-17 Thread Simon Forman
debug__ is True under normal circumstances, False when optimization is requested (command line option -O). The current code generator emits no code for an assert statement when optimization is requested at compile time." HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Simon Brunning
> END-IF. RPG/400's SELEC statement: http://bit.ly/2LDegk Thing of beauty. Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Simon Forman
On Wed, Nov 18, 2009 at 4:15 AM, Steve Howell wrote: > On the topic of "switch" statements and even-more-concise-then-we-have- > already if/elif/else/end constructs, I have to say that Python does > occasionally force you to write code like the code below.  Maybe > "force" is too strong a word, bu

Re: python gui builders

2009-11-18 Thread Simon Hibbs
t all others are measured, and generaly found wanting. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: python gui builders

2009-11-18 Thread Simon Hibbs
it. Qt provides them with a platform with the potential to rival the iPhone dev environment. Of course to take full advantage of it you need to invest in learning it all, which is non-trivial. It comes at a cost in time and potential lock-in. But the point is you can't just say

Re: using struct module on a file

2009-11-18 Thread Simon Forman
iling all that, would you consider this a useful addition to the struct > module, i.e. should I write a feature request? > > Thanks! > > Uli You might look at "Construct": http://construct.wikispaces.com/ ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: is there any FIX message handle modules in Python?

2009-11-19 Thread Simon Hibbs
was the first result when I googled > 'python "financial information exchange"'? > > http://www.quickfixengine.org/ There are no prebuilt Python modules available based on quickfix, at least that I'm aware of. It has Python bindings available, but you have to complie it

Re: make two tables having same orders in both column and row names

2009-11-19 Thread Simon Forman
On Wed, Nov 18, 2009 at 3:57 PM, Ping-Hsun Hsieh wrote: > Hi, > > I would like to compare values in two table with same column and row names, > but with different orders in column and row names. > For example, table_A in a file looks like the follows: > AA100   AA109   AA101   AA103   AA102 > BB1

Re: python gui builders

2009-11-20 Thread Simon Hibbs
On 18 Nov, 22:11, Stef Mientki wrote: > Simon Hibbs wrote: > > On 18 Nov, 07:51, sturlamolden wrote: > > >> GPL > > > PyQT is GPL for now, but Qt itself is available under the LGPL as is > > PySide. Eventualy PySide, which tracks the PyQT API, will supplant it

Re: Is there something similar to list comprehension in dict?

2009-11-20 Thread Simon Brunning
#x27;a', 1: 'b', 2: 'c'} (Works in 2.5 - I can't remember when generator expressions were introduced.) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel class structures for AST-based objects

2009-11-22 Thread Simon Forman
and yet you aren't forced to put logic into AST > you don't want there. > FWIW I often use John Aycock's SPARK (Scanning, Parsing, and Rewriting Kit) for this sort of thing. It has a GenericASTTraversal which "is a Visitor pattern according to Design Patterns." http://pages.cpsc.ucalgary.ca/~aycock/spark/ It's apparently distributed with the python source, but it's not in the standard library, more's the pity IMO. There's a bit of a learning curve but it's well worth it. ~Simon -- http://mail.python.org/mailman/listinfo/python-list

exec within function

2010-02-03 Thread Simon zack
hi, I'm not sure how I can use exec within a function correctly here is the code i'm using: def a(): exec('b=1') print(b) a() this will raise an error, but I would like to see it outputting 1 thanks smk -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: obfuscate

2010-02-09 Thread Simon Brunning
ait? Put them in the stdlib now! -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: "if {negative}" vs. "if {positive}" style (was: New to Python)

2010-02-10 Thread Simon Brunning
common, I'll usually put that first even if it does mean using a negative test. I'm not buying the short-case-first argument. If the code in a case block is long enough for that to matter, it really belongs in a function of its own anyway. -- Cheers, Simon B. -- http://mail.pyth

Re: ANN: obfuscate

2010-02-10 Thread Simon Brunning
27;rot-13') 'Uryyb Jbeyq!' -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread Simon Brunning
there some way you could monkey patch the exception class to add some logging in there or something? -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: search entire drive say c:

2010-02-12 Thread Simon Brunning
On 12 February 2010 12:17, prakash jp wrote: > can any of u help to search a file say "abc.txt" in entire c drive (windows) > and print the path/s stating such a files presence. http://code.activestate.com/recipes/499305/ might be a useful start. -- Cheers, Simon B. -- http:/

Re: Python version of perl's "if (-T ..)" and "if (-B ...)"?

2010-02-12 Thread Simon Brunning
On 12 February 2010 14:14, Christian Heimes wrote: > That's a butt ugly heuristic He did say it was from Perl, the home of butt-ugly. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Generic spreadsheet interface

2010-02-12 Thread Simon Hibbs
t as much work as it sounds and could be developed incrementaly. Alternatively you just write your code against one spreadsheet module, and then write a wrapper module for the other spreadsheet API so it looks the same. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Is automatic reload of a module available in Python?

2010-02-18 Thread Simon Brunning
, I don't know. I like to think I'm fairly "pro" when it comes to TDD, and this is exactly what I do - a unit test module run from the shell. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Few questions on SOAP

2010-02-18 Thread Simon Brunning
On 18 February 2010 15:36, joy99 wrote: > (iv)    Is SOAPpy fine? AFAIK, SOAPpy is unsupported, and a bit on the stale side. Those poor souls forced to make SOAP calls with Python seem to be using Suds mostly these days,. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/pyt

Re: a newbie's question

2010-03-09 Thread Simon Brunning
!! You'll find some useful starting points here - <http://wiki.python.org/moin/BeginnersGuide/Programmers>. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't define __call__ within __init__?

2010-03-10 Thread Simon Brunning
stead: X.__call__ = __call__ But this probably isn't what you want either, since all instances of X will share the same method. What are you trying to do? In your simple example, you'd be much better off with a single __call__ method. But you knew that. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Anything like "Effective Java" for Python?

2010-03-10 Thread Simon Brunning
ced programming issues? <http://www.packtpub.com/expert-python-programming/book> is good. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: passing command line arguments to executable

2010-04-03 Thread Simon Brunning
files. I thought about using "os.spawnv()" in > a loop and at each iteration of the loop passing in the file in and > out names but that didn't work. Does anyone have any ideas? Have a look at the subprocess module. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Glob in python which supports the ** wildcard

2010-11-23 Thread Simon Brunning
unction > doesn't support the recursive ** wildcard. Is there any 3rd party glob > function which do support **? This does roughly what you want: http://code.activestate.com/recipes/499305-locating-files-throughout-a-directory-tree/ -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Glob in python which supports the ** wildcard

2010-11-23 Thread Simon Brunning
ame in locate("*.js", "/var/name/"): print filename Adding support for ** is left as an exercise for the reader. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: remote control firefox with python

2010-11-29 Thread Simon Brunning
On 28 November 2010 15:22, News123 wrote: > > I wondered whether there is a simpe way to > 'remote' control fire fox with python. Selenium might be worth a look, too: <http://code.google.com/p/selenium/wiki/PythonBindings> -- Cheers, Simon B. -- http://mail.python.or

Re: list 2 dict?

2011-01-02 Thread Simon Brunning
n't enough? Did you follow the link? grouper() is a recipe, not part of the itertools module. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple values for keyword argument

2011-01-31 Thread Simon Brunning
I think I will make my own names up, that are > descriptive to me as the programmer, it's all going to be interpreted > anyway.  And the other email equating to C's argv, etc. - now I get it. It's perfectly legal to use a name other than self. It's alo perfectly legal neve

Re: passing command line arguments to executable

2010-04-04 Thread Simon Brunning
mm\nMarchScreen.out')[0] > > and the Command Prompt opened and closed, no exceptions were generated > but the program didn't run. Am I doing something wrong? Have you tried running pmm.exe from the command line? What does that look like? Does it matter what the current working d

Re: Sometimes the python shell cannot recognize the presence of an attribute.

2010-04-12 Thread Simon Brunning
2010/4/12 Ricardo Aráoz : > Because . ... Guido says so: http://www.python.org/dev/peps/pep-0008/ -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: An open source AI research project

2010-04-17 Thread Simon Brunning
On 17 April 2010 09:03, David Zhang wrote: > I have started an open source project to develop human-level > Artificial Intelligence... Have you people never seen Terminator? Sheesh. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

<    9   10   11   12   13   14   15   16   >