Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Mark Lawrence
On 09/03/2016 12:02, BartC wrote: On 09/03/2016 08:40, Mark Lawrence wrote: Here's another: you have a program in Python that you'd quite like to port to another dynamic language. Transcribing actual Python code is straightforward. Until you come to an import of a module that you

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Mark Lawrence
On 09/03/2016 23:14, BartC wrote: On 09/03/2016 21:13, Mark Lawrence wrote: On 09/03/2016 12:02, BartC wrote: On 09/03/2016 08:40, Mark Lawrence wrote: Here's another: you have a program in Python that you'd quite like to port to another dynamic language. Transcribing actual Pyth

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Mark Lawrence
On 10/03/2016 00:58, BartC wrote: On 09/03/2016 23:35, Mark Lawrence wrote: On 09/03/2016 23:14, BartC wrote: (The byte-code compiler for the current version is written in itself. It can compile itself (some 25Kloc) in about 1 second (that's running interpreted, dynamic byte-code on

Re: Installing ibm_db package on Windows 7, 64-bit problem

2016-03-10 Thread Mark Lawrence
act that it takes hours to download and install, even with a high speed broadband link. Steve Dower is attempting to get his Microsoft colleagues to produce a bare minimum that could be used to build Python. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do fo

Re: Read and count

2016-03-10 Thread Mark Lawrence
3. I'd recommend starting with the latter if that's possible. fo.close() Not needed if you use the 'with' keyword as discussed above. Many thanks No problem as I'm leaving you to put it all together :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-10 Thread Mark Lawrence
On 10/03/2016 11:50, BartC wrote: On 10/03/2016 07:30, Mark Lawrence wrote: On 10/03/2016 00:58, BartC wrote: You think a bloody great compiler is a microbenchmark?! I have no interest in the speed of the compiler, I am interested in the run time speed of the applications that it produces

Re: How to program round this poplib error?

2016-03-10 Thread Mark Lawrence
ept in your code that catches poplib.error_proto? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-10 Thread Mark Lawrence
On 10/03/2016 12:47, BartC wrote: On 10/03/2016 12:15, Mark Lawrence wrote: On 10/03/2016 11:50, BartC wrote: Suppose you were on the development team that writes the optimising stages of a C compiler. You need to test the performance of the code it produces so that you can compare one

Re: looping and searching in numpy array

2016-03-10 Thread Mark Lawrence
tion has been asked before. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-10 Thread Mark Lawrence
peed/PerformanceTips -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation in Python

2016-03-10 Thread Mark Lawrence
[1] - http://stackoverflow.com/q/4555932 I suggest that you reread the stackoverflow link that you've quoted, and take great notice of the response from Lennart Regebro, even if it has been downvoted. -- My fellow Pythonistas, ask not what our language can do for you, ask what you ca

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-10 Thread Mark Lawrence
u, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation in Python

2016-03-10 Thread Mark Lawrence
ways 21 and the name is always 'Cool Dude'. So you can vary the age and name you'd need:- class person(): def __init__(self, age, name): self.age = age self.name = name -- My fellow Pythonistas, ask not what our language can do for you, ask what you can

Re: context managers inline?

2016-03-10 Thread Mark Lawrence
context manager via the 'with' keyword, or you leave the one line as is and forego the context manager. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Review Request of Python Code

2016-03-10 Thread Mark Lawrence
Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple exercise

2016-03-10 Thread Mark Lawrence
ather than two lists. Off of the top of my head a counter or a defaultdict. names.append(name) # new entry totals.append(value) for i in range(len(names)): print (names[i],totals[i]) Always a code smell when range() and len() are combined. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: non printable (moving away from Perl)

2016-03-10 Thread Mark Lawrence
-- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple exercise

2016-03-10 Thread Mark Lawrence
On 11/03/2016 01:45, BartC wrote: On 11/03/2016 01:21, Mark Lawrence wrote: On 11/03/2016 00:05, BartC wrote: def last(a): return a[-1] def init(a): # all except last element return a[0:len(a)-1] What is wrong with a[0:1] ? The returns the head of the list. I

Re: Simple exercise

2016-03-10 Thread Mark Lawrence
t what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello

2016-03-11 Thread Mark Lawrence
. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: a clarification on the "global" statement sought

2016-03-11 Thread Mark Lawrence
equivalent to a python file, correct?) Correct. TIA for any thoughts. cts -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: (unknown)

2016-03-11 Thread Mark Lawrence
for your OS. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: issue with CVS module

2016-03-11 Thread Mark Lawrence
hon.org/3/library/csv.html#csv.Dialect.doublequote -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-11 Thread Mark Lawrence
you *NEVER, EVER* create strings like this. Given that you've admitted earlier today that you couldn't get a simple slice to work, how much, if anything, do you actually know about Python? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our

Re: hasattr() or "x in y"?

2016-03-11 Thread Mark Lawrence
makes them not interchangable, but given we're only interested in the current dict... Dict, don't you mean collection? Or, to put it another way, what exactly were you originally asking? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our

Re: hasattr() or "x in y"?

2016-03-11 Thread Mark Lawrence
call last): File "", line 1, in AttributeError: 'str' object has no attribute 'hasattr' Since they behave differently, perhaps the question ought to be "which does what you want to do?" The BartC answer would be that it doesn't matter provided it runs

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-11 Thread Mark Lawrence
On 11/03/2016 22:24, BartC wrote: On 11/03/2016 21:59, Mark Lawrence wrote: On 11/03/2016 18:57, BartC wrote: def test(): s="" for i in range(1000): s+="*" print (len(s)) test() The minor snag that you might like to correct with your micro

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-12 Thread Mark Lawrence
On 12/03/2016 10:31, BartC wrote: On 12/03/2016 10:06, alister wrote: On Fri, 11 Mar 2016 22:24:45 +, BartC wrote: On 11/03/2016 21:59, Mark Lawrence wrote: On 11/03/2016 18:57, BartC wrote: def test(): s="" for i in range(1000): s+="*"

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-12 Thread Mark Lawrence
A string CALL_FUNCTION 1 You might be right: doing an unnecessary global name lookup and executing a function call are unlikely to have any impact on performance... Function calls are hugely expensive in Python. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-12 Thread Mark Lawrence
at our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-12 Thread Mark Lawrence
Python. I'll leave you to quote a few as you are such an expert in the Python programming language. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-12 Thread Mark Lawrence
On 13/03/2016 01:20, Steven D'Aprano wrote: On Sun, 13 Mar 2016 04:02 am, Mark Lawrence wrote: So I am clearly not the only programmer in the world who couldn't care less about speed. For somebody who couldn't care less, you sure do keep going on and on and on and on and o

