Re: Print Function

2012-09-22 Thread Mark Lawrence
taxError" will return a useful result. Tongue-firmly-in-cheek-ly y'rs, + one trillion -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Blue Screen Python

2012-09-22 Thread Mark Lawrence
implementing operating systems :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: cant install livewires

2012-09-23 Thread Mark Lawrence
go by, nothing is ever desperate anyway. Apart from that what have you tried and where did it go wrong? "I can't install livewires" isn't much to go on. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Client Needs---QA Manual Tester at Sacramento, CA

2012-09-23 Thread Mark Lawrence
e and possibly other places while you're at it, or does the whole world now revolve around G$? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Seome kind of unblocking input

2012-09-23 Thread Mark Lawrence
urnished a piece of information that doubtless not one other person on this group knew. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest web framework

2012-09-23 Thread Mark Lawrence
a bit less interesting. Worth keeping this in mind: http://www.codeirony.com/?p=9 Stefan I'd like to say thanks for the link but unfortunately for me, but good news for you (plural), is that I've bust a gut laughing out loud, so I won't :) Oh alright then thanks for t

Re: 'str' object does not support item assignment

2012-09-23 Thread Mark Lawrence
On 23/09/2012 19:31, jimbo1qaz wrote: spots[y][x]=mark fails with a "'str' object does not support item assignment" error,even though: a=[["a"]] a[0][0]="b" and: a=[["a"]] a[0][0]=100 both work. Spots is a nested list created as a co

Java singletonMap in Python

2012-09-23 Thread Mark Lawrence
e.com/recipes/498072-implementing-an-immutable-dictionary/ [4]http://code.activestate.com/recipes/66531-singleton-we-dont-need-no-stinkin-singleton-the-bo/ -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-23 Thread Mark Lawrence
ght it was, but my first impression was that foolist was a play on foolish. I also like the anti-pattern on the link namely:- for (index, value) in enumerate(alist): print index, value Fancy wasting time, money and effort typing those unnecessary round brackets. -- Cheers. Mark Lawrence

Re: Java singletonMap in Python

2012-09-24 Thread Mark Lawrence
On 24/09/2012 18:33, Duncan Booth wrote: Steven D'Aprano wrote: On Mon, 24 Sep 2012 00:14:23 +0100, Mark Lawrence wrote: Purely for fun I've been porting some code to Python and came across the singletonMap[1]. I'm aware that there are loads of recipes on the web for both si

Re: Java singletonMap in Python

2012-09-24 Thread Mark Lawrence
On 24/09/2012 20:22, Devin Jeanpierre wrote: On Sun, Sep 23, 2012 at 7:14 PM, Mark Lawrence wrote: Purely for fun I've been porting some code to Python and came across the singletonMap[1]. I'm aware that there are loads of recipes on the web for both singletons e.g.[2] and

Re: python file API

2012-09-24 Thread Mark Lawrence
eing a case of if it ain't broke don't fix it. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: python file API

2012-09-24 Thread Mark Adam
On Mon, Sep 24, 2012 at 5:55 PM, Oscar Benjamin wrote: > There are many situations where a little bit of attribute access magic is a > good thing. However, operations that involve the underlying OS and that are > prone to raising exceptions even in bug free code should not be performed > implicitl

Re: python file API

2012-09-25 Thread Mark Lawrence
On 25/09/2012 03:32, Mark Adam wrote: On Mon, Sep 24, 2012 at 5:55 PM, Oscar Benjamin wrote: There are many situations where a little bit of attribute access magic is a good thing. However, operations that involve the underlying OS and that are prone to raising exceptions even in bug free code

Re: which a is used?

2012-09-25 Thread Mark Lawrence
In a part of one thread he referred to my family as pigs. I've have lived with that, using the sticks and stones reply, but then someone had the audacity to protect his stance. I am sure that people have seen enough of his behaviour in the last few hours to see the real Dwight Hutto so I

Re: For Counter Variable

2012-09-25 Thread Mark Lawrence
check what features a programming environment or language offers before reinventing the wheel with four sides. Thankfully easier in a relatively concise language like Python as opposed to (say) Java. Which reminds me, in what version of Python are we getting the singletonMap? :) -- Cheers.

