Re: For next loops

2018-07-22 Thread Ben Finney
no@none.invalid writes: > never mind. Congratulations for working out the error. And thank you for returning to show the corrected code :-) -- \ “If you don't know what your program is supposed to do, you'd | `\ better not start writing it.” —Edsger W. Dijkstra | _o__)

Re: coding style - where to declare variables

2018-07-22 Thread Marko Rauhamaa
Dennis Lee Bieber : > On Mon, 23 Jul 2018 00:08:00 +0300, Marko Rauhamaa > declaimed the following: > >>I Java terms, all Python values are boxed. That's a very usual pattern >>in virtually all programming languages (apart from FORTRAN). > > FORTRAN, C, COBOL, BASIC, Pascal, ALGOL, BCPL, REX

For next loops

2018-07-22 Thread no
x = range (5) y = range (5) for ply in x: for com in y: if ply==com: result="Tie" print(ply,com,result) Why is ply always equal to com? 0 0 Tie 0 1 Tie 0 2 Tie 0 3 Tie 0 4 Tie 1 0 Tie 1 1 Tie 1 2 Tie 1 3 Tie 1 4 Tie 2 0 Tie 2 1 Tie 2 2 Tie 2 3 Tie 2 4 Tie 3 0 Tie 3

Re: coding style - where to declare variables

2018-07-22 Thread Abdur-Rahmaan Janhangeer
variables here refers to the user experience of a var np, just a link to the thread/s would mark the end of it Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: Error installing scripts in python 37-32

2018-07-22 Thread Mark Lawrence
On 22/07/18 14:04, ojas gupta wrote: Explaining the whole scenario in detail : I open command prompt and go to C: then I enter "pip install mysqlclient" (Double inverted commas is just for highlights .) After pressing enter key it installs some data and after a while an error comes up saying "im

Re: coding style - where to declare variables

2018-07-22 Thread Mark Lawrence
On 22/07/18 14:51, Abdur-Rahmaan Janhangeer wrote: except local vars Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius Python doesn't have variables, it has names. Please can we avoid a long meaningless thread on this subject as it's been discussed a trillion times befor

Re: import in code

2018-07-22 Thread Mark Lawrence
On 22/07/18 05:45, Cameron Simpson wrote: On 22Jul2018 06:43, Abdur-Rahmaan Janhangeer wrote: i have found some reputable books that include import within code with ...    import x if ...    import y def ...     import z according to me they should be placed at the top. but an advantage of

Re: pattern block expression matching

2018-07-22 Thread aldi . kraja
Thank you all for thoughtful excellent updates! Aldi -- https://mail.python.org/mailman/listinfo/python-list

Re: send PIL.Image to django server side and get it back

2018-07-22 Thread iMath
Thanks, I solved it finally stackoverflow.com/a/51453785/1485853 -- https://mail.python.org/mailman/listinfo/python-list

Re: For next loops

2018-07-22 Thread no
never mind. x = range (5) y = range (5) for ply in x: for com in y: if ply==com: result="Tie" print(ply,com,result) result = "" On Sun, 22 Jul 2018 23:17:24 -0400, no@none.invalid wrote: >x = range (5) >y = range (5) >for ply in x: >for com in y: >

Re: [RELEASED] Python 3.4.9rc1 and Python 3.5.6rc1 are now available

2018-07-22 Thread Rustom Mody
On Friday, July 20, 2018 at 7:51:22 AM UTC+5:30, Larry Hastings wrote: … > the availability of Python 3.4.9rc1 and Python 3.5.6rc1. > Python's entrenched bureaucracy soldiers on, > //arry/ 😢 And 😢² at 325 posts of customary inanity at the recent events but nary a squeak of regret -- https://

Re: PyCharm

2018-07-22 Thread no
On Fri, 20 Jul 2018 20:56:41 -0700, Michael Vilain wrote: >I'm running PyCharm Edu (to go through their great tutorial). It's version is >2018.1.3, which I got from the web site. Unless you mistyped the version, >this is the current release and yours is very old. The date was just from a mess

Re: Non-GUI, single processort inter process massaging - how?

2018-07-22 Thread Jan Claeys
On Sat, 2018-07-21 at 11:50 -0400, Dennis Lee Bieber wrote: > Each client would use the urllib (various names between v2 > and v3) to submit requests to the server, and process the returned > "page". Or the client could even be a bash script using curl, or any other HTTP client... -- Jan

Re: ongoing browser projects

2018-07-22 Thread Abdur-Rahmaan Janhangeer
*Have you looked on PyPI?* that's the problem. due to the lack of py support html renderer just gives text-based html renderings there are also qt5 based ones but qt more of an off py project ported to py. if really needed, that i think it's the option i've also viewed C-based ones with python b

Re: ongoing browser projects

2018-07-22 Thread Chris Angelico
On Mon, Jul 23, 2018 at 11:43 AM, Akkana Peck wrote: >> On 22/07/18 21:43, Abdur-Rahmaan Janhangeer wrote: >> > i need an html renderer (one of the most badly missed features of py, PEP >> > anyone?) > > I think both GTK and Qt have basic HTML rendering widgets, for > simple tasks, but if you want

Re: ongoing browser projects

2018-07-22 Thread Akkana Peck
> On 22/07/18 21:43, Abdur-Rahmaan Janhangeer wrote: > > i need an html renderer (one of the most badly missed features of py, PEP > > anyone?) I think both GTK and Qt have basic HTML rendering widgets, for simple tasks, but if you want something that behaves more like a browser (javascript, link

PEP 572 implementation for Python

2018-07-22 Thread Andy Valencia
Hi, just an FYI (and request for comments). I've coded up PEP 572 on top of "Tauthon" (sometimes in early days known as "Python 2.8"): https://github.com/vandys/tauthon (branch pep572) After reading the PEP, Guido's comments, and looking at the code, I realized that := just wants to be an au

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
On Sun, 22 Jul 2018 17:50:06 -0400, Dennis Lee Bieber wrote: > On Mon, 23 Jul 2018 00:08:00 +0300, Marko Rauhamaa > declaimed the following: > >>I Java terms, all Python values are boxed. That's a very usual pattern >>in virtually all programming languages (apart from FORTRAN). >> >> > FOR

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
On Mon, 23 Jul 2018 00:08:00 +0300, Marko Rauhamaa wrote: > Would you call it binding in this case: > >X[0]["z"] = getit() >X[3]["q"] = X[0]["z"] >X[0]["z"].changeit() It is a binding, but it is not a *name* binding. Since we are talking about name bindings, and comparing/contrastin

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
On Sun, 22 Jul 2018 22:50:52 +0300, Marko Rauhamaa wrote: > I wish people stopped talking about "name binding" and "rebinding," > which are simply posh synonyms for variable assignment. Properly, the > term "binding" comes from lambda calculus, whose semantics is defined > using "bound" and "free"

Re: ongoing browser projects

2018-07-22 Thread Thomas Jollans
On 22/07/18 21:43, Abdur-Rahmaan Janhangeer wrote: > apart from grail, any ongoing browser projects? > > i need an html renderer (one of the most badly missed features of py, PEP > anyone?) Nobody writes browser engines. It's too hard to do what the available open source ones do half as well as t

Re: coding style - where to declare variables

2018-07-22 Thread Marko Rauhamaa
Richard Damon : >> On Jul 22, 2018, at 3:50 PM, Marko Rauhamaa wrote: >> I wish people stopped talking about "name binding" and "rebinding," >> which are simply posh synonyms for variable assignment. Properly, the >> term "binding" comes from lambda calculus, whose semantics is defined >> using "

Re: coding style - where to declare variables

2018-07-22 Thread Chris Angelico
On Mon, Jul 23, 2018 at 6:14 AM, Marko Rauhamaa wrote: > While FORTRAN or C couldn't operate on functions like this, an assembly > language program could easily. Simply compose a CPU instruction sequence > on the fly, mark it executable and use the "CALL" opcode to transfer > control to your const

Re: coding style - where to declare variables

2018-07-22 Thread Marko Rauhamaa
Bart : > If you did need one of those others to be variable, then you just assign > it to a variable the rare times you need to do that. For example: > > def fn1(): pass > def fn2(): pass > > fn = fn1 if cond else fn2 > > fn1, fn2 will always be functions. fn will always be a variable, but on

Re: coding style - where to declare variables

2018-07-22 Thread Richard Damon
> On Jul 22, 2018, at 3:50 PM, Marko Rauhamaa wrote: > I wish people stopped talking about "name binding" and "rebinding," > which are simply posh synonyms for variable assignment. Properly, the > term "binding" comes from lambda calculus, whose semantics is defined > using "bound" and "free" var

Re: ongoing browser projects

2018-07-22 Thread Chris Angelico
On Mon, Jul 23, 2018 at 5:43 AM, Abdur-Rahmaan Janhangeer wrote: > apart from grail, any ongoing browser projects? > > i need an html renderer (one of the most badly missed features of py, PEP > anyone?) Have you looked on PyPI? https://pypi.org/ ChrisA -- https://mail.python.org/mailman/listi

Re: functions vs methods

2018-07-22 Thread Chris Angelico
On Mon, Jul 23, 2018 at 1:49 AM, MRAB wrote: > On 2018-07-22 10:08, Ben Finney wrote: >> >> INADA Naoki writes: >> >>> Please don't refer the FAQ entry. >>> See this: https://bugs.python.org/issue27671 >> >> >> Interesting. Thanks for raising that bug report. >> >> I offer my text as a starting p

Re: coding style - where to declare variables

2018-07-22 Thread Marko Rauhamaa
r...@zedat.fu-berlin.de (Stefan Ram): >>Rebinding names is near-universal in programming, but usually names >>that are intended to be rebound, such as variables. > > To someone like me who has grown up with a LISP 1 > this is completely natural. > > |>( SETQ A ( LAMBDA () 'ALPHA )) > |(LAMBDA (

ongoing browser projects

2018-07-22 Thread Abdur-Rahmaan Janhangeer
apart from grail, any ongoing browser projects? i need an html renderer (one of the most badly missed features of py, PEP anyone?) thanks, Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: PyCharm

2018-07-22 Thread no
On Sun, 22 Jul 2018 11:51:51 +0200, Chris Warrick wrote: >On Sat, 21 Jul 2018 at 05:17, wrote: >> >> Win7 >> >> I was watching some tutorial videos on Python that recommended I use >> PyCharm and it worked pretty well until I tried to use input. >> >> I found this: >> https://youtrack.jetbrains.

Re: functions vs methods

2018-07-22 Thread MRAB
On 2018-07-22 10:08, Ben Finney wrote: INADA Naoki writes: Please don't refer the FAQ entry. See this: https://bugs.python.org/issue27671 Interesting. Thanks for raising that bug report. I offer my text as a starting point for a better explanation: Because ‘len’ works with *any* seque

Re: list of lists

2018-07-22 Thread Thomas Jollans
On 22/07/18 14:53, Sharan Basappa wrote: > Thanks. I initially thought about this but did not know if this is legal > syntax. In this kind of situation – you think you know how to do something but you're not quite sure if it'll work as intended – just try it! Start up an interactive interpreter,

Re: coding style - where to declare variables

2018-07-22 Thread Peter J. Holzer
On 2018-07-22 09:36:13 -0400, Richard Damon wrote: > > On Jul 22, 2018, at 8:48 AM, Sharan Basappa > > wrote: > > > > In other programming languages (e.g. C, C++), as a good practice, > > variables are declared right at the start of the program, There is no "start of the program" in C or C++. I

Re: coding style - where to declare variables

2018-07-22 Thread Abdur-Rahmaan Janhangeer
except local vars Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: coding style - where to declare variables

2018-07-22 Thread Chris Angelico
On Sun, Jul 22, 2018 at 10:48 PM, Sharan Basappa wrote: > In other programming languages (e.g. C, C++), as a good practice, variables > are declared right at the start of the program, irrespective of where it is > normally used. What is the practice in Python? > > I see that, most of the code, d

Re: coding style - where to declare variables

2018-07-22 Thread Richard Damon
> On Jul 22, 2018, at 8:48 AM, Sharan Basappa wrote: > > In other programming languages (e.g. C, C++), as a good practice, variables > are declared right at the start of the program, irrespective of where it is > normally used. What is the practice in Python? > > I see that, most of the code

Re: list of lists

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 18:34:41 UTC+5:30, Iwo Herka wrote: > > Can you tell me how this works? > > "results[0]" returns a list with two elements. Let's call it "pair" > > pair = results[0] > # ['1', 0.99921393753233001] > > Now, we can use regular sequence unpacking to retrieve first a

Error installing scripts in python 37-32

2018-07-22 Thread ojas gupta
Explaining the whole scenario in detail : I open command prompt and go to C: then I enter "pip install mysqlclient" (Double inverted commas is just for highlights .) After pressing enter key it installs some data and after a while an error comes up saying "import setuptools, tokensize;_file_=" (Th

Re: list of lists

2018-07-22 Thread Iwo Herka
> Can you tell me how this works? "results[0]" returns a list with two elements. Let's call it "pair" pair = results[0] # ['1', 0.99921393753233001] Now, we can use regular sequence unpacking to retrieve first and second argument: a, b = pair which is equivalent to this:

Re: list of lists

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 18:15:23 UTC+5:30, Frank Millman wrote: > "Sharan Basappa" wrote in message > news:8e261f75-03f7-4f80-a516-8318dd138...@googlegroups.com... > > > > I am using a third party module that is returning list of lists. > > I am using the example below to illustrate. > > > > 1 r

coding style - where to declare variables

2018-07-22 Thread Sharan Basappa
In other programming languages (e.g. C, C++), as a good practice, variables are declared right at the start of the program, irrespective of where it is normally used. What is the practice in Python? I see that, most of the code, declare variables where it is used and not at the start of the pro

Re: list of lists

2018-07-22 Thread Frank Millman
"Sharan Basappa" wrote in message news:8e261f75-03f7-4f80-a516-8318dd138...@googlegroups.com... I am using a third party module that is returning list of lists. I am using the example below to illustrate. 1 results = [['1', 0.99921393753233001]] 2 k = results[0] 3 print k[0] 4 print k[1] Assu

Re: list of lists

2018-07-22 Thread Sharan Basappa
Thanks. This works in my example. Can you tell me how this works? > You can simply unpack the inner list: > > a, b = results[0] > > > Iwo Herka > > ‐‐‐ Original Message ‐‐‐ > > On 22 July 2018 11:47 AM, Sharan Basappa wrote: > > > ​​ > > > > I am using a third party module that

Re: list of lists

2018-07-22 Thread Iwo Herka
You can simply unpack the inner list: a, b = results[0] Iwo Herka ‐‐‐ Original Message ‐‐‐ On 22 July 2018 11:47 AM, Sharan Basappa wrote: > ​​ > > I am using a third party module that is returning list of lists. > > I am using the example below to illustrate. > > 1 results =

list of lists

2018-07-22 Thread Sharan Basappa
I am using a third party module that is returning list of lists. I am using the example below to illustrate. 1 results = [['1', 0.99921393753233001]] 2 k = results[0] 3 print k[0] 4 print k[1] Assume the line 1 is what is returned. I am assigning that to another list (k on line 2) and then access

Re: print & string formatting

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 10:24:55 UTC+5:30, Cameron Simpson wrote: > On 21Jul2018 21:33, Sharan Basappa wrote: > >I get a lot confused while using print functions in Python. > > > >For example, I get the same results for the following code: > > > >str = "one two three" > > Pleasetry not to name v

Re: Better way / regex to extract values form a dictionary

2018-07-22 Thread Thomas Jollans
On 21/07/18 14:39, Ganesh Pal wrote: >> The dictionary is irrelevant to your question. It doesn't matter whether >> the path came from a dict, a list, read directly from stdin, an >> environment variable, extracted from a CSV file, or plucked directly from >> outer space by the programmer. The proc

Re: PyCharm

2018-07-22 Thread Chris Warrick
On Sat, 21 Jul 2018 at 05:17, wrote: > > Win7 > > I was watching some tutorial videos on Python that recommended I use > PyCharm and it worked pretty well until I tried to use input. > > I found this: > https://youtrack.jetbrains.com/issue/PY-27891 > > It says.. > Pavel Karateev commente

Re: functions vs methods

2018-07-22 Thread Ben Finney
INADA Naoki writes: > Please don't refer the FAQ entry. > See this: https://bugs.python.org/issue27671 Interesting. Thanks for raising that bug report. I offer my text as a starting point for a better explanation: Because ‘len’ works with *any* sequence, not only lists. To implement it

Re: Make, Sphinx and Windows

2018-07-22 Thread Abdur-Rahmaan Janhangeer
@ThomasJollans was supposed to detect errors in trabslation format such as the famous miss of éspace insécable etc, not conformed to sphinx notation e.g. if i put an extra space between the : and ` :meth: `some_meth` Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- ht