Re: Simple exercise

2016-03-14 Thread Mark Lawrence
brary/itertools.html#itertools.zip_longest -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: programeren met python

2016-03-14 Thread Mark Lawrence
emc.uwaterloo.ca/nl/ (which is in Dutch) You can always ask your questions here of course (in English). Good luck! Irmen de Jong Such a wonderful response has made my day :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence

Re: Descriptors vs Property

2016-03-14 Thread Mark Lawrence
-- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
r/ -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
On 14/03/2016 17:53, BartC wrote: On 14/03/2016 17:17, Mark Lawrence wrote: On 13/03/2016 20:12, Marko Rauhamaa wrote: BartC : Exactly why having ready-made solutions is preferable to everyone hacking their own solutions to switch. A developer friend of mine once said insightfully that the

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
) so that it displays "two" "one". Global. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
atest entry into the race, BartCPython, all vapourware. At least rr knows something about tkinter/IDLE, whereas the latter appears to know squat about anything. You can fool all of the programmers, all of the time? -- My fellow Pythonistas, ask not what our language can do for you, ask wha

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 14/03/2016 22:07, BartC wrote: On 14/03/2016 21:23, Mark Lawrence wrote: Python 2.8, RickedPython, and the latest entry into the race, BartCPython, all vapourware. I'm not creating a new version of Python or CPython (you should have used an underscore). But I do have conside

Re: OTish Wells Fargo sucks

