Re: pylint woes

2016-05-07 Thread Jussi Piitulainen
DFS writes: > The lists I actually use are: > > for j in range(len(nms)): > cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)" > vals = nms[j],street[j],city[j],state[j],zipcd[j] > > > The enumerated version would be: > > ziplists = zip(nms,street,city,state,zipcd) > for nm,street,city,st

Re: pylint woes

2016-05-07 Thread Ian Kelly
On Sat, May 7, 2016 at 9:28 PM, DFS wrote: > But I think there are some pylint bugs here: > - > > standard import "import pyodbc, sqlite3" comes before "import pyodbc, > sqlite3" (wrong-import-order) > > * complains that the

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 2:40 PM, DFS wrote: >>> It says "Used builtin function 'filter'. Using a list comprehension can >>> be >>> clearer. (bad-builtin)" >> >> >> Kill that message and keep using filter. > > > > Unfortunately, 'bad-builtin' caught 2 truly bad uses of built-ins (zip() and > id()),

Re: pylint woes

2016-05-07 Thread DFS
On 5/7/2016 11:51 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 1:28 PM, DFS wrote: Invalid constant name "cityzip" (invalid-name) Invalid constant name "state" (invalid-name) Invalid constant name "miles" (invalid-name) Invalid constant name "store" (invalid-name) Invalid variable name "rs"

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 2:10 PM, DFS wrote: >>> +-++ >>> |trailing-whitespace |59 | heh! >>> +-++ >>> |multiple-statements |23 | do this to save lines. >>> W

Re: pylint woes

2016-05-07 Thread DFS
On 5/7/2016 11:25 PM, Steven D'Aprano wrote: On Sun, 8 May 2016 02:51 am, DFS wrote: This more-anal-than-me program generated almost 2 warnings for every line of code in my program. w t hey? DFS comments +-++

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 1:38 PM, DFS wrote: >> This code is reeking with bad habits to be broken. Assigning a throwaway >> variable to walk the index is unnecessary when Python can do it for you >> behind the scenes. > > > Don't you think python also allocates a throwaway variable for use with zip

Re: pylint woes

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 08:28 PM, DFS wrote: > >> +-++ > >> |superfluous-parens |3 | I like to surround 'or' > >> statments with parens > > > > I would need examples to comment > > > if ("Please choose a

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 1:28 PM, DFS wrote: > Invalid constant name "cityzip" (invalid-name) > Invalid constant name "state" (invalid-name) > Invalid constant name "miles" (invalid-name) > Invalid constant name "store" (invalid-name) > Invalid variable name "rs" (invalid-name) ... huh?? The first

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Jim Dodgen
Great help. My Python program is a rewrite of a Perl program I wrote. An interesting exercise. The reason being it is targeted for a Raspberry Pi and for the Pi Python has the most support. *Jim Dodgen* On Sat, May 7, 2016 at 6:38 PM, Ben Finney wrote: > Chris Angelico writes: > > >

Re: pylint woes

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 08:04 PM, DFS wrote: > The lists I actually use are: > > for j in range(len(nms)): > cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)" > vals = nms[j],street[j],city[j],state[j],zipcd[j] > > > The enumerated version would be: > > ziplists = zip(nms,street,cit

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Random832
On Sat, May 7, 2016, at 22:43, Steven D'Aprano wrote: > > If not for the quotas, a citizen of some other country would have an > > equal chance to get a green card as a citizen of India or China. > > If you have a big hat with 5,000,000 tickets marked "Indian", and 500 > tickets marked "Finish",

Re: pylint woes

2016-05-07 Thread DFS
On 5/7/2016 2:52 PM, Christopher Reimer wrote: On 5/7/2016 9:51 AM, DFS wrote: Has anyone ever in history gotten 10/10 from pylint for a non-trivial program? I routinely get 10/10 for my code. While pylint isn't perfect and idiosyncratic at times, it's a useful tool to help break bad programmi

Re: pylint woes

2016-05-07 Thread DFS
On 5/7/2016 3:40 PM, Terry Reedy wrote: On 5/7/2016 12:51 PM, DFS wrote: This more-anal-than-me program generated almost 2 warnings for every line of code in my program. w t hey? If you don't like it, why do you use it? I've never used it before last night. I was shocked at what it spewed

Re: pylint woes

2016-05-07 Thread Steven D'Aprano
On Sun, 8 May 2016 02:51 am, DFS wrote: > This more-anal-than-me program generated almost 2 warnings for every > line of code in my program. w t hey? > > >DFS comments > +-++ --- > |messa

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 6:40 PM, Terry Reedy wrote: On 5/7/2016 3:17 PM, Christopher Reimer wrote: For my purposes, I'm using the list comprehension over filter to keep pylint happy. How sad. The pylint developers arrogantly take it on themselves to revise Python, against the wishes of Guido and the oth

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 12:43 PM, Steven D'Aprano wrote: > On Sun, 8 May 2016 04:40 am, Random832 wrote: > >> On Sat, May 7, 2016, at 11:16, Steven D'Aprano wrote: >>> > Indian and Chinese H1B holders are getting screwed, which is of course >>> > the whole objective of the country limits. >>> >>> T

Re: pylint woes

2016-05-07 Thread DFS
On 5/7/2016 10:14 PM, Stephen Hansen wrote: On Sat, May 7, 2016, at 06:16 PM, DFS wrote: Why is it better to zip() them up and use: for item1, item2, item3 in zip(list1, list2, list3): do something with the items than for j in range(len(list1)): do something with list1[j], list2[j]

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Steven D'Aprano
On Sun, 8 May 2016 07:35 am, Stephen Hansen wrote: > I'd read over PEP8 (the document, not the tool) and > apply style guide recommendations thoughtfully, not mechanically. Guido is not a fan of automated PEP8 checkers. He agrees entirely with your comment: apply style guides thoughtfully, not m

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 12:15 PM, DFS wrote: > On 5/7/2016 9:36 PM, Chris Angelico wrote: >> >> On Sun, May 8, 2016 at 11:16 AM, DFS wrote: >>> >>> street = [s.split(',')[0] for s in addr] >>> city = [c.split(',')[1].strip() for c in addr] >>> state = [s[-8:][:2] for s in addr] >>> zipcd = [z[

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Steven D'Aprano
On Sun, 8 May 2016 04:40 am, Random832 wrote: > On Sat, May 7, 2016, at 11:16, Steven D'Aprano wrote: >> > Indian and Chinese H1B holders are getting screwed, which is of course >> > the whole objective of the country limits. >> >> The *whole* objective? You don't think that *part* of the objecti

Re: pylint woes

2016-05-07 Thread MRAB
On 2016-05-08 03:14, Stephen Hansen wrote: On Sat, May 7, 2016, at 06:16 PM, DFS wrote: Why is it better to zip() them up and use: for item1, item2, item3 in zip(list1, list2, list3): do something with the items than for j in range(len(list1)): do something with list1[j], list2[j],

Re: pylint woes

2016-05-07 Thread DFS
On 5/7/2016 9:36 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 11:16 AM, DFS wrote: On 5/7/2016 1:01 PM, Chris Angelico wrote: The suggestion from a human would be to use zip(), or possibly to change your data structures. Happens like this: address data is scraped from a website: names

Re: pylint woes

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 06:16 PM, DFS wrote: > Why is it better to zip() them up and use: > > for item1, item2, item3 in zip(list1, list2, list3): > do something with the items > > than > > for j in range(len(list1)): > do something with list1[j], list2[j], list3[j], etc. Although Ch

Re: pylint woes

2016-05-07 Thread Terry Reedy
On 5/7/2016 3:52 PM, Ray Cote wrote: Biggest issue I have with pyLint is that it complains when function parameters are indented twice vs. once. pyFlakes likes the twice. Example: def function_name( parm_1, long_parm_name, …. end_of_long_list_of params) parm_1

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Terry Reedy
On 5/7/2016 3:17 PM, Christopher Reimer wrote: For my purposes, I'm using the list comprehension over filter to keep pylint happy. How sad. The pylint developers arrogantly take it on themselves to revise Python, against the wishes of Guido and the other core developers, and you and feel ob

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Ben Finney
Chris Angelico writes: > On Sun, May 8, 2016 at 9:54 AM, Jim Dodgen wrote: > > The empty token is needed but useless, it is arg[0] most people just > > repeat the program name > > Far from useless. It's how a process learns its own name, and yes, > repeating the image name is the most common way

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 11:16 AM, DFS wrote: > On 5/7/2016 1:01 PM, Chris Angelico wrote: >> The suggestion from a human would be to use zip(), or possibly to >> change your data structures. > > > Happens like this: > > address data is scraped from a website: > > names = tree.xpath() > addr = tree

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Ben Finney
Jim Dodgen writes: > I'm have problems redirecting stdout and stderr to /dev/null in a > program that does a fork and exec. You may be interested in the ‘python-daemon’ library https://pypi.python.org/pypi/python-daemon/>. It takes care of all the fiddly bits to turn your program into a well-beh

Re: pylint woes

2016-05-07 Thread DFS
On 5/7/2016 1:01 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 2:51 AM, DFS wrote: [1] pylint says "Consider using enumerate instead of iterating with range and len" the offending code is: for j in range(len(list1)): do something with list1[j], list2[j], list3[j], etc. enumeration would

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Jim Dodgen
Thanks Chris I now have things working using a version 3.4.3 it finds subprocess.DEVNULL just fine *Jim Dodgen* On Sat, May 7, 2016 at 5:10 PM, Chris Angelico wrote: > On Sun, May 8, 2016 at 9:54 AM, Jim Dodgen wrote: > > The empty token is needed but useless, it is arg[0] most people j

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 9:54 AM, Jim Dodgen wrote: > The empty token is needed but useless, it is arg[0] most people just repeat > the program name Far from useless. It's how a process learns its own name, and yes, repeating the image name is the most common way to provide that. > One other obser

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Jim Dodgen
*Thanks for the help* On Sat, May 7, 2016 at 12:16 PM, Martin A. Brown wrote: > > Hello there, > > >I'm new to python but well versed on other languages such as C and > >Perl > > > >I'm have problems redirecting stdout and stderr to /dev/null in a > >program that does a fork and exec. T found

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 1:31 PM, Marko Rauhamaa wrote: Christopher Reimer : Never know when an asshat hiring manager would reject my resume out of hand because my code fell short with pylint. Remember that it's not only the company checking you out but also you checking the company out. Would you want to

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Radek Holý
2016-05-07 21:17 GMT+02:00 Christopher Reimer : > On 5/5/2016 6:37 PM, Stephen Hansen wrote: > >> On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: >> >>> Which is one is correct (Pythonic)? Or does it matter? >>> >> First, pylint is somewhat opinionated, and its default options shouldn'

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 2:22 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer wrote: Since the code I'm working on is resume fodder (i.e., "Yes, I code in Python! Check out my chess engine code on GitHub!"), I want it to be as Pythonic and PEP8-compliant as possible. That inclu

Re: python, ctypes and GetIconInfo issue

2016-05-07 Thread mymyxin
Hello eryk sun, thank you very much for your help and detailed answers. With the provided links and useful information I should be able to get a better understanding how ctypes works internally. Thank you Hubert -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 4:42 AM, Michael Selik wrote: > >> +-++ >> |line-too-long|5 | meh >> > > Yeah, I think 80 characters can be somewhat tight. Still, 5 long lines in > 200ish lines of code? Sounds like you might be doing too much in tho

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 7:35 AM, Stephen Hansen wrote: > On Sat, May 7, 2016, at 12:17 PM, Christopher Reimer wrote: >> On 5/5/2016 6:37 PM, Stephen Hansen wrote: >> > On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: >> >> Which is one is correct (Pythonic)? Or does it matter? >> > First

Re: python - handling HTTP requests asynchronously

2016-05-07 Thread lordluke80
Il giorno sabato 7 maggio 2016 21:04:47 UTC+2, Michael Selik ha scritto: > On Fri, May 6, 2016 at 3:01 AM wrote: > > > The PDF is generated through an external API. Since currently is generated > > on demand, this is handled synchronously via an HTTP request/response. > > > Are you sending the

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 12:17 PM, Christopher Reimer wrote: > On 5/5/2016 6:37 PM, Stephen Hansen wrote: > > On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: > >> Which is one is correct (Pythonic)? Or does it matter? > > First, pylint is somewhat opinionated, and its default options sho

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Nathan Hilterbrand
On 05/07/2016 05:22 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer wrote: pylint. Never know when an asshat hiring manager would reject my resume out of hand because my code fell short with pylint. I see that as a good motivation to make sure your code was go

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer wrote: > On 5/5/2016 6:37 PM, Stephen Hansen wrote: >> >> On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: >>> >>> Which is one is correct (Pythonic)? Or does it matter? >> >> First, pylint is somewhat opinionated, and its default optio

Re: python chess engines

2016-05-07 Thread Christopher Reimer
On 5/3/2016 10:13 PM, DFS wrote: Wanted to start a new thread, rather than use the 'motivated' thread. Can you play your game at the console? Nope. Only displays the board on the console. An early version had the forward movement for pawns implemented. The way I think about a chess engine i

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Marko Rauhamaa
Christopher Reimer : > Never know when an asshat hiring manager would reject my resume out of > hand because my code fell short with pylint. Remember that it's not only the company checking you out but also you checking the company out. Would you want to work for an asshat hiring manager? Of cou

Re: pylint woes

2016-05-07 Thread Christopher Reimer
On 5/7/2016 12:52 PM, Ray Cote wrote: I’m impressed with 10/10. My approach is to ensure flake8 (a combination of pyflakes and pep8 checking) does not report any warnings and then run pyLint as a final check. I just installed pyflakes and ran it against my 10/10 files. It's not complaining ab

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/5/2016 6:37 PM, Stephen Hansen wrote: On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: Which is one is correct (Pythonic)? Or does it matter? First, pylint is somewhat opinionated, and its default options shouldn't be taken as gospel. There's no correct: filter is fine. Since

Re: pylint woes

2016-05-07 Thread Ray Cote
On Sat, May 7, 2016 at 2:52 PM, Christopher Reimer < christopher_rei...@icloud.com> wrote: > On 5/7/2016 9:51 AM, DFS wrote: > >> Has anyone ever in history gotten 10/10 from pylint for a non-trivial >> program? >> > > I routinely get 10/10 for my code. While pylint isn't perfect and > idiosyncrat

Re: pylint woes

2016-05-07 Thread Christopher Reimer
On 5/7/2016 12:23 PM, Stephen Hansen wrote: On Sat, May 7, 2016, at 11:52 AM, Christopher Reimer wrote: You can do better. You should strive for 10/10 whenever possible, figure out why you fall short and ask for help on the parts that don't make sense. I think this is giving far too much weigh

Re: pylint woes

2016-05-07 Thread Terry Reedy
On 5/7/2016 12:51 PM, DFS wrote: This more-anal-than-me program generated almost 2 warnings for every line of code in my program. w t hey? If you don't like it, why do you use it? I suppose the answer is that it did find a few things to check. You might be happier with pychecker, which is m

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/5/2016 7:57 PM, Stephen Hansen wrote: On Thu, May 5, 2016, at 07:46 PM, Dan Sommers wrote: On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote: ''.join(x for x in string if x.isupper()) The difference is, both filter and your list comprehension *build a list* which is not needed

Re: How to see html code under the particular web page element?

2016-05-07 Thread zljubisic
> There's probably some Angular JS code involved with this. Look at the > source (not the page source, the source code in the developer's > tools). Is it possible to get that code using python? -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 11:52 AM, Christopher Reimer wrote: > You can do better. You should strive for 10/10 whenever possible, > figure out why you fall short and ask for help on the parts that don't > make sense. I think this is giving far too much weight to pylint's opinion on what is "good"

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Martin A. Brown
Hello there, >I'm new to python but well versed on other languages such as C and >Perl > >I'm have problems redirecting stdout and stderr to /dev/null in a >program that does a fork and exec. T found this method googling >around and it is quite elegant compared to to the Perl version. > >So to

Re: pylint woes

2016-05-07 Thread Stephen Hansen
Pylint is very opinionated. Feel free to adjust its configuration to suit your opinions of style. In particular, several of these might be related to PEP8 style issues. On Sat, May 7, 2016, at 09:51 AM, DFS wrote: >DFS comments > +--

Re: python - handling HTTP requests asynchronously

2016-05-07 Thread Michael Selik
On Fri, May 6, 2016 at 3:01 AM wrote: > The PDF is generated through an external API. Since currently is generated > on demand, this is handled synchronously via an HTTP request/response. Are you sending the request or are you receiving the request? If you are sending, you can just use threads

Re: pylint woes

2016-05-07 Thread Christopher Reimer
On 5/7/2016 9:51 AM, DFS wrote: Has anyone ever in history gotten 10/10 from pylint for a non-trivial program? I routinely get 10/10 for my code. While pylint isn't perfect and idiosyncratic at times, it's a useful tool to help break bad programming habits. Since I came from a Java background

Re: pylint woes

2016-05-07 Thread Peter Pearson
On Sat, 7 May 2016 12:51:00 -0400, DFS wrote: > This more-anal-than-me program generated almost 2 warnings for every > line of code in my program. w t hey? Thank you for putting a sample of pylint output in front of my eyes; you inspired me to install pylint and try it out. If it teaches me ev

redirecting stdout and stderr to /dev/null

2016-05-07 Thread Jim Dodgen
I'm new to python but well versed on other languages such as C and Perl I'm have problems redirecting stdout and stderr to /dev/null in a program that does a fork and exec. T found this method googling around and it is quite elegant compared to to the Perl version. So to isolate things I made a m

Re: pylint woes

2016-05-07 Thread Michael Selik
On Sat, May 7, 2016 at 12:56 PM DFS wrote: > |mixed-indentation|186 | I always use tab > Don't mix tabs and spaces. I suggest selecting all lines and using your editor to convert spaces to tabs. Usually there's a feature to "tabify". > +-++ >

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Random832
On Sat, May 7, 2016, at 11:16, Steven D'Aprano wrote: > > Indian and Chinese H1B holders are getting screwed, which is of course > > the whole objective of the country limits. > > The *whole* objective? You don't think that *part* of the objective may > be > to ensure that citizens of countries ot

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 2:51 AM, DFS wrote: > [1] > pylint says "Consider using enumerate instead of iterating with range and > len" > > the offending code is: > for j in range(len(list1)): > do something with list1[j], list2[j], list3[j], etc. > > enumeration would be: > for j,item in enumerate(

Re: After a year using Node.js, the prodigal son returns

2016-05-07 Thread Laurent Pointal
Chris Angelico wrote: > On Fri, May 6, 2016 at 11:45 PM, Grant Edwards > wrote: >>> JavaScript is terrible. Really, really bad. And because of that, it >>> has the potential to sweep the world. >> >> If your reasoning is correct, it'll never be able to overtake PHP. >> >> I've never written anyth

pylint woes

2016-05-07 Thread DFS
This more-anal-than-me program generated almost 2 warnings for every line of code in my program. w t hey? DFS comments +-++ --- |message id |occurrences | +==

Re: How to see html code under the particular web page element?

2016-05-07 Thread Larry Martell
On Sat, May 7, 2016 at 10:27 AM, wrote: > Hi, > > on page: > https://hrti.hrt.hr/#/video/show/2203605/trebizat-prica-o-jednoj-vodi-i-jednom-narodu-dokumentarni-film > > there is a picture and in the middle of the picture there is a text > "Prijavite se za gledanje!" > > If I open the page in fir

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Marko Rauhamaa
Chris Angelico : > But immigration laws are a pretty terrible mess the world over, from > what I've seen, and I wish countries could drop the whole "but we have > to protect ourselves from foreigners" thing. At some point, those > "foreigners" become "citizens", and just as worthy of your protecti

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Marko Rauhamaa
Steven D'Aprano : > On Sat, 7 May 2016 06:50 pm, Marko Rauhamaa wrote: >> Indian and Chinese H1B holders are getting screwed, which is of course >> the whole objective of the country limits. > > The *whole* objective? You don't think that *part* of the objective > may be to ensure that citizens of

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 1:16 AM, Steven D'Aprano wrote: > > Obviously this system is a conspiracy to benefit citizens of Andorra > (population 85 thousand), Marshall Islands (pop. 70 thousand), > Liechtenstein (pop. 37 thousand), Nauru (pop. 9 thousand) and the Vatican > City (pop. 842). The Vatic

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Steven D'Aprano
On Sat, 7 May 2016 06:50 pm, Marko Rauhamaa wrote: > The United States has an "egalitarian" quota system that seeks to > promote diversity. By law, at most 7% of green cards can be awarded to > citizens of any individual country. So, by this fair principle, in any > given year, at most 7% of the g

How to see html code under the particular web page element?

2016-05-07 Thread zljubisic
Hi, on page: https://hrti.hrt.hr/#/video/show/2203605/trebizat-prica-o-jednoj-vodi-i-jednom-narodu-dokumentarni-film there is a picture and in the middle of the picture there is a text "Prijavite se za gledanje!" If I open the page in firefox and then use menu Tools > Web developer > Page sour

Re: A fun python CLI program for all to enjoy!

2016-05-07 Thread Peter Otten
DFS wrote: > getAddresses.py > > Scrapes addresses from www.usdirectory.com and stores them in a SQLite > database, or writes them to text files for mailing labels, etc > > Now, just by typing 'fast food Taco Bell 10 db all' you can find > out how many Taco Bells are within 10 miles of you, and

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Gregory Ewing
Stephen Hansen wrote: On Fri, May 6, 2016, at 11:43 PM, Gregory Ewing wrote: Whether you think this is a good strategy or not, beliavsky is right that it's not "equal". This is a pedantically and nonsensical definition of "equal", that ignores the many, many reasons why there are 1 in 20 wome

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Steven D'Aprano
On Sat, 7 May 2016 04:36 pm, Anthony Papillion wrote: > I'm trying to figure out why the following statements evaluate the way > they do and I'm not grasping it for some reason. I'm hoping someone can > help me. > > 40+2 is 42 #evaluates to True > But > 2**32 is 2**32 #evaluates to False That is

Re: Slight problems with python in Windows

2016-05-07 Thread Peter Toye
Zachary, An update - see below. Best regards, Peter mailto:pyt...@ptoye.com www.ptoye.com >> 2) According to the Programs and Files section of the Windows Control Panel, >> installing Python also installs something called the Python Launcher. When I >> try to remove this (so I can reinstall

Re: A fun python CLI program for all to enjoy!

2016-05-07 Thread alister
On Sat, 07 May 2016 18:24:45 +1200, Gregory Ewing wrote: > DFS wrote: >> Maybe it worked because the last time the file was written to was in a >> for loop, so I got lucky and the files weren't truncated? Don't know. > > It "works" because CPython disposes of objects as soon as they are not > re

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Marko Rauhamaa
Gregory Ewing : > Suppose there are 100 people wanting to ask questions, and there is > only time to answer 10 questions. If the 1 in 20 ratio holds, then 5 > of those people are women and the other 95 are men. > > Alternating between men and women means that all of the women get > their questions

Re: Slight problems with python in Windows

2016-05-07 Thread Peter Toye
Thanks Zachary. I should have put a newbie warning as I've never used or installed Python before, so some of what you've written goes over my head! Friday, May 6, 2016, 5:17:23 PM, you wrote: > Hi Peter, > On Fri, May 6, 2016 at 6:22 AM, Peter Toye wrote: >> I'm trying to install Python und

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Chris Angelico
On Sat, May 7, 2016 at 5:49 PM, Stephen Hansen wrote: > The long and short of it is: you should almost never use 'is' for > comparing integers (or strings). It doesn't mean what you think it does > and isn't useful to you. Compare equality. > > In general, the only things you should use 'is' for i

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Stephen Hansen
On Fri, May 6, 2016, at 11:43 PM, Gregory Ewing wrote: > Steven D'Aprano wrote: > > Who is setting and enforcing this quota, and given that only about 1 in 20 > > Python programmers is a woman, do you think men are seriously missing out > > on any opportunities? > > Suppose there are 100 people wa

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Stephen Hansen
On Fri, May 6, 2016, at 11:36 PM, Anthony Papillion wrote: > I'm trying to figure out why the following statements evaluate the way > they do and I'm not grasping it for some reason. I'm hoping someone can > help me. > > 40+2 is 42 #evaluates to True > But > 2**32 is 2**32 #evaluates to False > >

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Rustom Mody
On Saturday, May 7, 2016 at 12:13:59 PM UTC+5:30, Gregory Ewing wrote: > Steven D'Aprano wrote: > > Who is setting and enforcing this quota, and given that only about 1 in 20 > > Python programmers is a woman, do you think men are seriously missing out > > on any opportunities? > > Suppose there a

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Kev Dwyer
Anthony Papillion wrote: > I'm trying to figure out why the following statements evaluate the way > they do and I'm not grasping it for some reason. I'm hoping someone can > help me. > > 40+2 is 42 #evaluates to True > But > 2**32 is 2**32 #evaluates to False > > This is an example taken from a