Re: 403 forbidden error
On Monday, October 27, 2014 11:05:04 AM UTC+5:30, Chris Angelico wrote: > On Mon, Oct 27, 2014 at 4:12 PM, Diya Rai wrote: > > This is the part of the code which im trying to execute. We are trying to > > load test a web application through python script, currently checking the > > login part. > > > > Does it work when you log in using a web browser? If so, grab a > browser with debugging facilities (Firefox with Firebug, or Chrome > with its F12 box, or something), do the login, and have a look at > exactly what request headers are being sent. Then compare with what > your script is doing. Once you have the two side by side, you can > progressively work through it until you figure out which header makes > the difference - maybe your script isn't sending Host, or maybe you > need a cookie from a previous request, or maybe it's actually checking > the Referer and rejecting if it isn't right. Could be all sorts of > things. > > Good luck! Might be a tedious job, or might be the first thing you try. > > ChrisA Thanks a lot ChrisA It works fine while logging in through browser. Im using firefox, and have checked the headers with firebug. I tried passing all the headers and it works while passing the cookie header. My question is whether is it the correct way to try or can i write python script in such a way that it can handle it automatically. Currently for checking login page, it would be fine.But when we go for testing registration page it become tedious. I would also like to get your opinion on load testing with python script. Thanks in advance, Diya -- https://mail.python.org/mailman/listinfo/python-list
Re: 403 forbidden error
On Mon, Oct 27, 2014 at 4:12 PM, Diya Rai wrote: > This is the part of the code which im trying to execute. We are trying to > load test a web application through python script, currently checking the > login part. > Does it work when you log in using a web browser? If so, grab a browser with debugging facilities (Firefox with Firebug, or Chrome with its F12 box, or something), do the login, and have a look at exactly what request headers are being sent. Then compare with what your script is doing. Once you have the two side by side, you can progressively work through it until you figure out which header makes the difference - maybe your script isn't sending Host, or maybe you need a cookie from a previous request, or maybe it's actually checking the Referer and rejecting if it isn't right. Could be all sorts of things. Good luck! Might be a tedious job, or might be the first thing you try. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: 403 forbidden error
On Wednesday, October 22, 2014 5:07:00 PM UTC+5:30, Diya Rai wrote: > Hai, > > Could anyone please help me to resolve 403 forbidden error while logging > into an application. > > Following is the error details: > > Traceback (most recent call last): > File "./example6.py", line 18, in > response = urllib2.urlopen(req) > File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen > return _opener.open(url, data, timeout) > File "/usr/lib/python2.7/urllib2.py", line 406, in open > response = meth(req, response) > File "/usr/lib/python2.7/urllib2.py", line 519, in http_response > 'http', request, response, code, msg, hdrs) > File "/usr/lib/python2.7/urllib2.py", line 444, in error > return self._call_chain(*args) > File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain > result = func(*args) > File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default > raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) > urllib2.HTTPError: HTTP Error 403: FORBIDDEN > > > Sorry if the question is not relevant as im new to python. > > > Regards, > Diya Thanks Chris Angelico and Dennis Lee Bieber for replying. Username and password is correct. Its a simple login script. import urllib import httplib2 http = httplib2.Http() url = 'http://localhost/login_ajax' body = {'email': 'x...@google.com', 'password': '***'} headers = {'Content-type': 'application/x-www-form-urlencoded'} response, content = http.request(url, 'POST', headers=headers, body=urllib.urlencode(body)) print response This is the part of the code which im trying to execute. We are trying to load test a web application through python script, currently checking the login part. Thanks in advance, Diya -- https://mail.python.org/mailman/listinfo/python-list
Python Fabric on Windows :
Hi Team , Iam new to Fabric and Iam using the fab command-line tool to run a set of task on Linux clients. I just started coding and Iam pretty new to fabric, Iam hoping I will be able to launch my fabric scripts from both Windows and Linux Machine . Installing Cygwin might help in windows case I guess. please suggest if you foresee problems using fabric on Windows and also suggest an alternative to this if available. . Regards, Ganesh -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
On Mon, 27 Oct 2014 14:10:01 +1100, Chris Angelico wrote: >On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote: >> Right. There is line-by-line history, and editing enabled with the >> readline plug-in. (This is an advantage of using a programmer-friendly >> operating system, which MS Windows sadly is not.) > >You can get block-by-block history by using Idle. I find that fairly >convenient for manipulating class/function definitions. > >ChrisA Thanks BTW I am using XP some and Win7 some too. -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
On Mon, 27 Oct 2014 14:06:11 +1100, Ben Finney wrote: >Seymore4Head writes: > >> I am trying to learn classes. >> I am currently using Python 2.7 at the command line. > >(I think you mean the interactive Python interpreter, or just the >Python shell.) > >Since you are learning Python, I will strongly recommend you ignore >Python 2 unless it becomes unavoidable. > At the moment, it is unavoidable. The instructors are teaching Python 2 so I have to learn Python 2, for now. >Instead, learn Python 3 primarily; it is much better because it omits a >bunch of legacy behaviour you don't need. > >> If you try to type commands at the [interactive shell] and make the >> slightest mistake you have to start over. > >Right. There is line-by-line history, and editing enabled with the >readline plug-in. (This is an advantage of using a programmer-friendly >operating system, which MS Windows sadly is not.) > >> I was trying to copy and paste these instructions into the >> [interactive Python shell]. >> >> http://en.wikibooks.org/wiki/Python_Programming/Classes >> >>> class Foo: >> ... def setx(self, x): >> ... self.x = x >> ... def bar(self): >> ... print self.x >> >> There is really no way to do that without pasting line by line is >> there and adding deleting spaces? And if you use spaces and tabs, >> they are not the same. > >Right on all counts. > >The interactive Python shell is good for very quickly experimenting and >demonstrating how Python actually behaves, statement by statement. But >as you point out, it is not a good choice for anything more complex. It >is a good learning and debugging tool. > >When you start to write larger units of code, like a class or a >function, you can trade immediacy for flexibility: write your code into >a text editor, save it to a file foo.py, then run that code at a >separate OS command prompt by invoking python foo.py in the terminal. > >That way, you can continue to adjust and tweak the code as you learn how >your changes affect the code. You do need to keep invoking the actions >separately edit the file, save the file, run the file with Python >but this is what's needed when you want to run a program more than once >anyway, so it's a good step to take. > >Find a good, *general-purpose* programmer's editor. Preferably licensed >under free software terms, with a strong community supporting it, and >available on all major platforms for when you switch to a decent >programmer-friendly operating system. I am actually using Notepad some too. Thanks -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
On Monday, October 27, 2014 8:48:52 AM UTC+5:30, Rustom Mody wrote: > On Monday, October 27, 2014 8:40:48 AM UTC+5:30, Chris Angelico wrote: > > On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote: > > > Right. There is line-by-line history, and editing enabled with the > > > "readline" plug-in. (This is an advantage of using a programmer-friendly > > > operating system, which MS Windows sadly is not.) > > > > You can get block-by-block history by using Idle. I find that fairly > > convenient for manipulating class/function definitions. > > > > ChrisA > > Umm... Nice! > A bit inconsistent in that the '...' does not appear. > But thats good; makes copy|cut-pasting from interpreter to file > a mostly trivial operation. No not quite so nice... Does not respect the current indent level :-( [which an emacs 'rectangle' copy-paste will] -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
Your message showed up as unavailable on my server I have to cut and paste Google Groups to reply. (I am going to change news servers probably tomorrow to try to fix that) So the quoting is going to be bad. Why not idle? And if in general you are at python 3, why 2.7 here? There are enough factor to learn ( and get confused)! Please don't add new ones gratuitously! --- I am taking two courses in Python 2 so I think I am going to forget using Python 3 until I finish the courses. One of the course instructors suggests we try the command like way. Your other explanations on the distinctions are helpful, but for now I am going with Python 2. Final answer. :) (A few more weeks) They are teaching Python 2. I have to use Python 2 to learn it. Thanks I am going to be flexible on IDLE in the near future, but I wanted to try it the old fashion way. I already know using IDLE is better, but I am not sure using IDLE will invoke Python 2 and I am not sure how to change that at the moment. -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
On Mon, Oct 27, 2014 at 2:18 PM, Rustom Mody wrote: > On Monday, October 27, 2014 8:40:48 AM UTC+5:30, Chris Angelico wrote: >> On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote: >> > Right. There is line-by-line history, and editing enabled with the >> > "readline" plug-in. (This is an advantage of using a programmer-friendly >> > operating system, which MS Windows sadly is not.) >> >> You can get block-by-block history by using Idle. I find that fairly >> convenient for manipulating class/function definitions. >> >> ChrisA > > Umm... Nice! > A bit inconsistent in that the '...' does not appear. > But thats good; makes copy|cut-pasting from interpreter to file > a mostly trivial operation. It's inconsistent only because the default sys.ps2 is those dots, which aren't necessary in Idle. You could make it consistent by simply changing sys.ps2. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
On Monday, October 27, 2014 8:40:48 AM UTC+5:30, Chris Angelico wrote: > On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote: > > Right. There is line-by-line history, and editing enabled with the > > "readline" plug-in. (This is an advantage of using a programmer-friendly > > operating system, which MS Windows sadly is not.) > > You can get block-by-block history by using Idle. I find that fairly > convenient for manipulating class/function definitions. > > ChrisA Umm... Nice! A bit inconsistent in that the '...' does not appear. But thats good; makes copy|cut-pasting from interpreter to file a mostly trivial operation. -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
Ben Finney writes: > Dan Stromberg writes: > > Are the following two expressions the same? […] > > It depends what you mean by “the same”. My apologies, I mis-read the question. My answers were for a different question (one you didn't ask). Please ignore that. -- \ “If you ever reach total enlightenment while you're drinking a | `\ beer, I bet it makes beer shoot out your nose.” —Jack Handey | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote: > Right. There is line-by-line history, and editing enabled with the > “readline” plug-in. (This is an advantage of using a programmer-friendly > operating system, which MS Windows sadly is not.) You can get block-by-block history by using Idle. I find that fairly convenient for manipulating class/function definitions. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
On Monday, October 27, 2014 8:00:04 AM UTC+5:30, Seymore4Head wrote: > I am trying to learn classes. > I am currently using Python 2.7 at the command line. Why not idle? And if in general you are at python 3, why 2.7 here? There are enough factor to learn ( and get confused)! Please dont add new ones gratuitously! > If you try to type commands at the command line and make the slightest > mistake you have to start over. > I was trying to copy and paste these instructions into the command > prompt. > > http://en.wikibooks.org/wiki/Python_Programming/Classes > >>> class Foo: > ... def setx(self, x): > ... self.x = x > ... def bar(self): > ... print self.x > > There is really no way to do that without pasting line by line is > there and adding deleting spaces? And if you use spaces and tabs, > they are not the same. > > http://imgur.com/a/XTkAm Let me repeat and elaborate what I have already told you -- - you should write mostly expressions at the interpreter prompt - you should write definitions in the file Rough distinctions: 1. Things like 1+2, lst.append(3) etc are expressions 2. Things like assignment, if, while are statements 3. class and def statements are special; and called definitions Notes a. theres an inclusion 1 'sits inside' 2 'sits inside' 3 b. Its easiest if you try 1 in the interpreter; 3 in the python file c. 2 is a bit clumsy. Short ones can be tried at the interpreter Longer than 3 (max 4) lines should go into files. May require a bit of thought how to package a statement into a definition to try out d. 2 is clumsy in files for a different reason; you will need to write prints judiciously e. Since def itself goes into class, if youve not yet worked out a comfortable 'tryin-out' model, stay with defs for now In short: For a while people here have been advising you "Use the Interpreter" Now I will add slightly to that: Use the interpreter in idle, along with a python file -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
On 27Oct2014 00:41, MRAB wrote: On 2014-10-27 00:24, Ethan Furman wrote: On 10/26/2014 05:23 PM, Ethan Furman wrote: On 10/26/2014 05:12 PM, Dan Stromberg wrote: Are the following two expressions the same? x is y Id(x) == id(y) ? Listen to MRAB, ignore me. That is all. Well, apart of Joshua's qualifications, that is! :-) Let's make it clear for the OP, since this thread seems to have wandered into the realms of the confusing, for what is a basic question. The short answer is "yes". The longer answer is: if nobody else is fiddling with "x" and "y" and if id() is the normal builtin python "id" function Then yes. The "is" test is more direct and less subject to iffiness because the longer expression using id() leaves more scope/time for things to change, and of course "id" itself can be rebound to something weird. Cheers, Cameron Simpson The significant problems we face cannot be solved at the same level of thinking we were at when we created them. - Albert Einstein -- https://mail.python.org/mailman/listinfo/python-list
Re: Classes and the command line
Seymore4Head writes: > I am trying to learn classes. > I am currently using Python 2.7 at the command line. (I think you mean “the interactive Python interpreter”, or just “the Python shell”.) Since you are learning Python, I will strongly recommend you ignore Python 2 unless it becomes unavoidable. Instead, learn Python 3 primarily; it is much better because it omits a bunch of legacy behaviour you don't need. > If you try to type commands at the [interactive shell] and make the > slightest mistake you have to start over. Right. There is line-by-line history, and editing enabled with the “readline” plug-in. (This is an advantage of using a programmer-friendly operating system, which MS Windows sadly is not.) > I was trying to copy and paste these instructions into the > [interactive Python shell]. > > http://en.wikibooks.org/wiki/Python_Programming/Classes > >>> class Foo: > ... def setx(self, x): > ... self.x = x > ... def bar(self): > ... print self.x > > There is really no way to do that without pasting line by line is > there and adding deleting spaces? And if you use spaces and tabs, > they are not the same. Right on all counts. The interactive Python shell is good for very quickly experimenting and demonstrating how Python actually behaves, statement by statement. But as you point out, it is not a good choice for anything more complex. It is a good learning and debugging tool. When you start to write larger units of code, like a class or a function, you can trade immediacy for flexibility: write your code into a text editor, save it to a file ‘foo.py’, then run that code at a separate OS command prompt by invoking ‘python foo.py’ in the terminal. That way, you can continue to adjust and tweak the code as you learn how your changes affect the code. You do need to keep invoking the actions separately – edit the file, save the file, run the file with Python – but this is what's needed when you want to run a program more than once anyway, so it's a good step to take. Find a good, *general-purpose* programmer's editor. Preferably licensed under free software terms, with a strong community supporting it, and available on all major platforms for when you switch to a decent programmer-friendly operating system. -- \“When you go in for a job interview, I think a good thing to | `\ ask is if they ever press charges.” —Jack Handey | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Python tutorials
Python tutorials http://anandology.com/python-practice-book/object_oriented_programming.html This is a good onebut it gets too deep too fast. This is the best thing I have read so far to help me understand classes. What I would like to see is more examples of computing before starting on drawing examples. I have to practice the first few steps of a dance before trying the whole thing. For anyone here that might have an interest in making tutorials, using something useful as an example instead of using foo and bar helps me a lot towards understanding the concept too. -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
Joshua Landau writes: > On 27 October 2014 02:28, Ben Finney wrote: > > Guido is incorrect. I've already stated what's wrong. > > You were arguing about what Guido thinks. I don't know where I did that; to my knowledge, this is the first time I've mentioned Guido, and it's in rebuttal to his authority on the issue of whether “there's nothing wrong with” bool-as-a-special-int. (On the separate issue of whether Guido is an authority on how Python will behave, I haven't even commented. To be clear: yes, he is the BDFL and therefore is authoritative on that issue.) > Regardless, I feel you're making this out as a black and white issue. There either is something problematic with a behaviour, or there isn't. The *degree* of wrongness can vary. I'm merely pointing out that, in this case, it's non-zero. -- \ “I must say that I find television very educational. The minute | `\ somebody turns it on, I go to the library and read a book.” | _o__)—Groucho Marx | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
On 27 October 2014 02:28, Ben Finney wrote: > Joshua Landau writes: > >> Guido van Rossum answered Jul 28 '11 at 21:20, >> http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints >> > False==0 and True==1, and there's nothing wrong with that. > > Guido is incorrect. I've already stated what's wrong. You were arguing about what Guido thinks. I'm pretty sure Guido gets first say in that, regardless of whether anyone agrees with him. Regardless, I feel you're making this out as a black and white issue. Guido isn't incorrect, he just has a different opinion. Designing a language and calling things "wrong" or "right" gets you Haskell. You can discuss the advantages of each approach without drawing lines in the sand. Although if you do want a language like Haskell, there are a few great choices to chose from. -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
On Monday, October 27, 2014 7:59:04 AM UTC+5:30, Ben Finney wrote: > Joshua Landau writes: > > > Guido van Rossum answered Jul 28 '11 at 21:20, > > http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints > > > False==0 and True==1, and there's nothing wrong with that. > > Guido is incorrect. I've already stated what's wrong. > > That's different from saying I want to change how Python behaves *now*, > of course. But to say "there's nothing wrong with that" dismisses the > problems without addressing them. Guido isn't perfect, so that's okay. Yes; thats my position also (here and in general). Language changes can be (hugely) disruptive. The cost/benefit of disruption/improvement is always to be considered Does not mean the choices are perfect. In particular, when introducing a beginner, its best if teachers are upfront about goofups. It helps everyone. Helps... - the noob who is saved from self-flagellating "Am I a fool?" - helps the python ecosystem: "These guys are straightforward; dont cover up their mistakes" - etc -- eg noob's future employer -- https://mail.python.org/mailman/listinfo/python-list
Classes and the command line
I am trying to learn classes. I am currently using Python 2.7 at the command line. If you try to type commands at the command line and make the slightest mistake you have to start over. I was trying to copy and paste these instructions into the command prompt. http://en.wikibooks.org/wiki/Python_Programming/Classes >>> class Foo: ... def setx(self, x): ... self.x = x ... def bar(self): ... print self.x There is really no way to do that without pasting line by line is there and adding deleting spaces? And if you use spaces and tabs, they are not the same. http://imgur.com/a/XTkAm -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
Joshua Landau writes: > Guido van Rossum answered Jul 28 '11 at 21:20, > http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints > > False==0 and True==1, and there's nothing wrong with that. Guido is incorrect. I've already stated what's wrong. That's different from saying I want to change how Python behaves *now*, of course. But to say “there's nothing wrong with that” dismisses the problems without addressing them. Guido isn't perfect, so that's okay. -- \“Telling pious lies to trusting children is a form of abuse, | `\plain and simple.” —Daniel Dennett, 2010-01-12 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
On Sunday, October 26, 2014 9:45:22 AM UTC+5:30, Steven D'Aprano wrote: > http://legacy.python.org/dev/peps/pep-0285/ > Ben Finney wrote: > > > > I agree with the decision, because this isn't an issue which often leads > > to *incorrect* code. But I maintain that it's an unfortunate and > > needlessly confusing wart of the language. > > That puts you in the small but vocal minority :-) I'm sure that as the author of stats module you know of 'sampling error'! Hint: There are two rather different populations to consider here for drawing the sample - pythonistas - textbook-istas Analogous to another oft-seen argument -- variables. A python variable is time-varying (like most programming languages) A python variable is not a mathematical variable. Historically: 1st HLL was FORTRAN which first introduced variables in trying to come closer to math (note the name FORmula TRANslator) Fortran's approximation was quite a good attempt for 1957. Less and less so as people understood the consequences. Until 1978 its creator was awarded for his creation and in his acceptance apologized for his mistakes -- Section 4 http://web.stanford.edu/class/cs242/readings/backus.pdf tl;dr People make mistakes. Mistakes can be corrected == Of course 1. There are the logical operators and, xor 2. Put them into a certain config -- half-adder https://en.wikipedia.org/wiki/Adder_%28electronics%29#Half_adder 3. [Keep reading down]. .. full-adder 4. Ripple-carry adder : : 5. ALU ie Arithmetic Logic Unit IOW arithmetic/logic distinctions are fuzzy. "Distinctions are fuzzy" ≠ "Should not be made" [In my book!] -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
On 26 October 2014 01:03, Ben Finney wrote: > Steven D'Aprano writes: > >> I suspect that Guido and the core developers disagree with you, since >> they had the opportunity to fix that in Python 3 and didn't. > > That doesn't follow; there are numerous warts in Python 2 that were not > fixed in Python 3. As I understand it, the preservation of bool–int > equality has more to do with preserving backward compatibility. Guido van Rossum answered Jul 28 '11 at 21:20, http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints > False==0 and True==1, and there's nothing wrong with that. -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
On Sun, 26 Oct 2014 17:12:29 -0700, Dan Stromberg wrote: > Are the following two expressions the same? > > x is y > > Id(x) == id(y) No, although if "Id" and "id" were the same function, they might be equivalent in some cases. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
On 2014-10-27 00:38, Ben Finney wrote: Steven D'Aprano writes: Do you really not see the connection between counting and summing? Connection? Of course. But I also see a huge distinction. I'm surprised you could misunderstand my position to the extent you think such a question needs to be asked. The difference between “sum these values” versus “count these values” is important. That's at the root of why I find it confusingly wrong to sum True or False values. Do you really not see the distinction between counting and summing? The question is just as silly that way. If you have three apples, and I have two apples, then in total we have (count the apples: one two three, four five) five apples. If you have three apples in one basket, and I have two apples in one basket, “sum the baskets” is quite a different operation from “count the baskets”. [3, 2] What is the sum of those values? How many values are there? Those are ints. The question is whether you can sum bools. Python's way is to say that it's counting how many True there are. Sometimes it's useful; pragmatism beats purity, and all that. The distinction between those is why I find it unhelpful to express “how many values?” with “sum them”. Alas, you missed the bigger bug: I'm counting *blank lines*, not non-blank lines. You need a `not` in there. Which is, shall we say, not incompatible with the position that the “count the matches by summing bools” method is an unclear expression of intent :-) -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
Dan Stromberg writes: > Are the following two expressions the same? > > x is y > > Id(x) == id(y) It depends what you mean by “the same”. Do they give the same result? Sometimes yes, sometimes no. It depends on what the types of the values are. Do they express the same intent? Always no. The first queries object identity, the second queries object equality. -- \ “Ridicule is the only weapon which can be used against | `\ unintelligible propositions.” —Thomas Jefferson, 1816-07-30 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
On 2014-10-27 00:24, Ethan Furman wrote: On 10/26/2014 05:23 PM, Ethan Furman wrote: On 10/26/2014 05:12 PM, Dan Stromberg wrote: Are the following two expressions the same? x is y Id(x) == id(y) ? Listen to MRAB, ignore me. That is all. Well, apart of Joshua's qualifications, that is! :-) -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
Steven D'Aprano writes: > Do you really not see the connection between counting and summing? Connection? Of course. But I also see a huge distinction. I'm surprised you could misunderstand my position to the extent you think such a question needs to be asked. The difference between “sum these values” versus “count these values” is important. That's at the root of why I find it confusingly wrong to sum True or False values. Do you really not see the distinction between counting and summing? The question is just as silly that way. > If you have three apples, and I have two apples, then in total we have > (count the apples: one two three, four five) five apples. If you have three apples in one basket, and I have two apples in one basket, “sum the baskets” is quite a different operation from “count the baskets”. [3, 2] What is the sum of those values? How many values are there? The distinction between those is why I find it unhelpful to express “how many values?” with “sum them”. > Alas, you missed the bigger bug: I'm counting *blank lines*, not > non-blank lines. You need a `not` in there. Which is, shall we say, not incompatible with the position that the “count the matches by summing bools” method is an unclear expression of intent :-) -- \ “Sittin' on the fence, that's a dangerous course / You can even | `\ catch a bullet from the peace-keeping force” —Dire Straits, | _o__) _Once Upon A Time In The West_ | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
On 10/26/2014 05:12 PM, Dan Stromberg wrote: Are the following two expressions the same? x is y Id(x) == id(y) ? Nope. If the value if `id(x)` is not interned, then the two value could be different objects that still represent the same value. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
On 10/26/2014 05:23 PM, Ethan Furman wrote: On 10/26/2014 05:12 PM, Dan Stromberg wrote: Are the following two expressions the same? x is y Id(x) == id(y) ? Listen to MRAB, ignore me. That is all. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
On 27 October 2014 00:12, Dan Stromberg wrote: > Are the following two expressions the same? > > x is y > > Id(x) == id(y) Much of the time, but not all the time. The obvious exception is if "id" is redefined, but that one's kind of boring. The real thing to watch out for is if the object that "x" points to is garbage collected before "y" is evaluated: nothing = "!" id("hello" + nothing) == id("hello" + nothing) #>>> True ("hello" + nothing) is ("hello" + nothing) #>>> False Since in the first case the ("hello" + nothing) gets garbage collected, CPython is allowed to re-use its id. If instead you assign them outside of the expression: nothing = "!" x = "hello" + nothing y = "hello" + nothing id(x) == id(y) #>>> False the collection cannot happen. Note that in this case CPython is allowed to deduplicate these strings anyway (although in this case it does not), so using "is" here is not safe. -- https://mail.python.org/mailman/listinfo/python-list
Re: id == vs is
On 2014-10-27 00:12, Dan Stromberg wrote: Are the following two expressions the same? x is y Id(x) == id(y) ? Yes. I ported some Java code to Python, and it was using Java's idea of equality (via ==) in some places. Right now, I have a suite of unit tests working using the second expression above, but I'm thinking about switching to the first. Thanks! -- https://mail.python.org/mailman/listinfo/python-list
id == vs is
Are the following two expressions the same? x is y Id(x) == id(y) ? I ported some Java code to Python, and it was using Java's idea of equality (via ==) in some places. Right now, I have a suite of unit tests working using the second expression above, but I'm thinking about switching to the first. Thanks! -- https://mail.python.org/mailman/listinfo/python-list
Re: Lazy-evaluation lists/dictionaries
On 10/26/2014 10:14 AM, Jon Ribbens wrote: I have a need, in a Python C extension I am writing, for lists and dictionaries with "lazy evaluation" - by which I mean that at least some of the values in the lists/dictionaries are "proxy objects" which, rather than returning as themselves, should return the thing they are a proxy for when retrieved. This is because retrieving the proxied objects is expensive and only a small minority of them will actually be accessed, so retrieving them all before they are actually accessed is massively inefficient. With object attributes, this can be easily done with the descriptor protocol and having properties which look like simple objects but actually cause a method to be invoked when they are accessed. However there doesn't seem to be any equivalent way of doing this for retrieving items from lists or dictionaries - unfortunately, the method implementations of list() and dict() are full of direct accesses to the underlying data pointers rather than indirecting through obj->tp_as_mapping->mp_subscript or whatever. Is there any better way to do this other than simply re-implementing these types from scratch, emulating all their methods and operations? (i.e. using UserList/UserDict). I was under the impression that that sort of thing was supposed to have gone since Python 2.2 or so. We considered dropping UserDict and UserList for 3.0 but kept them in collections for cases in which subclassing does not work. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Newbie suggestion: nice tutorial
On 10/26/2014 3:22 AM, Martin S wrote: So it was back to the internet - and this one seems pretty comprehensive and understandable: http://www.diveintopython3.net/ It doesn't cover the latest point version of Python (it's still Python 3), but I hope it doesn't matter much? I expect not. The book appears to have been written at the time of 3.1. There was no new syntax (but some stdlib improvements) in 3.2. 3.3 brought an improved unicode implementation and 'yield from'. You likely do not need to know about 'yield from' unless you use coroutines with the 3.4 asyncio module. I expect nearly all the beginner code in the book should still work. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Status of side-effecting functions in python
In article <683c84d8-d916-4b63-b4b2-92cd2763e...@googlegroups.com>, wxjmfa...@gmail.com wrote: > Le dimanche 26 octobre 2014 14:41:43 UTC+1, Dan Sommers a écrit : > > On Sun, 26 Oct 2014 00:45:49 -0700, wxjmfauth wrote: > > > > > Ditto for .write(). Why should it return "something" ? > > > > > with open('z.txt', 'w') as f: > > > ... f.write('abc') > > > ... > > > 3 > > > > OTOH, why shouldn't it return something? In this case, it returns the > > length of the string written. This value is analogous to the value > > returned by the underlying OS function (at least on a POSIX-like system, > > where write(2) returns the number of bytes written). This value can be > > useful for detecting when things have gone wrong; e.g., disk full, > > network down, pipe broken, etc. Practicality definitely beats purity. > > > > At one time, on a huge project, millions of lines of C and assembly > > code, we had a local guideline *not* to write void functions. The idea > > was to return something that might be useful later, even if it seemed > > unlikely now. A simple success flag was sufficient; as functions grew, > > often did their failure modes. > > > > Dan > > Yes and no. If something goes wrong in a .write() method, > is not Python supposed to raise an error? (!) Define "wrong". It is not an error for a write() call to consume fewer bytes than were requested. How would you expect this to be handled in Python? Raise DataPartiallyWrittenError? -- https://mail.python.org/mailman/listinfo/python-list
Re: I am out of trial and error again Lists
On 10/26/2014 1:08 AM, Dennis Lee Bieber wrote: On Sat, 25 Oct 2014 18:48:59 -0400, Terry Reedy declaimed the following: C:\Users\Wulfraed\Documents>python3 You must have done something extra to make this work on Windows. Possibly hand-edited my system PATH -- I've got a rather nasty one (inserting line breaks)... I was referring to the existence of 'python3' (and 'python2'). I presume these are created by the ActiveState installer that you said you used. There are not created by the PSF Windows installer. It instead creates 'py' linked to the new launcher; 'py -2' and 'py -3' launch the latest available python 2 or python3. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: (test) ? a:b
On 10/26/2014 12:15 AM, Steven D'Aprano wrote: Ben Finney wrote: Steven D'Aprano writes: I suspect that Guido and the core developers disagree with you, since they had the opportunity to fix that in Python 3 and didn't. That doesn't follow; there are numerous warts in Python 2 that were not fixed in Python 3. As I understand it, the preservation of bool–int equality has more to do with preserving backward compatibility. On reviewing PEP 285, I think it is safe to say that Guido *explicitly* wants bools to be ints, not just for backwards compatibility: 4) Should we strive to eliminate non-Boolean operations on bools in the future, through suitable warnings, so that for example True+1 would eventually (in Python 3000) be illegal? => No. There's a small but vocal minority that would prefer to see "textbook" bools that don't support arithmetic operations at all, but most reviewers agree with me that bools should always allow arithmetic operations. http://legacy.python.org/dev/peps/pep-0285/ Thank you for digging this up. I was one of the 'most reviewers'. Even though filter now returns an iterator, so that one can write sum(1 for _ in filter(None, iterable_of_bools)) without creating an unneeded itermediate list, I still prefer sum(iterable_of_bools) for efficiency not only for the machine but also for me writing and reading. [snip of fine disquisition on the subject to which I have nothing to add] -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Test driven programming, was Re: VB to Python migration
-- https://mail.python.org/mailman/listinfo/python-list
Re: (-1)**1000
On 10/26/14 4:07 PM, Tony the Tiger wrote: On Wed, 22 Oct 2014 10:27:34 +0200, ast wrote: If i am writing (-1)**1000 on a python program, will the interpreter do (-1)*(-1)*...*(-1) or something clever ? Even vs. odd. It ought to know. I would assume from a set of defined rules how math works. There is such a thing as an optimization that isn't worthwhile to perform, simply because it's expected to provide so little benefit. The language implementors have to trade off the cost of adding the optimization to the implementation, against the possible benefit people would get from it. Benefit in this case would have to include a guess as to how often real programs would hit the optimization case. -- Ned Batchelder, http://nedbatchelder.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Lazy-evaluation lists/dictionaries
On 27 October 2014 01:14, Jon Ribbens wrote: > I have a need, in a Python C extension I am writing, for lists and > dictionaries with "lazy evaluation" - by which I mean that at least > some of the values in the lists/dictionaries are "proxy objects" > which, rather than returning as themselves, should return the thing > they are a proxy for when retrieved. This is because retrieving > the proxied objects is expensive and only a small minority of them > will actually be accessed, so retrieving them all before they are > actually accessed is massively inefficient. > Why not put proxy objects into the list/dict? Have a look at the weakref module for an API that may be suitable for such proxy objects (if you used the same API, that would also allow you to transparently use weakrefs in your lists/dicts). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list
Re: XML Patch
Nicholas Cole schrieb am 26.10.2014 um 18:00: > I'm looking for a python library that can parse XML Documents and > create xml-aware "diff" files, and then use those to patch documents. > In other words, I'd like something similar to the Google > diff-match-patch tools, but something which is XML aware. > > I can see several projects on Pypi that can generate some form of xml > diff, but I can't seem to see anything that can also do the patching > side of things. Is there a use case for this? Stefan -- https://mail.python.org/mailman/listinfo/python-list
Re: XML Patch
On Sun, Oct 26, 2014 at 1:00 PM, Nicholas Cole wrote: > Hi All, > > I'm looking for a python library that can parse XML Documents and > create xml-aware "diff" files, and then use those to patch documents. > In other words, I'd like something similar to the Google > diff-match-patch tools, but something which is XML aware. > > I can see several projects on Pypi that can generate some form of xml > diff, but I can't seem to see anything that can also do the patching > side of things. > > Does anyone have any recommendations? > > Best wishes, > > Nicholas > -- > https://mail.python.org/mailman/listinfo/python-list Could you use git? -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list
XML Patch
Hi All, I'm looking for a python library that can parse XML Documents and create xml-aware "diff" files, and then use those to patch documents. In other words, I'd like something similar to the Google diff-match-patch tools, but something which is XML aware. I can see several projects on Pypi that can generate some form of xml diff, but I can't seem to see anything that can also do the patching side of things. Does anyone have any recommendations? Best wishes, Nicholas -- https://mail.python.org/mailman/listinfo/python-list
Re: Status of side-effecting functions in python
wxjmfa...@gmail.com: > Yes and no. If something goes wrong in a .write() method, > is not Python supposed to raise an error? (!) We have multiple cases: 1. write succeeds with all of the given bytes 2. write succeeds with some but not all of the given bytes 3. write cannot at the moment write any bytes 4. an I/O error has taken place Cases 1 and 2 are reported through positive return values in POSIX system calls. Cases 3 and 4 are reported as errors. Arguably 2 and 3 are related cases. Python imitates POSIX, but *could* take a different tack. For example, * always return with an exception carrying the number of bytes written * return with None in case 1 and with an exception otherwise * return with the number of bytes in 1, 2 and 3 and exception in 4 The POSIX way is justified with symmetry: read() distinguishes EAGAIN from 0 (end of file). One could argue that POSIX got it the wrong way. EOF should be an exception ("EEOF") and 0 should be used instead of EAGAIN. However, the POSIX practice works in C and Python. Marko -- https://mail.python.org/mailman/listinfo/python-list
Finding my way around help
Context: I will be showing the way around to some experienced programmers new to python. Do >>> help() Among other things I get: | Enter the name of any module, keyword, or topic to get help on writing | Python programs and using Python modules. To quit this help utility and | return to the interpreter, just type "quit". However I find it returns to the normal REPL with just a return; no quit. I would have expected a special help REPL to keep running till I give quit. What gives? Also I tried >>> help(help) This shows the docstring for class _Helper(builtins.object) However if I do this >>> from pydoc import help >>> help(help) I get more useful help. Seems the wrong way round... Above is true for 2.7 and 3.4. -- https://mail.python.org/mailman/listinfo/python-list
Re: Status of side-effecting functions in python
On Sunday, October 26, 2014 7:11:43 PM UTC+5:30, Dan Sommers wrote: > At one time, on a huge project, millions of lines of C and assembly > code, we had a local guideline *not* to write void functions. The idea > was to return something that might be useful later, even if it seemed > unlikely now. A simple success flag was sufficient; as functions grew, > often did their failure modes. Well C and Python are completely different in this respect. In C it is the norm to return the status in the return value and the actual return value in pointer parameters. Or even worse in pointer parameters + globals: think of most of the system calls and errno. This low-level messiness is in fact one of the compulsions that have driven preference and development of higher level languages like python. Here failure-mode has dedicated syntax -- exceptions. This conduces to a more DRY, less error-prone setup. - Normal mode in the normal functional call-return style - Failure mode in the except (for caller); raise (for callee) clauses. Note that my comment was: > Its generally accepted that side-effecting functions are not a good idea > -- typically a function that returns something and changes global state. So I am not talking of merely global (or non-local) variable side-effecting functions/methods which is normal in imperative programming, but ones that do BOTH - both changing global state - returning useful results in the return value While this may be called a code-smell, in C like languages it is close to unavoidable. In python its more avoidable and therefore more smelly (to my nose at least!) Yeah I note Terry's examples of list.pop etc. I guess one could say that these are instances of practicality beats purity. However note the context where this thread arose. A beginning programmer having a hard time distinguishing: - Values and effects - Expressions and statements - Immutable and mutable data-structures - Functions and Procedures My claim is that until then, he should not be trying to write code like that. -- https://mail.python.org/mailman/listinfo/python-list
Lazy-evaluation lists/dictionaries
I have a need, in a Python C extension I am writing, for lists and dictionaries with "lazy evaluation" - by which I mean that at least some of the values in the lists/dictionaries are "proxy objects" which, rather than returning as themselves, should return the thing they are a proxy for when retrieved. This is because retrieving the proxied objects is expensive and only a small minority of them will actually be accessed, so retrieving them all before they are actually accessed is massively inefficient. With object attributes, this can be easily done with the descriptor protocol and having properties which look like simple objects but actually cause a method to be invoked when they are accessed. However there doesn't seem to be any equivalent way of doing this for retrieving items from lists or dictionaries - unfortunately, the method implementations of list() and dict() are full of direct accesses to the underlying data pointers rather than indirecting through obj->tp_as_mapping->mp_subscript or whatever. Is there any better way to do this other than simply re-implementing these types from scratch, emulating all their methods and operations? (i.e. using UserList/UserDict). I was under the impression that that sort of thing was supposed to have gone since Python 2.2 or so. -- https://mail.python.org/mailman/listinfo/python-list
Re: Status of side-effecting functions in python
On Sun, 26 Oct 2014 00:45:49 -0700, wxjmfauth wrote: > Ditto for .write(). Why should it return "something" ? > with open('z.txt', 'w') as f: > ... f.write('abc') > ... > 3 OTOH, why shouldn't it return something? In this case, it returns the length of the string written. This value is analogous to the value returned by the underlying OS function (at least on a POSIX-like system, where write(2) returns the number of bytes written). This value can be useful for detecting when things have gone wrong; e.g., disk full, network down, pipe broken, etc. Practicality definitely beats purity. At one time, on a huge project, millions of lines of C and assembly code, we had a local guideline *not* to write void functions. The idea was to return something that might be useful later, even if it seemed unlikely now. A simple success flag was sufficient; as functions grew, often did their failure modes. Dan -- https://mail.python.org/mailman/listinfo/python-list
SQLObject 1.6.1
Hello! I'm pleased to announce version 1.6.1, the first bugfix release of branch 1.6 of SQLObject. What's new in SQLObject === * Allow unicode in .orderBy(u'-column'). Contributor for this release is Andrew Trusty. For a more complete list, please see the news: http://sqlobject.org/News.html What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject == Site: http://sqlobject.org Development: http://sqlobject.org/devel/ Mailing list: https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss Archives: http://news.gmane.org/gmane.comp.python.sqlobject Download: https://pypi.python.org/pypi/SQLObject/1.6.1 News and changes: http://sqlobject.org/News.html Oleg. -- Oleg Broytmanhttp://phdru.name/p...@phdru.name Programmers don't die, they just GOSUB without RETURN. -- https://mail.python.org/mailman/listinfo/python-list
Re: Sample sqlite databases for use in python
Nicholas Cannon wrote: > Hello I am making a data management program and although i can make my own > databases I would like a couple sample ones to check out. Of course I > searched on google for sample db's and I downloaded some but they are not > working and I keep getting: > File is not a database or encrypted > > The error is not exactly like that but it does say that it may be > encrypted or not a database. Always cut and paste the actual error message. > I want the end user to take a database and > load it in to my program but I dont wont this happening even if the file > is a sqlite3 one as well. If my crystal ball is working you are experiencing the same problem as https://mail.python.org/pipermail/tutor/2013-July/097022.html -- https://mail.python.org/mailman/listinfo/python-list
Sample sqlite databases for use in python
Hello I am making a data management program and although i can make my own databases I would like a couple sample ones to check out. Of course I searched on google for sample db's and I downloaded some but they are not working and I keep getting: File is not a database or encrypted The error is not exactly like that but it does say that it may be encrypted or not a database. I want the end user to take a database and load it in to my program but I dont wont this happening even if the file is a sqlite3 one as well. -- https://mail.python.org/mailman/listinfo/python-list
Re: When to use assert
On Sun, Oct 26, 2014 at 8:39 PM, Steven D'Aprano wrote: > In the absence of correctness proofs for your code, anything you do (unit > tests, assertions, regression tests, etc.) is just a statistically sampling > of all the potential paths your code might take, hoping to capture bugs. As > any statistician will tell you, eventually you will reach the point of > diminishing returns, where adding more samples isn't worth the cost. That > point will depend on the cost in programmer effort, the performance > implications, and your confidence in the code. That's about the size of it, I guess. How much testing versus how much time actually spent coding? I'm pretty sure a lot of my code has the wrong ratio... I'm just not sure, for a lot of the code, which direction it's wrong :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: When to use assert
Chris Angelico wrote: > On Fri, Oct 24, 2014 at 6:49 PM, Steven D'Aprano > wrote: >> addresses = [get_address(name) for name in database] >> assert all(address for address in addresses) >> # ... much later on ... >> for i, address in enumerate(addresses): >> if some_condition(): >> addresses[i] = modify(address) >> assert addresses[i] >> >> >> will either identify the culprit, or at least prove that neither >> get_address() nor modify() are to blame. Because you're using an >> assertion, it's easy to leave the asserts in place forever, and disable >> them by passing -O to the Python interpreter in production. > > The first assertion is fine, assuming that the emptiness of your > address corresponds to falsiness as defined in Python. (This could be > safe to assume, if the address is an object that knows how to boolify > itself.) The second assertion then proves that modify() isn't > returning nothing, but that might be better done by sticking the > assertion into modify itself. Sure. If you can modify the function, getting it to check it's own post-condition is a good strategy. But you might not be able to do that. Perhaps you don't have the source code, or its from a third-party library and you don't want to have to keep hacking your copy every time it's updated, or you're calling an external library written in Java. (And yes, there are work-arounds for those scenarios too. Aren't choices wonderful?) > And that's what I'm talking about: checking a function's postcondition > with an assert implies putting that assertion after every call, There's no rule that you have to use an assertion after *every* call to a function. If you can check the post-condition inside the function, that's great. If you can't, then use your judgement. More asserts are not necessarily better, just as more unit tests are not necessarily better. You have to make a value judgement based on how much you trust the code, trust your own skills, trust your colleagues who will be maintaining the code in your absence, versus the maximum density of asserts per line of other code. > and > anything that you have to do every time you call a function belongs > inside that function. Imagine writing this kind of defensive code, and > then having lots of places that call modify()... and missing the > assert in some of them. Can you trust what you're getting back? Well, if the function is perfect, then adding more assertions won't uncover bugs that aren't there. And if the function is buggy, then adding more assertions will increase the likelihood that you'll discover those bugs earlier rather than later. How much do you trust the function? One test is better than no tests at all, but a thousand tests is not necessarily better than ten. The same applies to assertions. One might say that assertions can be considered tests that automatically run every time you run your code (in debugging mode), rather than needing to remember to run a special test program. In the absence of correctness proofs for your code, anything you do (unit tests, assertions, regression tests, etc.) is just a statistically sampling of all the potential paths your code might take, hoping to capture bugs. As any statistician will tell you, eventually you will reach the point of diminishing returns, where adding more samples isn't worth the cost. That point will depend on the cost in programmer effort, the performance implications, and your confidence in the code. >> [Aside: it would be nice if Python did it the other way around, and >> [require >> a --debugging switch to turn assertions on. Oh well.] > > Maybe. But unless someone actually tests that their assertions are > being run, there's the risk that they're flying blind and assuming > that it's all happening. There'll be all these lovely "checked > comments"... or so people think. Nobody ever runs the app with > --debugging, so nobody ever sees anything. Absolutely. And if you write unit tests but never actually run them, the same thing applies. You need a process that actually runs the code in debugging mode, and/or runs the tests. Or if the unit tests all pass but don't actually do anything useful? def test_critical_code_path(self): # Make sure application works correctly. self.assertTrue(True) Do I have to link to the DailyWTF showing that some people actually do write tests like this? Sure, why not :-) http://thedailywtf.com/articles/Productive-Testing Bad programmers can screw up anything. >> Assertions and test suites are complementary, not in opposition, like >> belt and braces. Assertions insure that the code branch will be tested if >> it is ever exercised, something test suites can't in general promise. >> Here's a toy example: >> >> def some_function(value): >> import random >> random.seed(value) >> if random.random() == 0.25000375: >> assert some_condition >> else: >> pass >> >> >> Try writing a unit test that guara
Dive Into Python 3, good tutorial (was: Newbie suggestion: nice tutorial)
Martin S writes: > So it was back to the internet - and this one seems pretty > comprehensive and understandable: > > http://www.diveintopython3.net/ Yes, Mark Pilgrim wrote this originally for Python 2, and it was one of the best even then. The revised edition for Python 3 is highly recommended. > It doesn't cover the latest point version of Python (it's still Python > 3), but I hope it doesn't matter much? You're right, it is still a good tutorial. Unfortunately, the primary author has disappeared http://en.wikipedia.org/wiki/Mark_Pilgrim#.22Disappearance.22_from_the_Internet>. Fortunately, the work is free software, so every recipient already has full permission to improve it and share the result. Does anyone know of an active project maintaining this great resource and releasing newer versions? -- \ “If you do not trust the source do not use this program.” | `\—Microsoft Vista security dialogue | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Newbie suggestion: nice tutorial
Even after having written three small tool for calculating chess ratings, I felt that I severly lacked a proper understanding of what the BEEP I was actually doing. So I looked at our standard bookshop at work, found a book that I thought neat only to discover that our work account has been cancelled... So it was back to the internet - and this one seems pretty comprehensive and understandable: http://www.diveintopython3.net/ It doesn't cover the latest point version of Python (it's still Python 3), but I hope it doesn't matter much? Regards, Martin S -- https://mail.python.org/mailman/listinfo/python-list