Re: question about for cycle

2007-09-29 Thread Ant
def get_value(): for i in range(10): for j in range(10): print i, j if j == 6: return fn(i, j) I guess to an extent it would depend on the exact situation as to which of these is more suitable. Are there any other recommended solutions to this? -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 migration plans?

2007-09-29 Thread Ant
3k a) when frameworks/modules that they use are available and b) if and when doing so would be advantageous. I suspect that many of the projects I have that are solid and are in no imminent need of development will remain <3k for several years. Cheers, -- Ant -- http://mail.python.org/mai

Re: python with braces pre-processor

2007-10-22 Thread Ant
On Oct 22, 10:44 am, Paul Brauner <[EMAIL PROTECTED]> wrote: > Hi, I'm working on a project that outputs several languages including > (hopefully) python. My problem is that the generic backend architecture > has not been designed to output correctly indented code, and that would > be helpful if th

Re: python with braces pre-processor

2007-10-22 Thread Ant
a = a+1 elif a < b: b = b-1 if b > a: a = a-1 # end if else: print 'oops!' # end if # end def foobar The help in the script looks pretty good. -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteration for Factorials

2007-10-22 Thread Ant
On Oct 22, 1:26 pm, Py-Fun <[EMAIL PROTECTED]> wrote: > I'm stuck trying to write a function that generates a factorial of a > number using iteration and not recursion. Any simple ideas would be > appreciated. The following simple adder functions should give you an idea of how recursion can be re

Re: What is Jython?

2007-11-01 Thread Ant
ional tests etc. Take a look at http://antroy.blogspot.com/2007/04/swing-testing-with-jython-and-jemmy.html for an example of how I have successfully used Jython for Swing testing. More information can be found on http://www.jython.org/Project/index.html Cheers, -- Ant. -- http://mail.pyt

Re: permuting over nested dicts?

2007-11-01 Thread Ant
On Nov 1, 9:12 am, Anand <[EMAIL PROTECTED]> wrote: ... > This code works for dictionaries of any nested level. At least up to the max recursion depth. -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Jython?

2007-11-01 Thread Ant
parallel processing and mathematical processing that seems faster in Jython. It's be interesting to see a proper comparison of how different types of program run. The VM startup overhead is much slower mind, but then that's only an issue for very small programs. Cheers, -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Jython?

2007-11-01 Thread Ant
On Nov 1, 1:23 pm, Ant <[EMAIL PROTECTED]> wrote: > On Nov 1, 11:37 am, Ze'ev <[EMAIL PROTECTED]> wrote: > ... > > > ...> Jython is currently significantly slower than Python. > > > ... > > Not according to this > > :http://blogs.

Re: Python Windows Editors

2007-01-21 Thread Ant
around the component, which comes with some nice features and syntax files for a number of languages. If you are going to make use of python on the windows platform, I would highly recommend the pywin32 extension. Regards, Ant W. Watson wrote: > I downloaded python-2.5.msi and installed it

Re: Calling J from Python

2007-02-09 Thread Ant
On Feb 6, 12:21 am, greg <[EMAIL PROTECTED]> wrote: ... > Yes, but with Python you wouldn't have to spend a > couple of weeks sitting and thinking before starting > to type that line... This is a good point often overlooked. You often get these threads on c.l.python about "How can I do this in one

Re: help regarding python and jsp

2007-02-26 Thread Ant
e trying to do exactly here? -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with for loop

2007-11-06 Thread Ant
On Nov 6, 9:59 am, Shriphani <[EMAIL PROTECTED]> wrote: ... > My main intention is to state that each of the variables namely a, b, > c, ## can take value from 1 to 9. > How do I go about this ? It sounds like you are after something like: for var in (a, b, c, d, e, f): assert var in [1, 2, 3,

Re: Using Python To Change The World :)

2007-11-14 Thread Ant
ht that pygame would satisfy the graphical side of things. -- Ant -- http://mail.python.org/mailman/listinfo/python-list

