Re: Parsing numeric ranges

2011-02-25 Thread Simon Brunning
On 25 February 2011 09:27, Seldon wrote: > Hi all, > I have to convert integer ranges expressed in a popular "compact" notation > (e.g. 2, 5-7, 20-22, 41) to a the actual set of numbers (i.e. > 2,5,7,20,21,22,41). > > Is there any library for doing such kind of things or I have to write it > from

Re: multiple values for keyword argument

2011-01-31 Thread Simon Brunning
On 29 January 2011 18:39, wrote: >> I, myself, use the spanish word 'yo' instead (less keystrokes, I hate >> 'self', and it amuses me); if I'm working with my numerical experiments >> I'll use 'n' or 'x'... although, when posting sample code to c.l.py I do >> try to use 'self' to avoid possible c

Re: list 2 dict?

2011-01-02 Thread Simon Brunning
On 2 January 2011 21:04, Octavian Rasnita wrote: >> No. As Ian said grouper() is a receipe in the itertools documentation. >> >> http://docs.python.org/library/itertools.html#recipes > > I know that, that is why I used: > > from itertools import * > > Isn't enough? Did you follow the link? groupe

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: -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-l

Re: Glob in python which supports the ** wildcard

2010-11-23 Thread Simon Brunning
On 23 November 2010 09:26, Martin Lundberg wrote: > It does not seem to support the ** wildcard? It will recursively seek > for files matching a pattern like *.js but it won't support > /var/name/**/*.js as root, will it? I did say roughly. ;-) You'd need to do: for filename in locate("*.js", "/

Re: Glob in python which supports the ** wildcard

2010-11-23 Thread Simon Brunning
On 22 November 2010 21:43, Martin Lundberg wrote: > Hi, > > I want to be able to let the user enter paths like this: > > apps/name/**/*.js > > and then find all the matching files in apps/name and all its > subdirectories. However I found out that Python's glob function > doesn't support the recur

Re: A question about yield

2010-11-08 Thread Simon Brunning
On 7 November 2010 18:14, Chris Rebert wrote: > On Sun, Nov 7, 2010 at 9:56 AM, chad wrote: >> But what happens if the input file is say 250MB? Will all 250MB be >> loaded into memory at once? > > No. As I said, the file will be read from 1 line at a time, on an > as-needed basis; which is to say

Re: ctypes

2010-09-23 Thread Simon Brunning
On 22 September 2010 21:13, jay thompson wrote: > Hello, > > I posted in regard to this in the past but it didn't go very far, no ones > fault, but I'm again atempting to make this work and could use some help. > > I would like to use libraw.dll (http://www.libraw.org/  version 0.10) from > python

Re: How to make a web services in python ???

2010-09-20 Thread Simon Brunning
On 20 September 2010 16:09, Ariel wrote: > Soap web services I think. I think the cool kids would be using , but for the fact that the cool kids all build REST () rather than SOAP these days. -- Cheers, Simon B. -- http:

Re: Printing the name of a variable

2010-09-10 Thread Simon Brunning
On 9 September 2010 20:43, Stephen Boulet wrote: > Does an arbitrary variable carry an attribute describing the text in > its name? I'm looking for something along the lines of: > > x = 10 > print x.name 'x' -- Ch

Re: python interview quuestions

2010-08-13 Thread Simon Brunning
On 11 August 2010 13:34:09 UTC+1, Steven D'Aprano wrote: > Getting interviewees to do a take-home problem just means you hire the > guy who is friends with a good programmer, rather than the good > programmer. We give a take-home problem. If we like the code we see, we invite the candidate to com

Re: Mechanize - save to XML or CSV

2010-08-02 Thread Simon Brunning
On 2 August 2010 14:13, flebber wrote: > HI guys and gals this is probably a simple question but I can't find > the answer directly in the docs for python mechanize. > > http://pypi.python.org/pypi/mechanize/ > > Is it possible to retrieve and save a web page data as xml or a csv > file? Sure, bu

Re: Load/Performance Testing of a Web Server

2010-07-09 Thread Simon Brunning
On 9 July 2010 14:17, kak...@gmail.com wrote: > Hi to all, i want to stress test   a tomcat web server, so that i > could find out its limits. e.g how many users can be connected and > request a resource concurrently. > I used JMeter which is an excellent tool, but i would like to use a > more pyt

Re: optparse TypeError

2010-06-28 Thread Simon Brunning
On 28 June 2010 14:30, dirknbr wrote: > I get an int object is not callable TypeError when I execute this. But > I don't understand why. > (snip) >    lines=options.lines Here you are assigning the -l option to the name 'lines'. >    lines(args[0],topbottom=tb,maxi=lines) Here you are attemptin

Re: Python on Android Mobile?

2010-06-13 Thread Simon Brunning
On 13 June 2010 21:39, Anthony Papillion wrote: > I know Python is growing in popularity and some of Palms devices > already let you run Python apps in a VM environment.  I'm wondering if > anyone knows (or can make an educated guess) if there are any plans > for Python to come to the Android envi

Re: a +b ?

2010-06-11 Thread Simon Brunning
2010/6/11 yanhua : > hi,all! > it's a simple question: > input two integers A and B in a line,output A+B? print sum(int(i) for i in raw_input("Please enter some integers: ").split()) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: regarding the dimensions in gui

2010-06-10 Thread Simon Brunning
On 10 June 2010 08:19, Shashwat Anand wrote: > And please stop using 'sir' for heaven's sake. Not least because list list isn't male only. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: grep command

2010-06-10 Thread Simon Brunning
On 10 June 2010 07:38, madhuri vio wrote: > > i was wondering bout the usage and syntax of > grep command..can u tall me its syntax so that > i can use it and proceed...pls That's really not on topic for this list. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: help me

2010-06-09 Thread Simon Brunning
On 9 June 2010 11:47, madhuri vio wrote: > yea i was able to import by capitalizing t...thank u so much > but wats the reason behind they just changed it for > the significance of each version ..is it that way? PEP 8 () suggests that module names be lower

Re: help me

2010-06-09 Thread Simon Brunning
On 9 June 2010 11:44, madhuri vio wrote: > thankyou so much ..i made it finally... > how do i make buttons and i want a lil text to label the buttons also You might want to run through . -- Cheers, Simon B. -- http://mail.python.org/mail

Re: Python Forum

2010-06-02 Thread Simon Brunning
On 2 June 2010 09:04:56 UTC+1, pyDev wrote: > I hope here will be > someone ready to welcome and help newcomers to enter the beautiful > world of Python. Just send them here, or to . We'll be happy to help. -- Cheers, Simon B. -- http://mail.pytho

Re: Address of an immutable object

2010-05-30 Thread Simon Brunning
On 30 May 2010 18:38:23 UTC+1, candide wrote: > Two non mutable objects with the same value shall be allocated at a constant > and unique address ? Nope. >>> a = 999 >>> b = 999 >>> id(a) == id(b) False Your statement will be the case for small integers, but this in an implementation detail. I

Re: Email in 2.6.4

2010-05-24 Thread Simon Brunning
On 24 May 2010 14:59:24 UTC+1, dirknbr wrote: > It doesn't error on 'import email' but does on call to MimeText. > > import email > msg = MIMEText('test') > > NameError: name 'MIMEText' is not defined Here you want: msg = email.MIMEText('test') -- Cheers, Simon B. -- http://mail.python.org/ma

Re: logging: AttributeError: 'module' object has no attribute 'getLogger'

2010-05-23 Thread Simon Brunning
On 23 May 2010 14:46, Frank GOENNINGER wrote: > Traceback (most recent call last): >  File "/.../src/pib/logging.py", line 37, in >    main() Here's a clue - looks like your own module is called logging. That's what's getting imported by your import. Try naming your module something else, and yo

Re: where are the program that are written in python?

2010-05-21 Thread Simon Brunning
On 21 May 2010 12:12:18 UTC+1, Deep_Feelings wrote: > from that list i have a feeling that python is acting only as "quick > and dirty work" nothing more ! Really? Well, in any case, I can tell you that I know of a number of large commercial web sites built with Django. I just can't tell you wha

Re: where are the program that are written in python?

2010-05-21 Thread Simon Brunning
On 21 May 2010 11:21:11 UTC+1, Deep_Feelings wrote: > 1- where are the programs that is written in python ? > 2- python is high productivity language : why there are no commercial > programs written in python ? See http://www.python.org/about/success/ -- Cheers, Simon B. -- http://mail.python.

Re: Reading data from a Microsoft Access 2003 database

2010-05-19 Thread Simon Brunning
On 19 May 2010 10:28:15 UTC+1, Jimoid wrote: > I use Ubuntu 64 bit and need to develop a programme (ideally in > Python) to work on data that is contained in a Microsoft Access 2003 > database. I do not need to modify the database, simply read a few > columns of data from some tables. mxODBC migh

Re: Is this an ok thing to do in a class

2010-05-18 Thread Simon Brunning
On 18 May 2010 06:21:32 UTC+1, Vincent Davis wrote: > > Just wondering if there is a problem with mixing a dictionary into a class > like this. Everything seems to work as I would expect. No problem at all AFAIC. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: reading XML file using python

2010-05-17 Thread Simon Brunning
On 17 May 2010 10:43:06 UTC+1, Shanti Bhushan wrote: > Hi simon, > you are right in 2nd paragaraph. > i have a piece of XML with some URLs in it that i want to > extract. > I have no clue from where to get help on this. > Please atleast guide me for document or link where i can get such help > i c

Re: reading XML file using python

2010-05-17 Thread Simon Brunning
On 17 May 2010 09:34:51 UTC+1, shanti bhushan wrote: > Hi , > i am new to python.i want to read the XML file using python it ,by > using DOm or SAX any of them. > I want to read the http://www.google.com(any hyper text) from XML and > print that. > please give me the sample program for this. Your

Re: Deleting more than one element from a list

2010-04-21 Thread Simon Brunning
On 21 April 2010 20:56, candide wrote: > Is the del instruction able to remove _at the same_ time more than one > element from a list ? Yup: >>> z=[45,12,96,33,66,'c',20,99] >>> del z[:] >>> z [] -- 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

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: passing command line arguments to executable

2010-04-04 Thread Simon Brunning
On 3 April 2010 18:20, mcanjo wrote: > I tried doing the following code: > > from subprocess import Popen > from subprocess import PIPE, STDOUT > exefile = Popen('pmm.exe', stdout = PIPE, stdin = PIPE, stderr = > STDOUT) > exefile.communicate('MarchScreen.pmm\nMarchScreen.out')[0] > > and the Comm

Re: passing command line arguments to executable

2010-04-03 Thread Simon Brunning
On 3 April 2010 17:09, mcanjo wrote: > I have an executable (I don't have access to the source code) that > processes some data. I double click on the icon and a Command prompt > window pops up. The program asks me for the input file, I hit enter, > and then it asks me for and output filename, I h

Re: Anything like "Effective Java" for Python?

2010-03-10 Thread Simon Brunning
On 10 March 2010 15:19, kj wrote: > Subject line pretty much says it all: is there a book like "Effective > Java" for Python.  I.e. a book that assumes that readers are > experienced programmers that already know the basics of the language, > and want to focus on more advanced programming issues?

Re: Can't define __call__ within __init__?

2010-03-10 Thread Simon Brunning
On 10 March 2010 13:12, Neal Becker wrote: > Want to switch __call__ behavior.  Why doesn't this work?  What is the > correct way to write this? > > class X (object): >    def __init__(self, i): >        if i == 0: >            def __call__ (self): >                return 0 >        else: >      

Re: a newbie's question

2010-03-09 Thread Simon Brunning
On 9 March 2010 13:51, Lan Qing wrote: > Hi all, >       I'm a newbie of python programming language. Welcome! > I have used c/c++ for 5 > years, and one year experience in Lua programming language. Can any one give > me some advice on learning python. Think you for any help!! You'll find some

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/python-li

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

2010-02-18 Thread Simon Brunning
2010/2/17 Arnaud Delobelle : > I know some people will point at more 'pro' ways of testing but this has > the merit of being very straightforward.  Then when you move on to more > sophisticated techniques, I think you will understand better the > motivations behind them. Oh, I don't know. I like t

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: 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://mail.python.org/

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

2010-02-11 Thread Simon Brunning
On 11 February 2010 16:17, mk wrote: > I'm getting an exception (on socket) handled in a program I'm trying to > debug. I have trouble locating where exactly that happens. > > In such situation turning exception handling off could be useful, bc > unhandled exception stack trace is precisely what I

Re: ANN: obfuscate

2010-02-10 Thread Simon Brunning
On 10 February 2010 01:24, Ben Finney wrote: > The classic example is rot-13 encryption of text in internet messages; > it would be a failure of imagination to suggest there are not other, > similar use cases. That's built-in: >>> "Hello World!".encode('rot-13') 'Uryyb Jbeyq!' -- Cheers, Simon

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

2010-02-10 Thread Simon Brunning
On 10 February 2010 03:36, Tim Chase wrote: > Any thoughts on how others make the choice? There are two criteria that I use here. I'll often tend towards the positive test; it's just that little bit easier to comprehend, I think. On the other hand, if one case is overwhelmingly more common, I'll

Re: ANN: obfuscate

2010-02-09 Thread Simon Brunning
On 9 February 2010 16:29, Robert Kern wrote: > On 2010-02-09 09:37 AM, Daniel Fetchinson wrote: >> If the code base stabilizes in a production version after losing the >> alphas and betas they would be a great addition to the stdlib, I >> think. > > Why? I agree. Why wait? Put them in the stdlib

Re: Python and Ruby

2010-01-27 Thread Simon Brunning
2010/1/27 Jean Guillaume Pyraksos : > What are the arguments for choosing Python against Ruby > for introductory programming ? Frankly, either would be a good choice. I think Python is a little cleaner, but I'm sure you'd find Ruby fans who'd argue the complete opposite. Both have good ecosystems

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: Help parsing a page with python

2010-01-27 Thread Simon Brunning
2010/1/27 mierdatutis mi : > Those videos are generated by javascript. > There is some parser with python for javascript??? There is , but simulating the whole context of a browser is going to be a horror. You are probably far better off automating a

Re: Help parsing a page with python

2010-01-27 Thread Simon Brunning
2010/1/27 mierdatutis mi : > Hi, > > I would like to parse a webpage to can get the url of the video download. I > use pyhton and firebug but I cant get the url link. > > Example: > > The url where I have to get the video link is: > http://www.rtve.es/mediateca/videos/20100125/saber-comer---salsa-v

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: 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: 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 might be worth a look too. -- Cheers, Simon B. -- http://mail.python.org/mailm

Re: use of super

2010-01-19 Thread Simon Brunning
2010/1/19 harryos : > I was going thru the weblog appln in practical django book by > bennet .I came across this > > class Entry(Model): >        def save(self): >                dosomething() >                super(Entry,self).save() > > I couldn't make out why Entry and self are passed as argumen

Re: What is a list compression in Python?

2010-01-18 Thread Simon Brunning
2010/1/18 Kit : > Hello Everyone, I am not sure if I have posted this question in a > correct board. Can anyone please teach me: > > What is a list compression in Python? Perhaps you mean a list comprehension? If so, see . -- Cheers

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

2010-01-15 Thread Simon Brunning
2010/1/14 Novocastrian_Nomad : > Why is it so many, so called high tech companies, insist on the 19th > century practice of demanding an employee's physical presence in a > specific geographic location. Pair programming and co-location with your end users both hugely increase real productivity, in

Re: Getting access to the process table from python?

2010-01-14 Thread Simon Brunning
2010/1/13 Roy Smith : > I need to get information about what processes are running on a box. > Right now, I'm interested in Solaris and Linux, but eventually > probably other systems too.  I need to know things like the pid, > command line, CPU time, when the process started running, and owner. > >

Re: pywinauto to show the dialog , menu, etc

2010-01-01 Thread Simon Brunning
2009/12/31 Hari : > Hi > I am using pywinauto to automate an custom program to startup and load > process , execute etc. But cannot determine menuselect. Is there a way or > tool which can run against the exe to show the menu, dialog box, list box > which are contained within it. Winspector might

Re: Absolute beginner

2009-12-30 Thread Simon Brunning
2009/12/30 : > At a dos-prompt : > > Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit > (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. print "Hello" >  File "", line 1 >    print "Hello" >                ^ > SyntaxError: invali

Re:

2009-12-28 Thread Simon Brunning
2009/12/24 Yulin : > Hi when I start my Pc I get error “ The specified module could not be found. > LoadLibrary(pythondll)failed > > Please Help once I have enterd I get the following….C:\Documents and > settings\all users\.clamwin\quarentine\python25.DLL > > PLEASE help I cant load most of my prog

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 () to do the conversions. The SI units are already defined - adding in any necessary imperial units should be easy enough. -- Cheers, Simon B. -- http://mail.pytho

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

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: Where is my namespace?

2009-12-07 Thread Simon Brunning
2009/12/7 vsoler : > I take the example from Mark Lutz's excellent book "Learning Python". > > *** In nested1.py  I have: > X=99 > def printer(): print X > > *** In nested2.py  I have: > from nested1 import X, printer > X=88 > printer() > > What is amazing is that running nested2.py prints 99 and n

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: pbs scripts

2009-12-02 Thread Simon Brunning
2009/12/2 aoife : > Hi,very new.hoping to incorporate python into my postgrad. > > Basically I have 2,000 files.I want to write a script that says: > > open each file in turn If they are in one directory, look at the glob module. If they are in a bunch of sub-directories, see os.walk(), or

Re: can python do this?

2009-12-02 Thread Simon Brunning
2009/12/2 Rounak : > I am a complete newbie. I want to know if the following can be done > using python or should I learn some other language: > (Basically, these are applescripts that I wrote while I used Mac OS) Python can do anything Applescript can do with the appscript module - see

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/listinfo/python-lis

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

2009-11-20 Thread Simon Brunning
2009/11/20 Michele Simionato : > Yes, but only in Python 3: > {(i, x) for i, x in enumerate('abc')} > {(0, 'a'), (1, 'b'), (2, 'c')} In Python 2.x, you can do: >>> dict((i, x) for i, x in enumerate('abc')) {0: 'a', 1: 'b', 2: 'c'} (Works in 2.5 - I can't remember when generator expressions

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

2009-11-18 Thread Simon Brunning
2009/11/17 sjm : > On Nov 16, 12:54 pm, Steve Ferg > wrote: > >> Does anybody know a language with this kind of syntax for >> ifThenElseEndif? > > Modern-day COBOL: > > IF      some-condition >        do-something > ELSE >        do-something-else > END-IF. RPG/400's SELEC statement: http://bit.

Re: QuerySets in Dictionaries

2009-11-12 Thread Simon Brunning
2009/11/12 scoopseven : > I need to create a dictionary of querysets.  I have code that looks > like: > > query1 = Myobject.objects.filter(status=1) > query2 = Myobject.objects.filter(status=2) > query3 = Myobject.objects.filter(status=3) > > d={} > d['a'] = query1 > d['b'] = query2 > d['c'] = quer

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 import is a keyword, not an object. -- Cheers, Simon B. -- http://ma

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: 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 : > I’m trying to write regexp that find all files that are not with next > extensions:  exe|dll|ocx|py,  but can’t find any command that make it. http://code.activestate.com/recipes/499305/ should be a good start. Use the re module and your regex instead of fnmatch.filter(

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: Help with SOAPpy and WSDL.

2009-11-02 Thread Simon Brunning
2009/11/2 Henrik Aagaard Sørensen : > I'll try to explain it here then: > > A small example on SOAPpy and WSDL. My code: > from SOAPpy import WSDL > wsdlFile = 'http://www.webservicex.net/country.asmx?wsdl' > server = WSDL.Proxy(wsdlFile) > server.GetCurrencyByCountry('Zimbabwe') > > returns: > Sy

Re: Help with SOAPpy and WSDL.

2009-11-02 Thread Simon Brunning
2009/11/2 Henrik Aagaard Sørensen : > I have a problem with SOAPpy and WSDL. It is explained here: > http://www.python-forum.org/pythonforum/viewtopic.php?f=3&t=15532 Why not explain it here? In any case, I imagine the advice is going to be to try Suds - . -- Che

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

2009-10-08 Thread Simon Brunning
2009/10/8 ryniek90 : > Ok thanks all for answers. Not counting .split() methods and regexps, > there's nothing interesting. > But I remember that lambda function also was unwelcome in Python, but > finally it is and is doing well. So maybe someone, someday decide to > put in Python an alternative,

Re: New Python Novice

2009-10-02 Thread Simon Brunning
2009/10/2 baboucarr sanneh : > Hello Everyone, > > My name is Baboucarr ..am from the gambia (west africa).. I visited some years back. Friendly people. > I just read about > python and i want to know how to program with it.. > I would like you guys to help me in my road to becoming a python guru

Re: help wanted with list

2009-09-24 Thread Simon Brunning
2009/9/24 Ahmed Shamim : > list = [ 'a', '1', 'b', '2'] > what would be the logic, if I input a to get output 1. Turn it into a dictionary first: >>> mylist = [ 'a', '1', 'b', '2'] >>> mydict = dict(zip(mylist[::2], mylist[1::2])) >>> mydict['a'] '1' -- Cheers, Simon B. -- http://mail.python.o

Re: recommendation for webapp testing?

2009-09-17 Thread Simon Brunning
2009/9/17 Schif Schaf : > What's the difference between WebDriver and Selenium? Selenium runs in a browser, and uses JavaScript to perform all your automated actions. It need a browser running to work. Several are supported, Firefox, Safari, IE and I think others. You are at thier mercy of the bro

Re: recommendation for webapp testing?

2009-09-16 Thread Simon Brunning
2009/9/16 Schif Schaf : > > I need to do some basic website testing (log into account, add item to > cart, fill out and submit forms, check out, etc.). What modules would > be good to use for webapp testing like this? might be worth a look. -- Cheers, Simon

Re: Use python to execute a windows program

2009-09-11 Thread Simon Brunning
2009/9/11 Doran, Harold : > The way we do this now is a person sits in front of their machine and > proceeds as follows: > > 1) Open windows program > 2) Click file -> open which opens a dialog box > 3) Locate the file (which is a text file) click on it and let the > program run. It might very wel

Re: The future of Python immutability

2009-09-07 Thread Simon Brunning
2009/9/7 Terry Reedy : > Dennis Lee Bieber wrote: >> I'd say the >> mutables are in the majority > > I think it depends on whether one counts classes or instances. Typical > programs have a lot of numbers and strings. Ah, but immutable instances can be, and often are, interned. This will cut dow

Re: Usage of main()

2009-09-03 Thread Simon Brunning
2009/9/4 Manuel Graune : > How come the main()-idiom is not "the standard way" of writing a > python-program (like e.g. in C)? Speaking for myself, it *is* the standard way to structure a script. I find it more readable, since I can put my main function at the very top where it's visible, with the

Re: Question on the "csv" library

2009-08-27 Thread Simon Brunning
2009/8/28 John Machin : > > Mark, there exist parallel universes the denizens of which use strange > notation e.g. 1.234,56 instead of 1,234.56 When displaying data, sure. > and would you believe they > use ';' instead of ',' as a list separator ... CSV is a data transfer format, not a display f

Re: Usefull python tutorial

2009-08-26 Thread Simon Brunning
2009/8/26 gentlestone : > Can somebody give me an advise where I can found a really good online > tutorial? All I found are useless. is really good, as I remember, as is . For example no tutorial I found > explains this piece of code

Re: Python for professsional Windows GUI apps?

2009-08-26 Thread Simon Brunning
2009/8/26 geekworking : > If you are planning a database driven app, you should first settle on > a DB server. Any real enterprise DB system will put all of the > business logic in the database server. The choice of a front end > should be secondary. The trend for some years now has been to get be

Re: Need cleanup advice for multiline string

2009-08-12 Thread Simon Brunning
2009/8/11 Robert Dailey : > On Aug 11, 3:40 pm, Bearophile wrote: >> There are gals too here. > > It's a figure of speech. And besides, why would I want programming > advice from a woman? lol. Thanks for the help. Give the attitudes still prevalent in our industry (cf

Re: iText for Python

2009-07-27 Thread Simon Brunning
2009/7/27 santhoshvkumar : >           One of my cousin  suggested me to do a IText PDF converter > for python. Actually I heard that there is no separate IText converter > either we have to go for jython or GCJ with wrapper. Instead of > wrapping, my plan is to create a separate module with Python

Re: generation of keyboard events

2009-07-06 Thread Simon Brunning
2009/7/6 RAM : > I am trying to do this on windows. My program(executable) has been > written in VC++ and when I run this program, I need to click on one > button on the program GUI i,e just I am entering "Enter key" on the > key board. But this needs manual process. So i need to write a python >

Re: Need Help

2009-07-02 Thread Simon Brunning
2009/7/2 Tengiz Davitadze : > Hello. I can't find a wright mail address. If you can help me I need to get > an information about UNICODE. I am georgian and I need to write programs on > georgian language . If you can transfer this mail or send me a wright mail > about encoding or unicode informatio

Re: Beginning with Python; the right choice?

2009-06-28 Thread Simon Brunning
2009/6/27 sato.ph...@gmail.com : > Thank you for all of the links and advice. > > What do I want to learn Python for? > > Again, pardon me for my lack of relevant information.  I am also a > journalist (an out of work one at the moment, like so many others) and > I feel that learning python could b

Re: Programming language comparison examples?

2009-06-06 Thread Simon Brunning
2009/6/5 : > someone: >> I thought there was a website which demonstrated how to program a bunch of >> small problems in a number of different languages. > > http://www.rosettacode.org/wiki/Main_Page > http://en.literateprograms.org/LiteratePrograms:Welcome > http://www.codecodex.com/wiki/index.ph

Re: Wrapping comments

2009-05-11 Thread Simon Brunning
2009/5/10 Tobias Weber : > (still not gonna use software that doesn't let me type # because it's > alt+3 on a UK layout; having to re-learn or configure that is just sick) To use Aquamacs with a UK keyboard, you want to select Options, Option Key, Meta & British. Things just work then. -- Cheers

Re: Return value usage

2009-04-29 Thread Simon Brunning
2009/4/29 Zac Burns : > I would like to know when my function is called whether or not the > return value is used. Is this doable in python? If it is, can it ever > be pythonic? AFAIK, no, it's not. > The use case is that I have functions who's side effects and return > values are cached. I would

Re: v 3.0 mpkg

2009-02-04 Thread Simon Brunning
2009/2/4 John Forse : > Does anyone know if Python v3.0 is available as an .mpkg installer for Mac > 10.5.6. I have used 2.5 & updated to 2.6.1 this way, but can't find any > reference to one on the Python.org download site. I've downloaded the Python > 3.0 folder but can't follow how to install i

Re: JDBC in CPYTHON

2009-02-03 Thread Simon Brunning
2009/2/3 KMCB : > I was wondering if anyone was aware of a JDBC DBAPI module for > cpython. I have looked at PYJDBC and was interested in avoiding using > that extra level of ICE. I was thinking maybe someone would have back > ported zxJDBC from Jython. Or used that as a starting point, to > cre

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

  1   2   3   4   5   6   >