2016-03-14 Thread Mark Lawrence
hich to pull tongue from cheek. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 14/03/2016 22:40, BartC wrote: On 14/03/2016 22:20, Mark Lawrence wrote: On 14/03/2016 22:07, BartC wrote: On 14/03/2016 21:23, Mark Lawrence wrote: Python 2.8, RickedPython, and the latest entry into the race, BartCPython, all vapourware. I'm not creating a new version of Pyth

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 14/03/2016 23:56, BartC wrote: On 14/03/2016 23:19, Mark Lawrence wrote: On 14/03/2016 22:40, BartC wrote: Was that in Python? It was /supposed/ to be dreadful. I was making a case for it to be supported directly. You mean the huge great long list of hard coded function calls. They are

Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread Mark Lawrence
ck :) E.g. x = "apple" x-list = ["apple", "banana", "peach"] If x == x-list: print('Comparison is True') else: print('Comparison is False') if x in x-list: ... -- My fellow Pythonistas, ask not what our language can

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 15/03/2016 00:25, Chris Angelico wrote: On Tue, Mar 15, 2016 at 11:17 AM, rurpy--- via Python-list wrote: On 03/14/2016 05:19 PM, Mark Lawrence wrote: On 14/03/2016 22:40, BartC wrote: [...a polite and reasonable comment...] Drivel. Any establised member of this community, or any other

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 15/03/2016 00:56, Chris Angelico wrote: On Tue, Mar 15, 2016 at 11:47 AM, Mark Lawrence wrote: Same old story. BartC spouts drivel, just like the RUE, or Nick "The Webmaster" Greek, I'm in trouble for pointing it out. When he provides some *EVIDENCE* to back up his claims

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 15/03/2016 01:10, BartC wrote: On 15/03/2016 00:28, Mark Lawrence wrote: On 14/03/2016 23:56, BartC wrote: Anything so terrible about that that Python needs to keep well clear of or that you think its users should be deprived of? Yes, it is not even valid Python. Switch has been

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 15/03/2016 02:01, Steven D'Aprano wrote: On Tue, 15 Mar 2016 10:19 am, Mark Lawrence wrote: There is no need to optimise python, it is fast enough. I should of course have said on the end " for (say) 99% of purposes". Somebody should tell the core developers like B

Re: Case Statements

2016-03-15 Thread Mark Lawrence
u, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Case Statements

2016-03-15 Thread Mark Lawrence
e http://code.activestate.com/recipes/269708-some-python-style-switches/ -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Case Statements

2016-03-15 Thread Mark Lawrence
ot what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Case Statements

2016-03-15 Thread Mark Lawrence
than:- x.makeNoise() ? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Case Statements

2016-03-16 Thread Mark Lawrence
On 16/03/2016 08:13, Christian Gollwitzer wrote: Am 16.03.16 um 05:26 schrieb Mark Lawrence: So you would rather write something like:- switch (x): case COW: moo() break case DUCK: quack() break default IDUNNO: panic() than:- x.makeNoise() No sane person

Re: Case Statements

2016-03-16 Thread Mark Lawrence
On 16/03/2016 09:35, Antoon Pardon wrote: Op 16-03-16 om 09:47 schreef Mark Lawrence: Same with switch. You can use a hash table etc. to simulate switches, but only if the codeblocks are independent. Otherwise, if-elif chains are the way to go. Command line parsing is a case where switch

Re: Case Statements

2016-03-16 Thread Mark Lawrence
On 16/03/2016 10:52, Antoon Pardon wrote: Op 16-03-16 om 10:51 schreef Mark Lawrence: On 16/03/2016 09:35, Antoon Pardon wrote: Op 16-03-16 om 09:47 schreef Mark Lawrence: Same with switch. You can use a hash table etc. to simulate switches, but only if the codeblocks are independent

Re: Case Statements

2016-03-18 Thread Mark Lawrence
On 16/03/2016 11:16, BartC wrote: On 16/03/2016 11:07, Mark Lawrence wrote: I don't want to discourage you too much, but I think that adding a switch statement comes *very* low on the list of improvements we would like to make in Python 3.5. We should probably focus on speed ... OK, y

