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

2009-01-14 Thread Rhodri James
documentation far too many times). We return you to your regularly scheduled original point... -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: problem calling method

2009-01-14 Thread Rhodri James
class without oversimplifying it? It would make it a lot easier to see what's going on. 3. There is no point 3. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

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

2009-01-14 Thread Rhodri James
extensions to communicate the necessary info to the external tool. Or, dare one say it, conventions? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

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

2009-01-14 Thread Rhodri James
On Thu, 15 Jan 2009 03:54:02 -, Paul Rubin http://phr.cx@nospam.invalid wrote: Rhodri James rho...@wildebst.demon.co.uk writes: Again, there have to be some language extensions to communicate the necessary info to the external tool. Or, dare one say it, conventions? If the language

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

2009-01-15 Thread Rhodri James
to write is the script that scans your C data structure and spits out a Python class or module that implements it with whatever degree of checking you want. That should make writing your actual data munger safer and faster, if I'm understanding you correctly. -- Rhodri James *-* Wildebeeste Herder

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

2009-01-15 Thread Rhodri James
that its more the case that once most programmers have been taught how to use the hammer that is C, all problems look like nails. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: reading file to list

2009-01-19 Thread Rhodri James
comprehension is actually quite a linguistically natural way to express the iterative construction of a list. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: A java hobbyist programmer learning python

2009-01-19 Thread Rhodri James
] self.arg1 = int(sys.argv[2]) self.arg2 = int(sys.argv[3]) If you want the test code to work, I think you mean: def __init__(self, op, arg1, arg2): self.operator = op self.arg1 = arg1 self.arg2 = arg2 :) -- Rhodri James *-* Wildebeeste Herder to the Masses

Re: Two questions about style and some simple math

2009-01-19 Thread Rhodri James
attributes in a separate class, but do you really need to prevent use of other class attribute names (sorry, the terminology crossover is inherently confusing) so much? Unless you think there's a serious danger of trying to add new character attributes on the fly, I think it's overkill. -- Rhodri

Re: Two questions about style and some simple math

2009-01-20 Thread Rhodri James
On Tue, 20 Jan 2009 02:11:24 -, Mensanator mensana...@aol.com wrote: On Jan 19, 7:44 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: Surely in any case you don't want an expression based on the difference, since that would give you the same chance of having the first attack no matter

Re: reading file to list

2009-01-20 Thread Rhodri James
On Tue, 20 Jan 2009 03:39:45 -, Xah Lee xah...@gmail.com wrote: On Jan 19, 4:49 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sun, 18 Jan 2009 08:31:15 -, Xah Lee xah...@gmail.com wrote: On Jan 17, 10:25 am, Tino Wildenhain t...@wildenhain.de wrote: [[int(x) for x

Re: pep 8 constants

2009-01-20 Thread Rhodri James
the distinction through CONVENTIONAL_NAMING_PRACTICE is useful. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: what's the point of rpython?

2009-01-20 Thread Rhodri James
to find. Even if you could find a platform supporting it, it doesn't help you on other platforms you may need to run on. Just do the locking properly and worry about optimisations later. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: what's the point of rpython?

2009-01-20 Thread Rhodri James
On Wed, 21 Jan 2009 02:29:01 -, Paul Rubin http://phr.cx@nospam.invalid wrote: Rhodri James rho...@wildebst.demon.co.uk writes: What cpu's do you know of that can atomically increment and decrement integers without locking? x86 (and pretty much any 8080 derivative, come to think

Re: reading file to list

2009-01-20 Thread Rhodri James
is a good thing (my personal list places more emphasis on the theory and practice of music, theology, literature and democracy, but anything is fair game), expanding one's ego is not. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: what's the point of rpython?

2009-01-20 Thread Rhodri James
On Wed, 21 Jan 2009 05:37:44 -, Paul Rubin http://phr.cx@nospam.invalid wrote: Rhodri James rho...@wildebst.demon.co.uk writes: In that case I'd second the suggestion of taking a long, hard look at the Linux core locking and synchronisation primatives. Do you understand what the issue

Re: reading file to list

2009-01-21 Thread Rhodri James
On Wed, 21 Jan 2009 09:42:19 -, Lars Behrens spam.bus...@web.de wrote: Rhodri James wrote: I *was* thinking of code produced in the real world, and I don't buy your assertion. I'm not an academic, and I wouldn't hesitate to lay down a line of code like that. As I said before, it fits

Re: reading file to list

2009-01-21 Thread Rhodri James
On Wed, 21 Jan 2009 09:13:03 -, Xah Lee xah...@gmail.com wrote: Rhodri James wrote: I recommend spending less time being certain that you are correct without seeking evidence I don't concur. For instance, when you are talking to a bunch of kids, you have to be sure of yourself, else

Re: unzip array of arrays?

2009-01-22 Thread Rhodri James
() already exists, there's always a list comprehension: [field(l) for l in a] If you want that specific list: [l[1] for l in a] [2, 4, 6] -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: What is intvar?

2009-01-22 Thread Rhodri James
on. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

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

2009-01-23 Thread Rhodri James
to the internals myself and presenting my fix for Fred's consideration. Python allows me to do this without the fuss and drama that strict encapsulation seems to posit is necessary, instead of delaying an entire release cycle because the process doesn't trust me. -- Rhodri James *-* Wildebeeste Herder

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

2009-01-23 Thread Rhodri James
three choices: 1) defeat the data hiding by talking to Fred directly; 2) defeat the data hiding by hacking away yourself and getting Fred's forgiveness later; 3) give up. See, we're back on topic! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python

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

2009-01-24 Thread Rhodri James
On Sun, 25 Jan 2009 00:31:14 -, Tim Rowe digi...@gmail.com wrote: 2009/1/24 Rhodri James rho...@wildebst.demon.co.uk: My experience with medium-sized organisations (50-100 people) is that either you talk to Fred directly, or it doesn't happen. In particular the more people (especially

Re: Exec woes

2009-01-28 Thread Rhodri James
of two elements, somestring to execute in globals() and locals() which is also unlikely to be what you want. Neither of these are giving you a string, file or code object, exactly as the interpreter is telling you. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org

Re: Exec woes

2009-01-29 Thread Rhodri James
On Thu, 29 Jan 2009 08:15:57 -, Hendrik van Rooyen m...@microcorp.co.za wrote: Rhodri James rho...@wildebst.demon.co.uk wrote: To: python-list@python.org Sent: Thursday, January 29, 2009 6:12 AM Subject: Re: Exec woes On Wed, 28 Jan 2009 07:47:00 -, Hendrik van Rooyen m...@mic

Re: is python Object oriented??

2009-02-01 Thread Rhodri James
On Sun, 01 Feb 2009 17:31:27 -, Steve Holden st...@holdenweb.com wrote: Stephen Hansen wrote: [...] don't play with anyone else's privates. A good rule in life as well as programming. Unless, of course, you're both consenting adults. What? Someone had to say it! -- Rhodri James

Re: Question about wx folder browser widget

2009-02-02 Thread Rhodri James
-- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-02 Thread Rhodri James
(though by no means impossible) to break language-enforced hiding when (not if) an interface turns out to be inadequate. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading text file with wierd file extension?

2009-02-02 Thread Rhodri James
for variable or attribute names, and leave MixedCase for class names.) -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: key capture

2009-02-02 Thread Rhodri James
? If the former, you are probably w/o luck because afaik there is no way to track the event of having random keys pressed the same time. Yes there is. You need to use one of the GUIs (Tkinter, wxPython, PyGame, etc), all of which will give you Key Down/Key Up events. -- Rhodri James *-* Wildebeeste

Re: is python Object oriented??