Article on the future of Python

2012-09-25 Thread Mark Lawrence
Hi all, I though this might be of interest. http://www.ironfroggy.com/software/i-am-worried-about-the-future-of-python -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-25 Thread Mark Lawrence
age. I really appreciate and rediscover the strictness I learned with Pascal. So go and use go as nobody here is stopping you. jmf -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-25 Thread Mark Lawrence
On 25/09/2012 10:53, Chris Rebert wrote: [snip] Well, the PSU might, except they emphatically do not exist... I know that they exist but if I admit to it I'd have to shoot myself. If I can get the bra off of the debutante that is. Cheers, Chris -- PEP-401 compliant -- Cheers.

Re: PHP vs. Python

2012-09-25 Thread Mark Lawrence
On 25/09/2012 11:22, Tejas wrote: How to configure python in apache2 ? So my html embedded code will works. Please follow the instructions that you'll find by searching the web. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: python file API

2012-09-25 Thread Mark Lawrence
On 25/09/2012 11:38, Oscar Benjamin wrote: On 25 September 2012 08:27, Mark Lawrence wrote: On 25/09/2012 03:32, Mark Adam wrote: On Mon, Sep 24, 2012 at 5:55 PM, Oscar Benjamin wrote: try: f.pos = 256 except IOError: print('Unseekable file') Something along t

Re: Memory usage per top 10x usage per heapy

2012-09-25 Thread Mark Lawrence
On 25/09/2012 11:51, Tim Chase wrote: [snip] If only other unnamed persons on the list were so gracious rather than turning the flame-dial to 11. Oh heck what have I said this time? -tkc -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-25 Thread Mark Lawrence
sing, how strange. I think the next port of call after the standard library should be pypi followed by the search engine, possibly targetted at sites like github, followed by a question here. I'm not certain about the next step, help please. -- Cheers. Mark Lawrence. -- http://mail.pyth

Re: gracious responses

2012-09-25 Thread Mark Lawrence
On 25/09/2012 12:40, Tim Chase wrote: On 09/25/12 06:10, Mark Lawrence wrote: On 25/09/2012 11:51, Tim Chase wrote: If only other unnamed persons on the list were so gracious rather than turning the flame-dial to 11. Oh heck what have I said this time? You'd *like* to take c

Re: gracious responses

2012-09-25 Thread Mark Lawrence
On 25/09/2012 13:44, alex23 wrote: On Sep 25, 9:39 pm, Tim Chase wrote: Mostly instigated by one person with a particularly quick trigger, vitriolic tongue, and a disregard for pythonic code. I'm sorry. I'll get me coat. Oi, back of the queue if you don't mind :) -

Re: new-style class or old-style class?

2012-09-25 Thread Mark Lawrence
lasses. Still, all things considered, it's a good trade. Thanks for this reminder, my port of the J word code to Python has just been simplified :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
e but do free RDBMes have the sales and marketing budgets that effectively shot down Ingres? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
ou know when it's time to make sure that you're safely strapped in and reach for and use the release button for the ejector seat. Further for somebody who is apparently up in the high tech world, why are you using a gmail account and hence sending garbage in more ways than one to mai

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
to plonk so few. ChrisA I tried to make a play on that some days ago and failed dismally. Thanks for putting me out of my misery :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
isery :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
combination of Python 3.3 and unicode as Hitler, Stalin and Pol Pot amongst others knew about human rights. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
pany. And around that time, some poor schmuck of a dev manager is telling his team what the sales guy sold. And that they have 12 weeks to design, build, and deliver it. How long did you just say??? I promised it in 8 weeks, not 12 you complete moron :) -- Cheers. Mark Lawrence

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
ibutor. I certainly prefer him to Xah Lee, who's attempts at improving Python documentation were beautifully torn to pieces here, IIRC by Ethan Furman, apologies to him and the actual author if I'm incorrect. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
an end user, this is the only thing that counts. The modern day Pinball Wizard? Or a physic? Or what? jmf #pseudo code for _ in range(-inf, +inf, 1): print(FUD) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on the future of Python