foldr function in Python

2007-11-22 Thread Ant
maSeparate = foldr(lambda x, y: "%s%s%s" % (x, "," if x else "", y), "") commaSeparate(myList) Of course the lambda function in this case could be a named function, helping with both readability and reuse, but I think the latter is conceptually easier to grasp when reading the code. Discuss. -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: foldr function in Python

2007-11-23 Thread Ant
On Nov 22, 7:14 pm, oj <[EMAIL PROTECTED]> wrote: > On Nov 22, 3:02 pm, Ant <[EMAIL PROTECTED]> wrote: ... > It's basically just one line to implement: > > foldr = lambda f, i: lambda s: reduce(f, s, i) > > It's just reduce with currying, I'm not su

Re: foldr function in Python

2007-11-23 Thread Ant
duce() is going away, not just > from the built-ins but (I believe) from the standard library as well. I thought that at the last count it was merely being moved out into functools (or somewhere similar). -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: foldr function in Python

2007-11-23 Thread Ant
On Nov 23, 9:31 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 23 Nov 2007 00:50:30 -0800, Ant wrote: > > So my point really is that foldr (perhaps renamed to make_reducer or > > something) could create idioms that are more readable than using &g

Re: may be a bug in string.rstrip

2007-11-23 Thread Ant
On Nov 23, 4:09 am, "kyo guan" <[EMAIL PROTECTED]> wrote: ... > >>> '120.exe'.rstrip('.exe') Another approach since you seem to be working with filenames is using the os.path module: >>> import os.path as path >>> s = "test.torrent" >>> t = "test.exe" >>> u = "test" >>> path.splitext(s)[0] 'test'

Re: python vs pythonw

2007-11-30 Thread Ant
, pythonw runs the script as a background process. I'd imagine that it is the same for the Mac, and I shouldn't think it has anything to do with your problem here. -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Witch editor to use!

2007-11-30 Thread Ant
On Nov 30, 9:10 am, SMALLp <[EMAIL PROTECTED]> wrote: > Hello! > > I'm new in wxPython and before i start doing anything I have one qustion. > > Shoul I use some of editors like boa, spe or shoud i use my favorite > text editor! > > i used IDLE on windows and it seamd nice. Now i have linux install

Why did no one tell me about import antigravity?

2007-12-05 Thread Ant
Python on xkcd: http://xkcd.com/353/ -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Python deques linked lists?

2007-12-10 Thread Ant
time insertion anywhere in the list. > > It's on the shelf between the jar of phlogiston and the perpetual > motion machine. lol! -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-18 Thread Ant
(OT) I don't have the same issue with Syntax highlighting, and I use jEdit as my main Python editor (Though some of the dedicated Python IDE's have some nice refactoring/code completion stuff, none has the raw editing power of jEdit). I'm using jEdit 4.3 pre3 - though I don't recall any problems w

Re: items in an array

2006-04-19 Thread Ant
If you just want the items concatenated with a comma separator, the following is what you need: >>> list_arr = ["one", "two", "three"] >>> list = ",".join(list_arr) >>> print(list) one,two,three -- http://mail.python.org/mailman/listinfo/python-list

Re: Lamdba forms

2006-04-20 Thread Ant
Why does the function have to be unnamed? you can easly nest function definitions and refer to them. IIRC the lambda form is probably going to be removed at some point, as it is not needed: def outerfn(): dostuff() def inner(x,y): out = (x^y) print out return out

Re: Lamdba forms

2006-04-20 Thread Ant
No, I remembered correctly: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 but probably not until Python 3.0. -- http://mail.python.org/mailman/listinfo/python-list

Re: Lamdba forms

2006-04-20 Thread Ant
Fair enough. I've just found this as well, which implies that lambda isn't being killed off in 3.0: http://www.python.org/dev/peps/pep-3100/ In particular: "Lambdas will have to be parenthesized [23]" -- http://mail.python.org/mailman/listinfo/python-list

Re: Thanks from the Java Developer

2006-04-20 Thread Ant
Python ruined my life. I am a Java programmer by profession, and ever since learning Python, I find it a real chore to open Eclipse and write Java code (or worse - the XML config files that seem to glue J2EE together). And while I spend some of my spare time liberated by Python, I spend 10 times a

Re: proposed Python logo

2006-04-21 Thread Ant
Sorry dude, but it looks like a hairdryer! Imagine it at 16x16 pixels or smaller, and it'll look like little more than a circle with two sticks. The current image scales well. I think that the current logo is fine. Much more professional than the old image. The + formation is positive enough, and

Re: Thanks from the Java Developer

2006-04-21 Thread Ant
> So switch jobs -- it's a good time. If it were that easy I would.. However, I have family commitments keeping me in Yorkshire (UK) (as well as the fact that I really like the area!), and the jobs in the area are all Java, .NET (predominantly C#) and C++. Always on the lookout for Python work th

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-22 Thread Ant
Take a look at the newgroup archives over the last week or two - there seem to have been a glut of people coming from Java to Python and asking the same sort of questions. There were some links to a bunch of Python 'gotcha' pages which will be useful. For my part, I came from Java to Python, and f

Re: begging for a tree implementation

2006-04-27 Thread Ant
Did you not read the first post? > All the nice methods would be appreciated (getLeaves, isLeaf, isRoot, > depthfirst, breadthfirst,...) -- http://mail.python.org/mailman/listinfo/python-list

Re: begging for a tree implementation

2006-04-27 Thread Ant
I was looking for a tree implementation a while back, but got no real pointers. Seems that there are no tree data model modules out there - which surprises me, since it is such a fundamental data structure. I ended up using a very basic tree data class - I didn't need all of the methods you mentio

Re: begging for a tree implementation

2006-04-27 Thread Ant
Damn! Missed the boat ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple assignment and generators?

2006-05-04 Thread Ant
I don't think he was explicitly wanting to initialize things to zero, but rather unpack an arbitrary sequence into a tuple (could perhaps be the fibonnacci sequence for example). How about: >>> def zeros(count): ... for i in range(count): ... yield 0 ... >>> a,b,c = zeros(3) >>> a 0 >

Re: Question regarding checksuming of a file

2006-05-14 Thread Ant
A script I use for comparing files by MD5 sum uses the following function, which you may find helps: def getSum(self): md5Sum = md5.new() f = open(self.filename, 'rb') for line in f: md5Sum.update(line) f.close() return md5Sum

Re: any plans to make pprint() a builtin?

2006-05-15 Thread Ant
Considering that the current: import pprint pprint.pprint(x) is hardly lengthy, I can't see how either of the alternatives proposed are any better. > python.pprint.pprint(x) 6 characters shorter, but considerably more keystrokes if you are using pprint more than once. Is it worth adding the 'py

Re: Tabs versus Spaces in Source Code

2006-05-17 Thread Ant
I think Duncan has hit the nail on the head here really. I totally agree that conceptually using tabs for indentation is better than using spaces. Pragmatically though, you can't tell in an editor where spaces are used and where tabs are used. Perhaps if editors colored the background of tab chara

Re: Tabs versus Spaces in Source Code

2006-05-17 Thread Ant
> Ant wrote: > > spaces. Pragmatically though, you can't tell in an editor where spaces > > are used and where tabs are used. > Um, I don't follow this. If you can't tell the editor where > tabs/spaces are used, who does? Re-read my post. Note the key word &

Re: Tabs versus Spaces in Source Code

2006-05-17 Thread Ant
> Not that it's relevant, but I've never actually encountered anyone who > mixed tabs and spaces.. I've lived a sheltered life I guess. It's not individuals using a mixture, but when working in a development team of some kind. Consider person A who writes a file using spaces for indent. Person B t

Re: how to make the program notify me explicitly

2006-05-18 Thread Ant
> > I don't know whether python can warn me through beeping like C > > program(e.g.:printf("%c", '\07');) > > This is information that is easily lost; what if no-one is in hearing > range when the beep occurs? Indeed, *does* it still beep if there is no-one around to hear it? -- http://mail.pyth

Re: John Bokma harassment

2006-05-24 Thread Ant
o his ISP. Given that it has gone this far, wouldn't it be fair to give the guy a break on the condition that if he wants to post to a variety of newgroups, that he does it individually rather than as a cross post? -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: John Bokma harassment

2006-05-24 Thread Ant
> Surely Voltaire didn't support speaking in inappropriate fora? Who knows? But the fora Xah posts to are few (5 or so?) and appropriate. "Software needs Philosophers" wasn't even his rant, but was certainly appropriate to all groups he posted to. If you don't like Xah's posts, then don't read th

Re: John Bokma harassment

2006-05-24 Thread Ant
John Bokma wrote: > That's because you're clueless. Well argued. No really. Not quite sure what you base the allegations on of course. John, you're well out of order getting this guy into problems with his ISP. Ken Tilton has it spot on - if everyone who wasn't interested in what he had to say ig

Re: John Bokma harassment

2006-05-24 Thread Ant
Getting eloquent isn't he? ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing python dictionary in Java using JPython

2006-05-26 Thread Ant
It really depends on how you are trying to pass the dictionary across to Java, what sort of objects are in the dictionary etc. Could you provide some more background? BTW the Java implementation of Python is now called Jython (and has been for some years!). -- http://mail.python.org/mailman/list

Re: Parsing python dictionary in Java using JPython

2006-05-26 Thread Ant
This will work fine in simple cases and if the dictionaries are passed around in repr() form. If they are being passed pickled in some way, or the values in the dictionary are anything other than strings, lists, dictionaries or combinations of these then you will need something like Jython. -- h

Extracting files from an ISO image?

2008-01-02 Thread Ant
e out there for extracting files from an ISO? 2) Is there a module out there for extracting icons from a Windows exe? Cheers, -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting files from an ISO image?

2008-01-03 Thread Ant
On Jan 2, 7:07 pm, Rob Williscroft <[EMAIL PROTECTED]> wrote: > Ant wrote in news:34a84caa-5387-40a2-a808- > > 1) Is there a module out there for extracting files from an ISO? > > There are command line programs that can do this: > > http://cdrecord.berlios.de/old/priv

Jython: Honourable mention on Charles Nutter's blog.

2008-01-04 Thread Ant
Hi all, The Jython team got an honourable mention on the Headius blog this morning. Apparently they have got Django working with the latest builds of Jython: http://headius.blogspot.com/2008/01/jythons-back-baby.html So congratulations! -- Ant. -- http://mail.python.org/mailman/listinfo/python

Re: Learning Python via a little word frequency program

2008-01-09 Thread Ant
are doing. Of course this could also be achieved by doing pairs.sort() and pairs.reverse() before iterating over the pairs list. Cheers, -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python too slow?

2008-01-10 Thread Ant
a troll - so many people who would actually be able to assist you (such as the PIL, pygame and numpy/scipy communities) may have ignored this thread. Cheers, -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python self-evaluating strings

2008-01-29 Thread Ant
In the spirit of "Simple is better than complex." and totally bypassing the intention of quines (though not necessarily the definition): --- probably_not_a_real_quine.py import sys for line in open(sys.argv[0]): print line, -- ;-) -- Ant

Re: News from Jython world

2008-03-04 Thread Ant
he possibility of more Python jobs out there for us all in the future given the ubiquity of the JVM in the enterprise and willingness of corporations to accept such endorsements! -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regexp

2009-01-19 Thread Ant
A 0-width positive lookahead is probably what you want here: >>> s = """ ... hdhd http://mysite.com/blah.html";>Test String OK ... ... """ >>> p = r'href="(http://mysite.com/[^"]+)">(.*)(?=)' >>> m = re.search(p, s) >>> m.group(1) 'http://mysite.com/blah.html' >>> m.group(2) 'Test String OK' The