Re: sobering observation, python vs. perl

2016-03-18 Thread Mark Lawrence
quot; mode. I believe it is more along the lines of "In Rome, do as the Romans". -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: empty clause of for loops

2016-03-19 Thread Mark Lawrence
n do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Case Statements

2016-03-19 Thread Mark Lawrence
On 16/03/2016 13:15, [email protected] wrote: What hath I wrought? The Comfy Chair :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: DSLs in perl and python (Was sobering observation)

2016-03-19 Thread Mark Lawrence
Can you do better in perl? I neither know, nor do I care. Why not ask on a perl list? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: How to waste computer memory?

2016-03-19 Thread Mark Lawrence
On 19/03/2016 04:05, Ian Kelly wrote: On Fri, Mar 18, 2016 at 3:19 PM, Mark Lawrence wrote: I have no idea at what the above can mean, other than that you are agreeing with the RUE. Mark, are you aware that this is a rather classic ad hominem of guilt by association? "I didn'

Re: Case Statements

2016-03-19 Thread Mark Lawrence
guage. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: problem with python 3.5.0

2016-03-19 Thread Mark Lawrence
download numpy-1.11.0rc1+mkl-cp35-cp35m-win32.whl. I don't know when the full release of numpy1.11 is due out. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Case Statements

2016-03-19 Thread Mark Lawrence
On 16/03/2016 13:38, Antoon Pardon wrote: Op 16-03-16 om 12:07 schreef Mark Lawrence: Raise the item on the python-ideas mailing list for the umpteenth time then, and see how far you get. I don't care enough. I do care about people using valid arguments. Arguments have been made fo

Re: Case Statements

2016-03-19 Thread Mark Lawrence
On 16/03/2016 19:41, BartC wrote: On 16/03/2016 09:51, Mark Lawrence wrote: On 16/03/2016 09:35, Antoon Pardon wrote: So I guess those who would like a case statement in Python can only hope a core developer gets bitten by a nasty bug while using one of those ways of simulating switches

Re: How to waste computer memory?

2016-03-19 Thread Mark Lawrence
hat you are agreeing with the RUE. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: How to waste computer memory?

2016-03-19 Thread Mark Lawrence
ing a fib, IIRC it was 0 1. Sales and marketing did not get the joke about it being a "two bit company". -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: WP-A: A New URL Shortener

2016-03-19 Thread Mark Lawrence
. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Need help on a project To :"Create a class called BankAccount with the following parameters "

2016-03-19 Thread Mark Lawrence
On 19/03/2016 21:40, [email protected] wrote: What was the final answer for the create class bankaccount question? 42. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman

Re: How to waste computer memory?

2016-03-20 Thread Mark Lawrence
care? I swear blind that you stated a few days back that you, and hence your newly published language, couldn't care about unicode. Have I got it wrong? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail

Re: Case Statements

2016-03-20 Thread Mark Lawrence
On 20/03/2016 08:01, Rustom Mody wrote: On Wednesday, March 16, 2016 at 5:51:21 PM UTC+5:30, Marko Rauhamaa wrote: BartC : On 16/03/2016 11:07, Mark Lawrence wrote: but I still very much doubt we'll be adding a switch statement -- it's a "sexy" language design issue I

Re: TSP in python ; this is code to solve tsp whenever called, where given coordinates as in name of pos and then start coordinate as in start, help me how it works ?

2016-03-20 Thread Mark Lawrence
On 18/03/2016 17:04, Qurrat ul Ainy wrote: help required !!! For what, house cleaning? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Case Statements

2016-03-20 Thread Mark Lawrence
On 16/03/2016 15:27, Antoon Pardon wrote: Op 16-03-16 om 15:02 schreef Mark Lawrence: On 16/03/2016 13:38, Antoon Pardon wrote: Op 16-03-16 om 12:07 schreef Mark Lawrence: Raise the item on the python-ideas mailing list for the umpteenth time then, and see how far you get. I don't

Re: Fetch Gmail Archieved messages