2012-09-26 Thread Mark Lawrence
On 27/09/2012 01:40, Steven D'Aprano wrote: On Wed, 26 Sep 2012 10:01:11 +0100, Mark Lawrence wrote: You remind me of the opening to the song Plaistow Patricia by Ian Dury and the Blockheads. While I always appreciate a good reference to Ian Dury, please stop feeding D.H.'s ego by

Re: Article on the future of Python

2012-09-27 Thread Mark Lawrence
ne has yet optimized this case. I have taken a liberty and raised this on the bug tracker quoting Steven D'Aprano's original figures and your response above. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on the future of Python

2012-09-27 Thread Mark Lawrence
On 27/09/2012 17:16, Devin Jeanpierre wrote: On Thu, Sep 27, 2012 at 10:25 AM, Steven D'Aprano wrote: On Thu, 27 Sep 2012 08:11:13 -0400, Devin Jeanpierre wrote: On Thu, Sep 27, 2012 at 2:13 AM, Steven D'Aprano wrote: On Tue, 25 Sep 2012 09:15:00 +0100, Mark Lawrence wrote: And

Re: Article on the future of Python

2012-09-27 Thread Mark Lawrence
On 27/09/2012 07:13, Steven D'Aprano wrote: On Tue, 25 Sep 2012 09:15:00 +0100, Mark Lawrence wrote: Hi all, I though this might be of interest. http://www.ironfroggy.com/software/i-am-worried-about-the-future-of- python And a response: http://data.geek.nz/python-is-doing-just

Re: Article on the future of Python

2012-09-27 Thread Mark Lawrence
On 27/09/2012 17:49, Chris Angelico wrote: On Fri, Sep 28, 2012 at 2:45 AM, Mark Lawrence wrote: The article Steven D'Aprano referred to is not a direct response to the article I referred to, yet your words are written as if it were. May I ask why? Or have I missed something? Steven

Re: Article on the future of Python

2012-09-27 Thread Mark Lawrence
nderfully. I understand from an earlier post that latin-9 meets your needs completely for all French language characters plus the Euro sign, why don't you simply use that and stop rabitting on about latin-1. jmf Would you please be so kind as to stand up as your voice is rather

Re: Article on the future of Python

2012-09-28 Thread Mark Lawrence
ch.py on both 3.2 and 3.3 on windows. Overall, Unicode is nearly as fast as bytes and 3.3 as fast as 3.2. Find/replace is the notable exception in stringbench, so it is an anomaly. Other things are faster in 3.3. I think this should be raised as a performance regression. I agree, and Mark d

Re: Python source code easy to hack?

2012-09-28 Thread Mark Lawrence
asked on numerous occasions so if you search the archives you're sure to get loads of answers. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.

2012-09-28 Thread Mark Lawrence
;t you be using the regex module from pypi instead of the standard library re? Guess who's borrowed the time machine? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.

2012-09-29 Thread Mark Lawrence
s regressed the performance of ''. Surely the Python devs can speed the performance back up and, just for us, use less memory at the same time? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.

2012-09-29 Thread Mark Lawrence
On 29/09/2012 11:05, Chris Angelico wrote: On Sat, Sep 29, 2012 at 7:38 PM, Mark Lawrence wrote: My understanding is that Python 3.3 has regressed the performance of ''. Surely the Python devs can speed the performance back up and, just for us, use less memory at the same time? Y

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Mark Lawrence
'll say me "learn python", why should I learn it over Ruby? Thanks! PS: I don't want to start a flame-war, I just want an advice if it's possible please! http://www.gossamer-threads.com/lists/python/python/129650?do=post_view_threaded -- Cheers. Mark Lawrence. -- http

Re: Slicing iterables in sub-generators without loosing elements

2012-10-01 Thread Mark Lawrence
th raising a feature request on the bug tracker? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-01 Thread Mark Lawrence
ready being using 3.3 to use this facility. I was hoping for a solution which was backwards compatible with Python 2.x. You don't need 3.3 to get py.exe. I've been running it for months, it's available here https://bitbucket.org/vinay.sajip/pylauncher/downloads -- Cheers. Mar

Re: Can't import modules