Re: Emacs vs. Eclipse vs. Vim

2008-11-30 Thread Ant
On Nov 29, 8:44 pm, Josh <[EMAIL PROTECTED]> wrote: > If you were a beginning programmer and willing to make an investment in > steep learning curve for best returns down the road, which would you pick? Personally I'd choose Vim for the following reasons: 1) Vim is ubiquitous on Linux/Unix server

Re: My last working day of 2007

2009-01-05 Thread Ant
On Jan 5, 9:47 am, "Jack.Chu" wrote: > Hello guys: > I created a simple tool to count how I wasted my time day by day > ;-)http://www.flickr.com/photos/34017...@n07/3169438647/sizes/o/ Looks interesting - did you have some sort of time machine to be spending that much time in Chrome at the end o

Re: Generator metadata/attributes

2009-01-08 Thread Ant
You could look at something like the following to turn the class iteslf into a decorator (changed lines *-ed): > class TaggedWrapper(): > *     def __init__(self, logMixin, stream): >         self.__tag = '%...@%s' % (logMixin.describe(), stream) >         logMixin._debug('Created %s' % self) > >

Re: drive a desktop app from python?

2009-01-09 Thread Ant
On Jan 8, 9:06 pm, "Tim Arnold" wrote: > Is there any lib or recipe(s) for doing something like this via python? Look into the PyWin32 extension module. It gives access to Windows internals including the COM interface. You'll need to do some research into how to automate the GUI you're using from

Re: Python search path (on Windows)

2008-10-22 Thread Ant
On Oct 22, 10:03 am, "wooly booly" <[EMAIL PROTECTED]> wrote: > I would like to execute a Python script from Windows command line: > > Python myscript.py > > This works if myscript.py resides in the current folder. My question is: > Is it possible to execute the command above from another folder? >

Re: 2to3 Help?

2009-03-05 Thread Ant
On Jan 15, 6:43 am, "James Mills" wrote: ... > That is a good idea :) Windows teaches you nothing! Not true. Windows teaches you the art of the workaround... -- http://mail.python.org/mailman/listinfo/python-list

Re: file.read() doesn't read the whole file

2009-03-24 Thread Ant
On Mar 24, 7:59 am, Sreejith K wrote: ... > data is the whole file, but 'less' gives only the two lines... >From this statement (that you are using less), it appears that you are redirecting sys.stdout to a file or similar - if that is the case, you may need to flush or close the output file befo

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-06 Thread Ant
a little 1 man company called Zabkat. -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Which python version do I use with "virtualenv"?

2009-05-07 Thread Ant
not "C:\Python 2.6". I'd be carefull of changing the default install directory of Python, particularly if you are "non-techy" as some packages installers may look for Python in the default location. -- Ant -- http://mail.python.org/mailman/listinfo/python-list

matplotlib - overlaying plots.

2009-05-14 Thread Ant
so points can be easily correlated, but overlayed so that each line has a different scale on the y-axis. The closest I can get is to have two subplots, one above the other. Thanks in advance, Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: matplotlib - overlaying plots.

2009-05-14 Thread Ant
On May 14, 3:52 pm, Hyuga wrote: ... > On the other hand, I just took a peek at the matplotlib example > gallery, which is very diverse, and it has an example that I think is > exactly what you're looking > for:http://matplotlib.sourceforge.net/examples/api/two_scales.html Superb - spot on. Than

Re: Performance java vs. python

2009-05-20 Thread Ant
On May 20, 6:46 pm, namekuseijin wrote: > anyway, again, thanks for the laughs. I'm a Java developer in my day job, and I use Jython for testing out ideas and prototyping, due to the way Jython makes writing Java so much easier... Those examples were spot on - things weren't much simpler before g

Re: What text editor is everyone using for Python

2009-05-26 Thread Ant
On May 25, 6:35 pm, LittleGrasshopper wrote: > With so many choices, I was wondering what editor is the one you > prefer when coding Python, and why. I normally use vi, and just got I use GVim or vim if on a terminal. There are quite a few plugins and scripts I find invaluable, but most are not p

Pyparsing Question

2008-05-16 Thread Ant
;parser.py", line 50, in ? print comb.parseString(text + text2) . . [Stacktrace snipped] . raise exc pyparsing.ParseException: Expected start of line (at char 81), (line:9, col:1) Any help appreciated! Cheers, -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyparsing Question

2008-05-16 Thread Ant
will provide a base for extending the list format. Thanks, Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: complex numbers should respect the "I" representation

2008-06-28 Thread Ant
some respect for majority's rules. > This is childish. Do some research before flaming on a subject on which you only have one side of the story. -- Ant -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good time to start learning python?

2008-03-31 Thread Ant
On Mar 31, 5:40 pm, Rui Maciel <[EMAIL PROTECTED]> wrote: ... > So far the decision seems to be a no brainer. Yet, Python 3000 will arrive > in a few months. As it isn't backwards compatible with today's Python, > there is the risk that no matter what I learn until then, I will end up > having to r

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Ant
On Apr 3, 12:37 pm, [EMAIL PROTECTED] wrote: > What's the neatest and/or most efficient way of testing if one of a A different approach: >>> words = ["he", "sh", "bla"] >>> name = "blah" >>> True in (word in name for word in words) True >>> name = "bling" >>> True in (word in name for word in wo

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Ant
On Apr 3, 2:27 pm, George Sakkis <[EMAIL PROTECTED]> wrote: ... > It's even prettier in 2.5: > > any(word in name for word in words) > > George And arguably the most readable yet! -- http://mail.python.org/mailman/listinfo/python-list

Batteries Included...

2008-04-21 Thread Ant
Today's XKCD comic has a nice Python reference! http://xkcd.com/413/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Somebody *really* got fond of python

2008-04-21 Thread Ant
On Apr 21, 12:23 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > http://xkcd.com/413/ > > :) Didn't realise you'd posted this when I posted my "Batteries Included..." post. Amused me as well! -- http://mail.python.org/mailman/listinfo/python-list

Problem with Python shell through Cygwin Screen (Python/Vim/Screen combo)

2008-09-19 Thread Ant
Does anyone know if this is a known issue with screen/Python, or if there is a workaround, as I'd prefer to have just a single Python instance installed rather than having Cygwin python and windows Python both installed. Cheers, Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with Python shell through Cygwin Screen (Python/Vim/Screen combo)

2008-09-21 Thread Ant
CT, you will have to use Cygwin Python with screen. Thanks for the info. Shame but - cygwin python for this setup it is (Though I may hunt for a native windows port of screen rather than the cygwin one.) Cheers, Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: New python.org website

2006-03-08 Thread Ant
I like it personally. Nice clean look and feel, and the logo is much better than the old cheesy green python. Has a more professional feel to it, which can be important if you want to use the language outside of your free time... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Evangelism

2006-03-10 Thread Ant
e've got. 2) Some people on this newsgroup need to clean their fridges out more often! -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Tree and Graph structures in Python.

2006-03-14 Thread Ant
Hi all, Are there any tree or graph modules available for python? Cheers, -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: Tree and Graph structures in Python.

2006-03-15 Thread Ant
Thanks guys. The networkx and igraph packages look to have the sort of features I want. I'm surprised there's nothing in the standard module library really. -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: Become another user

2006-03-21 Thread Ant
Look at the os module: http://docs.python.org/lib/os-file-dir.html This has various functions you may find useful depending on how you want to go about it, such as chmod and chown. Cheers, -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 Schedule