2009-02-02 Thread Rhodri James
). If it's that trivial to defeat something that its proponents appear to want to be close to an iron-clad guarantee, what on earth is the point of using private in the first place? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-03 Thread Rhodri James
On Tue, 03 Feb 2009 05:37:57 -, Russ P. russ.paie...@gmail.com wrote: On Feb 2, 7:48 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Tue, 03 Feb 2009 02:16:01 -, Russ P. russ.paie...@gmail.com wrote: Here we go again. If you have access to the source code (as you nearly

Re: is python Object oriented??

2009-02-03 Thread Rhodri James
the sudden volte face and declared that it was trivial to circumvent. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-03 Thread Rhodri James
On Wed, 04 Feb 2009 01:13:32 -, Russ P. russ.paie...@gmail.com wrote: On Feb 3, 4:05 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: I'm very much of the second opinion; it was Russ who did the sudden volte face and declared that it was trivial to circumvent. Whoa! Hold on a minute

Re: Use list name as string

2009-02-04 Thread Rhodri James
collected if it isn't assigned to a name somehow), or just as easily one or many names. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Feet and inches

2009-02-04 Thread Rhodri James
you think it is -- remember that inches is an int!) How can I also take into account all the cases that need an exception? How do you take care of any exception? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Use list name as string

2009-02-04 Thread Rhodri James
', 'because': 'it is a silly place' } demo(**myargs) {'because': 'it is a silly place', 'where': 'Camelot'} -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: where clause

2009-02-05 Thread Rhodri James
definitely possible. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Use list name as string

2009-02-05 Thread Rhodri James
No. The name of the object is a name. It doesn't really exist as an object at all. As others have said, if you really want this information you'll need to write your own class with a name attribute, and assign a suitable string to it. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http

Re: return multiple objects

2009-02-05 Thread Rhodri James
are optional, except for a couple of cases where you *have* to put them in to avoid ambiguity. I tend to put them in always, but leaving them out in cases like this seems to be normal practice.) -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Scanning a file character by character

2009-02-10 Thread Rhodri James
(and possibly hyphenation) are still a bit moot, though. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: re.sub and named groups

2009-02-11 Thread Rhodri James
, string methods, and string interpolation! So the moral of this story is take a ball of strings with you for when you get lost in regular expressions. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: select.poll.poll() never blocks

2009-02-11 Thread Rhodri James
checking the size of the file and reading more when that changes. You'll need to be very careful to keep what size you think the file is in sync with how much you've read! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with objects copying each other in memory

2009-02-12 Thread Rhodri James
a.append, it doesn't create a new list or anything like that, it just makes the existing list larger and tacks the new value on the end. Because it's still the same list as before, it's still got both names attached to it, so when you print 'b' out you see the changed list [1, 2, 3, 4]. -- Rhodri

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-12 Thread Rhodri James
On Thu, 12 Feb 2009 16:44:56 -, W. eWatson notval...@sbcglobal.net wrote: I simply ask, How do I get around the problem? Run your program from the command line, or by double-clicking. You've been told this several times now. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-12 Thread Rhodri James
the program. XP Pro. I then went to another machine that has never had pythonWin on it all, but does have python 2.5.2 with IDLE. I ran the same program there. W2K. In both cases, I got the output below. Your conclusions? That you haven't listened to a word anyone has said. -- Rhodri James

Re: Scanning a file character by character

2009-02-12 Thread Rhodri James
try re.split: re.split((\w+), The quick brown fox jumps, and falls over.)[1::2] ['The', 'quick', 'brown', 'fox', 'jumps', 'and', 'falls', 'over'] Using this code how would it load each word into a temporary variable. Why on earth would you want to? Just index through the list. -- Rhodri

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread Rhodri James
. I'd suggest spending a while reading up on version control systems. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-14 Thread Rhodri James
On Sat, 14 Feb 2009 05:03:13 -, W. eWatson notval...@sbcglobal.net wrote: See my response to Scott. Thanks for your reply. I did. It was fundamentally mistaken in so many respects that I formally give up on you. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http

Re: Referencing resources from python

2009-02-16 Thread Rhodri James
. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: how to assert that method accepts specific types

2009-02-20 Thread Rhodri James
around this is to gratuitously subclass Test: class AcceptableTest(object): pass class Test(AcceptableTest): @accepts(int, AcceptableTest) def check(self, obj): print obj -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: transpose array

2009-10-27 Thread Rhodri James
, , .join(t) -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Rhodri James
. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: If a class Child inherits from Parent, how to implement Child.some_method if Parent.some_method() returns Parent instance ?