2012-10-01 Thread Mark Lawrence
milar to IDLE. Just python. With the arrival of pylauncher http://www.python.org/dev/peps/pep-0397/ you can also type py [options]. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-01 Thread Mark Lawrence
here some reason not to install 3.3? Fo those who missed it earlier you can download the launcher here https://bitbucket.org/vinay.sajip/pylauncher/downloads , you don't need Python 3.3. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Slicing iterables in sub-generators without loosing elements

2012-10-02 Thread Mark Lawrence
On 02/10/2012 17:12, Ramchandra Apte wrote: On Monday, 1 October 2012 13:47:50 UTC+5:30, Mark Lawrence wrote: On 01/10/2012 01:58, 8 Dihedral wrote: Your question seems vague to me. If you know you are storing only immutable tuples in a list, then the way to iterate is simple

Re: Are ABCs an anti-pattern?

2012-10-02 Thread Mark Adam
or organizing structures within the Python universe (like "object "collections" --> {'list','set','dict'...}, for example). mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Slicing iterables in sub-generators without loosing elements

2012-10-02 Thread Mark Lawrence
or mailing list and they simply won't believe ya :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: unit testing class hierarchies

2012-10-02 Thread Mark Lawrence
rror-prone, non-obvious solutions. Peter Otten's response is obviously vastly superior to yours, 4 tests in 0.000s compared to your highly inefficient 4 tests in 0.001s :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Emulating C++ namespaces with ChainMap and metaclass trickery

2012-10-03 Thread Mark Adam
On Wed, Oct 3, 2012 at 1:26 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > C++ namespaces are useful for encapsulating related objects within a > single file, subdividing the global namespace without using classes. > Python has modules, but they come in separate files. > > Us

Anybody know what's up with Gmane?

2012-10-04 Thread Mark Lawrence
e.org/gmane.comp.python.general shows the last post was the Steven D'Aprano thread titled "Emulating C++ namespaces with ChainMap and metaclass trickery" on 3 Oct at 20:26. I've tried flagging this up but obviously with no success. Anyone any ideas on how to sort this out? Kindes

Re: + in regular expression

2012-10-04 Thread Mark Lawrence
tiple repeat why the "\s{6}+" is not a regular pattern? Why are you too lazy to do any research before posting a question? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: final question: logging to stdout and updating files

2012-10-05 Thread Mark Lawrence
On 04/10/2012 15:27, Chris Angelico wrote: ensured that Australia won the next Test Match ChrisA may need to schedule surgical detongueing of his cheek I'll arrange the cheek detonguing very cheaply after a comment like that :) -- Cheers. Mark Lawrence. -- http://mail.python.org/ma

Re: final question: logging to stdout and updating files

2012-10-05 Thread Mark Lawrence
ate for c.l.p? I'm sure that with some appropriate grovelling the PSF could arrange this. Perhaps fly everybody to the UK for PyCon and get the surgery done on the NHS at the same time. Ramit -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-05 Thread Mark Lawrence
pep-0397/ and let us know whether or not it fits your needs on Windows. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: instance.attribute lookup

2012-10-05 Thread Mark Lawrence
ESP, a crystal ball, and a mind-reader!) ~Ethan~ My probably highly uneducated guess is that "Python-provided attribute" refers to double underscore names. YMMV by several trillion light years :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Mark Lawrence
a starting point as any http://www.velocityreviews.com/forums/t716131-challenge-escape-from-the-pysandbox.html ? Also throw "python experimental sandbox" into your search engine and follow your nose, something might come up smelling of roses :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is pylaucher in Python 3.3 being installed in Windows folder?

2012-10-06 Thread Mark Hammond
ersion - particularly for testing - eg: % py -3.2 script.py Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: wordnet semantic similarity: how to refer to elements of a pair in a list? can we sort dictionary according to the value?

2012-10-07 Thread Mark Lawrence
his exercise. How can we make each group of words (e.g. car-automobile, jounrney-voyage, gem-jewel) sorted according to their similarity value? Thanks for your tips. In your for loop save the data in a list rather than print it out and sort according to this http://wiki.python.org/moin/HowTo/Sorting#Operator_Module_Functions -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Private methods

2012-10-09 Thread Mark Lawrence
-methods-in-the-object-oriented -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: string contains and special characters