2016-03-20 Thread Mark Lawrence
- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: E-commerce system in Python

2016-03-20 Thread Mark Lawrence
language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Output format

2016-03-20 Thread Mark Lawrence
https://docs.python.org/3/library/string.html#string-formatting https://docs.python.org/3/library/string.html#template-strings -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-20 Thread Mark Lawrence
use of switch is shown below [not Python]. A tokeniser along those lines in Python, with most of the bits filled in, is here: http://pastebin.com/dtM8WnFZ I got to line 22, saw the bare except, and promptly gave up. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-20 Thread Mark Lawrence
On 21/03/2016 01:35, Chris Angelico wrote: On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence wrote: I got to line 22, saw the bare except, and promptly gave up. Oh, keep going, Mark. It gets better. def readstrfile(file): try: data=open(file,"r").read()

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-20 Thread Mark Lawrence
On 21/03/2016 02:04, BartC wrote: On 21/03/2016 01:35, Chris Angelico wrote: On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence wrote: I got to line 22, saw the bare except, and promptly gave up. Oh, keep going, Mark. It gets better. def readstrfile(file): try: data=open(file,&q

Re: Why do you use python?

2016-03-20 Thread Mark Lawrence
roblems instead of limiting yourself to just one??? I'm not quite sure why you've replied to a five year old thread, but I'd suggest that the employers' main concern is Total Cost of Ownership. -- My fellow Pythonistas, ask not what our language can do for you, as

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
.) Once again, you forget that there are not 256 characters - there are 1114112. (Give or take.) ChrisA Head. Wall. Bang. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
le numbers just like * and /, so should have the same precedence.) Python is not C. This is not a bug. The rules are here https://docs.python.org/3/reference/expressions.html#operator-precedence -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for

Re: WConio won't install in Python 3.4

2016-03-21 Thread Mark Lawrence
onistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Convert list to another form but providing same information

2016-03-21 Thread Mark Lawrence
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Convert list to another form but providing same information

2016-03-21 Thread Mark Lawrence
elements of the sublists also changes. I dunno why... https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
On 21/03/2016 19:43, BartC wrote: On 21/03/2016 02:02, Mark Lawrence wrote: On 21/03/2016 01:35, Chris Angelico wrote: On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence wrote: I got to line 22, saw the bare except, and promptly gave up. Oh, keep going, Mark. It gets better. def readstrfile

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
r language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
://docs.python.org/3/library/stdtypes.html#typememoryview -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-21 Thread Mark Lawrence
Please state your OS and Python version, the code that you've tried and exactly what went wrong, including the full traceback if there is one. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.pytho

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-22 Thread Mark Lawrence
other objects. The abstraction is that you pass objects around, not references to objects. The devil is in the mutables... Whereby these mysterious "pointers" suddenly leap into action I take it? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-23 Thread Mark Lawrence
work well (duplicating the rest of the string roughly every other character). It would work perfectly. How would it duplicate the rest of the string roughly every other character? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark L

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-23 Thread Mark Lawrence
fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-23 Thread Mark Lawrence
On 23/03/2016 16:24, Random832 wrote: On Wed, Mar 23, 2016, at 12:08, Mark Lawrence wrote: And doing it 'Pythonically' can lead to suggestions such as the following the other day: c, psource = psource[0], psource[1:] (where psource is a very long string), which even I could

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-23 Thread Mark Lawrence
On 23/03/2016 23:55, Steven D'Aprano wrote: On Thu, 24 Mar 2016 03:24 am, Random832 wrote: On Wed, Mar 23, 2016, at 12:08, Mark Lawrence wrote: And doing it 'Pythonically' can lead to suggestions such as the following the other day: c, psource = psource[0], psource[1:] (w

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-24 Thread Mark Lawrence
our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-24 Thread Mark Lawrence
e who have died laughing. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-24 Thread Mark Lawrence
It's just fantastic, you don't have to bother about the source code that you write, all you have to bother about is the underlying byte code. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mai

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-24 Thread Mark Lawrence
x27;B' doesn't care provided it is quick. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

<    14   15   16   17   18   19   20   21   22   23   >