2009-10-29 Thread Rhodri James
Child(...) -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Rhodri James
to help adding to the pool of programmers unaware of the command line, whatever platform that might be. This comment baffles me. The fact that you can say this and write How to program books terrifies me. Don't make me compare you to Herbert Schildt! -- Rhodri James *-* Wildebeest Herder

Re: Feedback wanted on programming introduction (Python in Windows)

2009-11-01 Thread Rhodri James
On Fri, 30 Oct 2009 03:26:45 -, Alf P. Steinbach al...@start.no wrote: * Rhodri James: On Thu, 29 Oct 2009 16:53:05 -, Alf P. Steinbach al...@start.no wrote: with the best knowledge of the program's environment, is unable to handle (such as delete) files or folders with paths

Re: Feedback desired on reworked ch 1 progr. intro (now Python 3.x, Windows)

2009-11-01 Thread Rhodri James
. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-11-01 Thread Rhodri James
On Sun, 01 Nov 2009 21:20:20 -, Alf P. Steinbach al...@start.no wrote: * Rhodri James: This is a weird attribution style, by the way. I don't think it helps. On Fri, 30 Oct 2009 03:26:45 -, Alf P. Steinbach al...@start.no wrote: * Rhodri James: On Thu, 29 Oct 2009 16:53:05

Re: About one class/function per module

2009-11-02 Thread Rhodri James
of realising that you needed to change A at all dropped dramatically. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-11-02 Thread Rhodri James
On Mon, 02 Nov 2009 00:49:50 -, Alf P. Steinbach al...@start.no wrote: * Rhodri James: On Sun, 01 Nov 2009 21:20:20 -, Alf P. Steinbach al...@start.no wrote: * Rhodri James: This is a weird attribution style, by the way. I don't think it helps. That's a pretty weird thing

Re: Pyfora, a place for python

2009-11-03 Thread Rhodri James
that B hasn't considered, and that A is making no assumption of any kind concerning B's intent. Say hello to the Law of Unintended Consequences. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonw.exe under Windows-7 (Won't run for one admin user)

2009-11-03 Thread Rhodri James
it not work for the admin user? Is there a traceback? What do you get if you try to invoke it from a command line? -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: parse a string (Cadence Allegro Netlist) to dictionary

2009-11-05 Thread Rhodri James
'): entry = [] results[sourcefile.next().strip( \t\n')] = entry elif line.startswith('NODE_NAME'): entry.append({1}.{2}.format(*line.split())) END CODE I'm a little dubious about doing mutable magic like this without copious comments, though. -- Rhodri James

Re: Can't Find Module

2009-11-09 Thread Rhodri James
line? -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation problems

2009-11-09 Thread Rhodri James
. If that last bit didn't make any sense to you, don't worry, just leave that particular adventure in computing for another day. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: is None or == None ?

2009-11-09 Thread Rhodri James
where there seem to be spare bits. But CPython will have to support 32 bit machines for several years. I've seen that mistake made twice (IBM 370 architecture (probably 360 too, I'm too young to have used it) and ARM2/ARM3). I'd rather not see it a third time, thank you. -- Rhodri James

Re: on Namespaces

2009-11-09 Thread Rhodri James
by that name 30 lines above. It's less about put modules in packages and more about put code in modules. Corollary: what happens after from somewhere import * is all your own fault. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: is None or == None ?

2009-11-10 Thread Rhodri James
On Tue, 10 Nov 2009 18:55:25 -, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Tue, 10 Nov 2009 15:46:10 +, Grant Edwards wrote: On 2009-11-10, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sun, 08 Nov 2009 19:45:31 -, Terry Reedy tjre...@udel.edu wrote

Re: Can't Write File

2009-11-11 Thread Rhodri James
is very, very stupid. CGI scripts normally run as a user with *very* limited permissions to limit (amongst other things) the damage ineptly written scripts can do. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonw.exe under Windows-7 (Won't run for one admin user)

2009-11-11 Thread Rhodri James
On Wed, 11 Nov 2009 04:51:38 -, SD_V897 sd_v...@nosuchmail.com wrote: Rhodri James wrote: On Tue, 10 Nov 2009 15:39:46 -, SD_V897 sd_v...@nosuchmail.com wrote: No, I'm asking you -- or rather your admin user -- to invoke the program that is giving you grief from the command line

Re: query regarding file handling.

2009-11-13 Thread Rhodri James
me out how to properly code thing . Read the line (as before), then split it on whitespace (the tabs in this case), and then sum the resulting list. Or as Chris said, get the 'csv' module to do the hard work for you. -- Rhodri James *-* Wildebeest Herder to the Masses -- http

Re: #define (from C) in Python

2009-11-13 Thread Rhodri James
to ignore you. In Python, however, the point is moot; you don't get to play those games without using a separate preprocessor. I've never particularly felt the urge to try, either. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Command line arguments??

2009-11-16 Thread Rhodri James
windowed GUIs encouraged users to put spaces in their file names (Apple, I'm looking at you!). Fundamentally, if people want the pretty they have to live with the consequences. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Command line arguments??

2009-11-17 Thread Rhodri James
On Tue, 17 Nov 2009 19:26:46 -, Nobody nob...@nowhere.com wrote: On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote: Quote the filenames or escape the spaces: C:\Python26\Python.exe C:\echo.py C:\New Folder\text.txt We've been living with this pain ever since windowed GUIs

Re: hex

2009-11-19 Thread Rhodri James
and error handling afterwards. My recommendation is that you don't do this: not prefixing your constants if they aren't decimal is an accident waiting to happen. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: IDE+hg

2009-11-23 Thread Rhodri James
to be capable of working with most source control systems. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw strings as input from File?

2009-11-24 Thread Rhodri James
/24/2009 08:16:42 ; 1259068602 What I get from the debugger/python shell: 'K:\\sm\\SMI\\des\\RS\\Pat\x08DJQ.D5-30Q5B-B-D5-BSHOE-MM.smz-/arch_m1/ smi/des/RS/Pat/10DJ/121.D5-30/1215B-B-D5-BSHOE-MM.smz ; t9480rc ; 11/24/2009 08:16:42 ; 1259068602' When you do what, exactly? -- Rhodri James

Re: Raw strings as input from File?

2009-11-24 Thread Rhodri James
On Wed, 25 Nov 2009 01:11:29 -, Rhodri James rho...@wildebst.demon.co.uk wrote: On Tue, 24 Nov 2009 21:20:25 -, utabintarbo utabinta...@gmail.com wrote: On Nov 24, 3:27 pm, MRAB pyt...@mrabarnett.plus.com wrote: .readlines() doesn't change the \10 in a file to \x08 in the string

Re: Some Basic questions on the use of CTRL and ALT Keys

2009-11-28 Thread Rhodri James
, and possibly even program specific. It seems the following site: http://knopok.net/symbol-codes/alt-codes is quite resourceful on Alt. *If* (and it's a big if) you're using Windows. Steven's point is very much worth bearing in mind. -- Rhodri James *-* Wildebeest Herder to the Masses -- http

Re: Which is more pythonic?

2009-12-03 Thread Rhodri James
to do things, and there's no point using a list comprehension when you aren't building a list. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: python proxy checker ,change to threaded version

2009-12-07 Thread Rhodri James
, *callback_args) for that last line. MyThread().start() This is one of the best uses I have seen for a nested class definition. Ditto! -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: question about imports in a class

2009-12-07 Thread Rhodri James
to and stop trying to make your life difficult! It doesn't in fact cost you anything, since Python caches the module the first time you load it precisely to avoid having to go back to the disc every time you want to reload it. -- Rhodri James *-* Wildebeest Herder to the Masses -- http

Re: question about imports in a class

2009-12-07 Thread Rhodri James
be: sysinfo.py: import os class ClassA(): sysinfo.os.walk() class ClassB(): sysinfo.os.walk() Nope. Good practice would be: import os class ClassA(object): os.walk() class ClassB(object): os.walk() -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman

Re: Graph library for Python

2009-12-08 Thread Rhodri James
(a, c, ac, is_directed=True), Edge(b, c, bc, style=dotted)], is_directed=True) I could see a use for this tracking a database structure using a constant graph, hence all set up in one go for preference. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org