2006-03-21 Thread Ant
Looks like some good new stuff coming along. Does anyone know what's happened to the path PEP (http://www.python.org/doc/peps/pep-0355/) - I thought I'd seen somewhere that that was originally planned for 2.5... -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: New-style Python icons

2006-03-21 Thread Ant
It's easier than that in this case. Just unpack the icons in yout Python directory over the top of the existing ones. The change should get picked up the next time you log on. -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-03-31 Thread Ant
decide what "for all x" should mean. We may just as well decide that for convenience: math.pi == 3. -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: Best IDE for Python?

2006-03-31 Thread Ant
f. None of the pure python IDE's/editors out there come close to the likes of jEdit, vim or emacs in terms of pure editing power. -- Ant... -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-03-31 Thread Ant
lol! -- http://mail.python.org/mailman/listinfo/python-list

Re: DOM and HTML

2006-04-02 Thread Ant
I've used Beautiful Soup, and it is a very pythonic way of accessing the data in the HTML. It is actually very similar to the way you access the DOM with JS - for example soup.html.body.h1 will give you the first h1 tag. There are also various other ways of searching the HTML in XPathish ways (if

Re: Assignment in a while?

2006-04-02 Thread Ant
There are various ways you could do this: If the number of results won't be too big: ... for result in sth.fetchall(): print result If it may be very large: ... result = sth.fetchone() while result: print result result = sth.fetchone() Or perhaps nicer: ... def result_iterator(res

Re: Assignment in a while?

2006-04-02 Thread Ant
Forget the last suggestion - I wasn't concentrating :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: what's going on here?

2006-04-04 Thread Ant
You are along the right lines. Try printing out the content of each URL - one of the pages will match your expression, but has additional instructions... I think you are reaching the end of their false trail when you get None returned from the url. The set of pages themselves are the linked list -

Re: using range() in for loops

2006-04-05 Thread Ant
It's not just a Python thing, Java for example generally uses the idiom: for (Iterator it = list.iterator(); it.hasNext(); ) { Object next = it.next(); //Do stuff to next } Horrible compared to the python idiom of course (though the latest version supports for (x : list){}) Ruby has some

Re: passing string from one file to another

2006-04-17 Thread Ant
I assume that you are trying to pass data from one 'standalone' cgi script to another cgi script (mail.py). Depending on what exactly you are trying to do, you could either set the information in a cookie, or simply have a hidden input () element in the HTML which gets populated by the initial cgi

GUIs - A Modest Proposal

2010-06-05 Thread ant
I get the strong feeling that nobody is really happy with the state of Python GUIs. Tkinter is not widely liked, but is widely distributed. WxPython and PyGtk are both powerful, but quirky in different ways. PyQt is tied to one platform. And there are dozens more. Whether or not we like graphics p

Re: GUIs - A Modest Proposal

2010-06-06 Thread ant
On Jun 6, 2:22 pm, ant wrote: > I get the strong feeling that nobody is really happy with the state of > Python GUIs. What an interesting set of responses I got! And - even more interesting - how few of them actually seem to think there is a problem, let alone make any attempt to mo

Re: GUIs - A Modest Proposal

2010-06-07 Thread ant
I rather feel like I'm flogging a dead horse here, but time for another mile... First off, I'm not volunteering to lead this effort. I don't think anyone should even think about that until and unless the Python Powers That Be actually decide that it is worth doing. That is what I meant by 'strong

Re: GUIs - A Modest Proposal

2010-06-09 Thread ant
Since I started this thread, I feel a sense of responsibility for it, in some bizarre way. Not to prolong its existence, which is clearly a troubling one for some, but to try to steer it towards some kind of consensus that will irritate the least number of people. Or better, that will gain some kin

Re: GUIs - A Modest Proposal

2010-06-10 Thread ant
I don't know whether this thread is going backwards, forwards or sideways. But a lot of useful information is creeping out of the woodwork. I like the points about backwards compatibility. Presumably that reason alone is enough to keep Tkinter in the standard library for a long while. But the poin

<    1   2   3   4   >