2012-10-09 Thread Mark Lawrence
the 'in' keyword. I see you've already corrected youself :) if "' in mystring: No need to escape any ASCII characters except backslash. No need to escape anything if raw strings are used. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Delete duplicate rows in textfile - except it contains a "{" or "}"

2012-10-10 Thread Mark Lawrence
Something like:- if "{" in line or "}" in line or line not in lines_seen: outfile.close() But it deletes also the lines with a closing bracket } and the lines with the same authordata. Therefor i need the condition of the brackets. Could someone point me out to adding this

Re: Private methods

2012-10-10 Thread Mark Lawrence
s readable, your use of CrapMail made life difficult until I stripped the superfluous newlines out. Is it really so awkward to equip yourself with a semi-decent mail reader? Like Thunderbird, hint, hint :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Static analysis tools

2012-10-11 Thread Mark Lawrence
'd also be willing to pay for a suitable tool. Windows or *ix tools would be fine. Any suggestions about things to check into? I've found clonedigger very useful http://clonedigger.sourceforge.net/ Not what you're asking for but figleaf is good as well http://darcs.idyll.org/~t/

Re: readline trick needed

2012-10-13 Thread Mark Lawrence
onder if he's *STILL* researching? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: readline trick needed

2012-10-13 Thread Mark Lawrence
On 13/10/2012 23:26, Joshua Landau wrote: On 13 October 2012 23:13, Mark Lawrence wrote: On 13/10/2012 22:31, Joshua Landau wrote: With two irritants (including 8), is it not advisable that python-list gets an admin to block these accounts? Even if it does nothing more than slow them

Re: readline trick needed

2012-10-13 Thread Mark Lawrence
On 13/10/2012 23:52, Mark Lawrence wrote: On 13/10/2012 23:26, Joshua Landau wrote: On 13 October 2012 23:13, Mark Lawrence wrote: On 13/10/2012 22:31, Joshua Landau wrote: With two irritants (including 8), is it not advisable that python-list gets an admin to block these accounts

Re: Understanding and dealing with an exception

2012-10-14 Thread Mark Lawrence
rror doing PIL.Image.open():", sys.exc_info()[0]) raise [snip] Vincent You've already had some advice so I'll just point out that a bare except is a bad idea as you wouldn't even be able to catch a user interrupt. Try (groan!) catching StandardError i

Re: Understanding and dealing with an exception

2012-10-14 Thread Mark Lawrence
On 14/10/2012 11:06, Terry Reedy wrote: On 10/14/2012 4:20 AM, Mark Lawrence wrote: You've already had some advice so I'll just point out that a bare except is a bad idea as you wouldn't even be able to catch a user interrupt. Try (groan!) catching StandardError instead. Ther

LinkedIn Python group discussions

2012-10-14 Thread Mark Lawrence
7;d want would be FUD or worse still complete crap being written in response to any thread and me not being in a position to reply. Is this something for the Python community here to be thinking about? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
On 15/10/2012 14:55, Debashish Saha wrote: how to insert random error in a programming? Just use some of my code, it's far more random than that suggested by others who've replied to your query. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
'f n onq vqrn. Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print ""

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
On 15/10/2012 20:51, Chris Angelico wrote: On Tue, Oct 16, 2012 at 6:28 AM, Mark Lawrence wrote: I like clearly written code like this " d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print "".join([d.get(c, c) for c in s]) S

Re: overriding equals operation

2012-10-17 Thread Mark Lawrence
On 17/10/2012 05:16, 8 Dihedral wrote: What you really want is b=a.copy() not b=a to disentangle two objects. __eq__ is used in the comparison operation. The winner Smartest Answer by a Bot Award 2012 :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Aggressive language on python-list

2012-10-17 Thread Mark Lawrence
start my campaign to be the first world president. Seven votes at the last count, another 3.5 billion and I'm first past the post. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest for system testing

2012-10-17 Thread Mark Lawrence
options here http://wiki.python.org/moin/PythonTestingToolsTaxonomy and an active mailing list that I read via gmane.comp.python.testing.general -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Aggressive language on python-list

2012-10-17 Thread Mark Lawrence
me and is partially deaf to boot is getting up my nose. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Mark Lawrence
sed? Any preferences? -[]z. I suggest re-reading PEP 8, particularly the section titled "A Foolish Consistency is the Hobgoblin of Little Minds" and specifically the first sentence of the third paragraph "But most importantly: know when to be inconsistent -- sometimes