Re: Graph library for Python

2009-12-09 Thread Rhodri James
On Wed, 09 Dec 2009 03:47:03 -, geremy condra debat...@gmail.com wrote: On Tue, Dec 8, 2009 at 8:42 PM, Rhodri James rho...@wildebst.demon.co.uk wrote: g = Graph( nodes=[Node(a, colour=red), Node(b, colour=white), Node(c, colour=blue)], edges=[Edge(a, b, ab

Re: Graph library for Python

2009-12-09 Thread Rhodri James
On Wed, 09 Dec 2009 23:42:13 -, geremy condra debat...@gmail.com wrote: On Wed, Dec 9, 2009 at 6:04 PM, Rhodri James rho...@wildebst.demon.co.uk wrote: On Wed, 09 Dec 2009 03:47:03 -, geremy condra debat...@gmail.com wrote: g = Graph( nodes={'a':{'colour':'red

Re: Immediate Help with python program!

2009-12-09 Thread Rhodri James
. It just keeps letting you input numbers until the computer wins even if you have three in a row. Sounds like you have a bug in your check-for-a-win function. That should be all the hint you need. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python

Re: read text file byte by byte

2009-12-12 Thread Rhodri James
if you prefer it: It's not a matter of preferring. Depending on your operating system and/or version of Python, reading a binary file without the b flag will give you wrong answers. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: read text file byte by byte

2009-12-13 Thread Rhodri James
\n. In Python 3.x, f.read(1) will read one character, which may be more than one byte depending on the encoding. If you really want bytes, opening the file in text mode will come back and by^Hite you eventually. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Rhodri James
Ugh. Magic characters. Let's not. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string substitution problem

2009-12-17 Thread Rhodri James
as before. Your problem is that you are conflating the compile-time processing of string literals with the run-time processing of strings specific to re. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string substitution problem

2009-12-19 Thread Rhodri James
On Fri, 18 Dec 2009 17:58:08 -, Alan G Isaac alan.is...@gmail.com wrote: On 12/17/2009 7:59 PM, Rhodri James wrote: re.compile('a\\nc') passes a sequence of four characters to re.compile: 'a', '\', 'n' and 'c'. re.compile() then does it's own interpretation: 'a' passes through

Re: Sort the values of a dict

2009-12-19 Thread Rhodri James
is a long way of writing l = d.items(), or l = list(d.items()) if you're using Python 3. :-) def third(q): return q[1][2] s = sorted(l, key=third) print s -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: iterators and views of lists

2009-12-19 Thread Rhodri James
the security provided by static type checking. You pays your money, you takes your choice; preferably, however, you don't do like a friend of mine and try to write FORTRAN in whatever language you're using! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman

Re: Ignore leading '' and ellipsis?

2010-01-14 Thread Rhodri James
= d ... base = x Well don't do that then. Snippy as that sounds, it's an entirely serious comment. You will learn more by doing it yourself than if you side-step your brain with cut and paste. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman

Re: Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-10 Thread Rhodri James
explaining what he wants. And sorry, but I have no idea what Python logic maps or Python logic flow charts either, or even what a inter-network connectivity diagram might have to do with them. An expansion of the original question is definitely in order. -- Rhodri James *-* Wildebeeste

Re: question on storing dates in a tuple

2010-02-10 Thread Rhodri James
, you probably just want to use str() to explicitly convert the object into a string. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: MODULE FOR I, P FRAME

2010-02-11 Thread Rhodri James
you'll have to decode the bitstream yourself. That could be rather painful if you're talking about MPEG-4/10. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: MODULE FOR I, P FRAME

2010-02-15 Thread Rhodri James
be better off writing a wrapper for one of the existing MP4 libraries. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: How to efficiently extract information from structured text file

2010-02-16 Thread Rhodri James
each object keep a list of its immediate sub-objects (which will have lists of their immediate sub-objects, and so on); it's fairly easy to keep track of which objects are current using a list as a stack. If you mean something else, sorry but my crystal ball is cloudy tonight. -- Rhodri

<    1   2   3   4   5   6   7   8   9   >