Re: print & string formatting

2018-07-22 Thread Thomas Jollans
On 22/07/18 06:54, Cameron Simpson wrote: > On 21Jul2018 21:33, Sharan Basappa wrote: >> I get a lot confused while using print functions in Python. >> >> For example, I get the same results for the following code: >> >> str = "one two three" > > Pleasetry not to name variables after builtin clas

Re: Make, Sphinx and Windows

2018-07-22 Thread Thomas Jollans
On 22/07/18 05:24, Abdur-Rahmaan Janhangeer wrote: > normally when you use make with sphinx, it should build and tell you errors > (so that reviewers don't have to correct it manually) i have been doing > some contribs to french docs translation but my make is a bit crazy : > > https://www.pythonm

Re: functions vs methods

2018-07-22 Thread INADA Naoki
> > Your particular question is itself a FAQ > https://docs.python.org/3/faq/design.html#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list>. > Please don't refer the FAQ entry. See this: https://bugs.python.org/issue27671 -- INADA Naoki --

Re: functions vs methods

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 13:32:16 UTC+5:30, Ben Finney wrote: > Sharan Basappa writes: > > > Is there a difference between functions and methods in Python. > > Python's documentation includes a useful Glossary. See the terms > https://docs.python.org/3/glossary.html#term-method> > https://docs.p

Re: functions vs methods

2018-07-22 Thread Ben Finney
Sharan Basappa writes: > Is there a difference between functions and methods in Python. Python's documentation includes a useful Glossary. See the terms https://docs.python.org/3/glossary.html#term-method> https://docs.python.org/3/glossary.html#term-function>. Every method is a function; but t