Python interactive help()

2012-10-19 Thread Mark Lawrence
Good morning/afternoon/evening all, Where is this specific usage documented as my search engine skills have let me down? By this I mean entering help() without parameters to get the following output and then the help> prompt. C:\Users\Mark\workspace\CrossCode>py -3 Python 3.3.0 (

Re: Python interactive help()

2012-10-19 Thread Mark Lawrence
On 19/10/2012 09:56, Duncan Booth wrote: Mark Lawrence wrote: Good morning/afternoon/evening all, Where is this specific usage documented as my search engine skills have let me down? By this I mean entering help() without parameters to get the following output and then the help> pro

Re: Python on Windows

2012-10-19 Thread Mark Lawrence
/4750806/how-to-install-pip-on-windows :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Preventing crap email from google?

2012-10-19 Thread Mark Lawrence
named a quite well known programming language after a humorous BBC television programme? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Python 3.3 can't sort memoryviews as they're unorderable

2012-10-21 Thread Mark Lawrence
rary/stdtypes.html#typememoryview only gives examples of equality comparisons and there was nothing that I could see in PEP3118 to explain the rationale behind the lack of other comparisons. What have I missed? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: get each pair from a string.

2012-10-21 Thread Mark Lawrence
re is not :-) In the end I am going to what to get triples, quads... also. Thanks Vincent I suggest that you try taking slices out of your apple :) Start here http://docs.python.org/tutorial/introduction.html -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: some godd python blog?

2012-10-22 Thread Mark Lawrence
On 22/10/2012 17:01, nepaul wrote: Try using a search engine for specific Python issues that you'd like to read up on. If you can't find what you want please ask a specific question, that way you're far more likely to get some answers. -- Cheers. Mark Law

Re: Python 3.3 can't sort memoryviews as they're unorderable

2012-10-22 Thread Mark Lawrence
On 21/10/2012 12:24, Mark Lawrence wrote: http://docs.python.org/dev/whatsnew/3.3.html states "memoryview comparisons now use the logical structure of the operands and compare all array elements by value". So I'd have thought that you should be able to compare them and hence sort

Re: get each pair from a string.

2012-10-23 Thread Mark Lawrence
re using, has killed itself its own performances. (Replace 'apple' with 'ap需') jmf Please stop giving blatant lies on this list about Python speed. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Split single file into multiple files based on patterns

2012-10-23 Thread Mark Lawrence
x27; /path/to/your/file -- Alain. Although practicality beats purity :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: get each pair from a string.

2012-10-24 Thread Mark Lawrence
do it for free? -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: classes

2012-10-24 Thread Mark Lawrence
ct? why the prog is having this error with self nd x as arguments ??? What x argument? Clearly wrong as I've pointed out above. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: classes

2012-10-24 Thread Mark Lawrence
??? What x argument? Clearly wrong as I've pointed out above. How can i correct it ?? Put whatever it is you want appended to self.data in the call to y.addtwice. And/or get addtwice to return the correct data type. And/or correct anything that I've missed like I did the first

Re: [OT] Re: turn list of letters into an array of integers

2012-10-25 Thread Mark Lawrence
. What rubbish. It should either have been 4 million amps through it or 4 million volts across it. I'm +1 for the former, although possibly biased by history. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: bit count or bit set && Python3

2012-10-25 Thread Mark Lawrence
x27;ll need it to implement those operations, or their equivalents in terms of union and intersection.) Or do I need to drop into C for this? If needed bitarray and bitstring are available on pypi. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: bit count or bit set && Python3

2012-10-25 Thread Mark Lawrence
" solution using bin() and count() about 600 times faster than the mathematically clever solution using bitwise operations. You meant 600% I think? It took six times longer to do one hundredth the iterations. ChrisA Oh no, not another PEP 393 foul up :) -- Cheers. Mark Lawrence. -- h

Re: bit count or bit set && Python3

2012-10-25 Thread Mark Lawrence
e simple rule for Python performance is never guess anything as you'll invariably be wrong, time it and/or profile it, then change your code if and only if you have to. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >