Re: syntax difference

2018-06-16 Thread Chris Angelico
On Sun, Jun 17, 2018 at 3:56 PM, Ben Finney wrote: > Chris Angelico writes: > >> On Sun, Jun 17, 2018 at 3:30 PM, Ben Finney >> wrote: >> > (or, if you want to continue with the older less-flexible style, > > (I gave an unhelpful URL for that documentation. Try this instead > https://docs.pytho

Re: syntax difference

2018-06-16 Thread Jim Lee
On 06/16/2018 10:13 PM, Sharan Basappa wrote: I think I am now confused with format options in Python. I tried an example as below and both print proper value: age = 35 print "age is %s" % age print "age is %d" % age %run "D:/Projects/Initiatives/machine learning/programs/six.py" age is 35 a

Re: syntax difference

2018-06-16 Thread Ben Finney
Chris Angelico writes: > On Sun, Jun 17, 2018 at 3:30 PM, Ben Finney > wrote: > > (or, if you want to continue with the older less-flexible style, (I gave an unhelpful URL for that documentation. Try this instead https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting>.)

Re: syntax difference

2018-06-16 Thread Chris Angelico
On Sun, Jun 17, 2018 at 3:30 PM, Ben Finney wrote: > Sharan Basappa writes: > >> I think I am now confused with format options in Python. > > You should refer to the documentation for string formatting > https://docs.python.org/3/library/stdtypes.html#str.format> > https://docs.python.org/3/libra

Re: syntax difference

2018-06-16 Thread Ben Finney
Sharan Basappa writes: > I think I am now confused with format options in Python. You should refer to the documentation for string formatting https://docs.python.org/3/library/stdtypes.html#str.format> https://docs.python.org/3/library/string.html#formatstrings> (or, if you want to continue wit

Re: syntax difference

2018-06-16 Thread Sharan Basappa
On Sunday, 17 June 2018 07:25:57 UTC+5:30, Ben Bacarisse wrote: > Cameron Simpson writes: > > > ... In Python 3 we have "format strings", which let you write: > > > > name = "Sharon" > > age = 35 > > print(f"The person named {name|r} is {age} years old.") > > You meant {name!r} I think there

Re: Understanding memory location of Python variables

2018-06-16 Thread Grant Edwards
On 2018-06-16, ip.b...@gmail.com wrote: > I'm intrigued by the output of the following code, which was totally > contrary to my expectations. Can someone tell me what is happening? > myName = "Kevin" id(myName) > 47406848 id(myName[0]) > 36308576 id(myName[1]) > 2476000 What'

Re: syntax difference

2018-06-16 Thread Ben Bacarisse
Cameron Simpson writes: > ... In Python 3 we have "format strings", which let you write: > > name = "Sharon" > age = 35 > print(f"The person named {name|r} is {age} years old.") You meant {name!r} I think there. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Scanner freakishness [was Re: Python list vs google group]

2018-06-16 Thread Chris Angelico
On Sun, Jun 17, 2018 at 10:58 AM, Gregory Ewing wrote: > Alister wrote: >> >> A few quick tests later confirmed that whenever the photocopier made >> multiple copies (approx 10+) the circuit would reset >> Cust advised to relocate photocopier, case closed :-) > > > I was expecting the solution to

Re: Scanner freakishness [was Re: Python list vs google group]

2018-06-16 Thread Gregory Ewing
Alister wrote: A few quick tests later confirmed that whenever the photocopier made multiple copies (approx 10+) the circuit would reset Cust advised to relocate photocopier, case closed :-) I was expecting the solution to be a note attached to the photocopier saying "Please do not make more

Re: Understanding memory location of Python variables

2018-06-16 Thread Chris Angelico
On Sun, Jun 17, 2018 at 2:38 AM, wrote: > Hi everyone, > > I'm intrigued by the output of the following code, which was totally contrary > to my expectations. Can someone tell me what is happening? > myName = "Kevin" id(myName) > 47406848 id(myName[0]) > 36308576 id(myName[1]

Re: Understanding memory location of Python variables

2018-06-16 Thread Steven D'Aprano
On Sat, 16 Jun 2018 09:38:07 -0700, ip.bcrs wrote: > Hi everyone, > > I'm intrigued by the output of the following code, which was totally > contrary to my expectations. Can someone tell me what is happening? > myName = "Kevin" id(myName) > 47406848 id(myName[0]) > 36308576 i

Re: syntax difference

2018-06-16 Thread Cameron Simpson
On 16Jun2018 12:01, Sharan Basappa wrote: Is there a difference between these prints. The first one looks a bit complex. So, why should it be used? my_age = 35 # not a lie print "my age %s." % my_age print "my age ", my_age Output: %run "D:/Projects/Initiatives/machine learning/programs/five

Re: pattern

2018-06-16 Thread Cameron Simpson
On 16Jun2018 11:59, Sharan Basappa wrote: This is so kind of you. Thanks for spending time to explain the code. It did help a lot. I did go back and brush up lists & dictionaries. At this point, I think, I need to go back and brush up Python from the start. So, I will do that first. Sure, sou

Re: Python list vs google group

2018-06-16 Thread Jim Lee
On 06/16/2018 12:38 PM, Rick Johnson wrote: On Friday, June 15, 2018 at 9:14:13 PM UTC-5, Richard Damon wrote: if the Windows driver broke some specification but still sort of worked [...] ...that's when the engineers in the Redmond, WA area know it's time to package and ship the product!

Re: Scanner freakishness [was Re: Python list vs google group]

2018-06-16 Thread Alister via Python-list
On Sat, 16 Jun 2018 14:25:52 -0400, William Ray Wing wrote: >> On Jun 16, 2018, at 9:10 AM, Steven D'Aprano >> wrote: >> >> On Sat, 16 Jun 2018 11:54:15 +1000, Chris Angelico wrote: >> >>> On Sat, Jun 16, 2018 at 11:00 AM, Jim Lee wrote: >> I once had a Mustek color scanner that came wit

Re: Python list vs google group

2018-06-16 Thread Rick Johnson
On Friday, June 15, 2018 at 9:14:13 PM UTC-5, Richard Damon wrote: > if the Windows driver broke some specification but still sort > of worked [...] ...that's when the engineers in the Redmond, WA area know it's time to package and ship the product! -- https://mail.python.org/mailman/listinfo/py

Re: Scanner freakishness [was Re: Python list vs google group]

2018-06-16 Thread William Ray Wing
> On Jun 16, 2018, at 9:10 AM, Steven D'Aprano > wrote: > > On Sat, 16 Jun 2018 11:54:15 +1000, Chris Angelico wrote: > >> On Sat, Jun 16, 2018 at 11:00 AM, Jim Lee wrote: > >>> I once had a Mustek color scanner that came with a TWAIN driver. If >>> the room temperature was above 80 degrees

Re: Understanding memory location of Python variables

2018-06-16 Thread Alister via Python-list
On Sat, 16 Jun 2018 13:19:04 -0400, Joel Goldstick wrote: > On Sat, Jun 16, 2018 at 12:38 PM, wrote: >> Hi everyone, >> >> I'm intrigued by the output of the following code, which was totally >> contrary to my expectations. Can someone tell me what is happening? >> > myName = "Kevin" > i

Re: syntax difference

2018-06-16 Thread Alister via Python-list
On Sat, 16 Jun 2018 12:01:16 -0700, Sharan Basappa wrote: > Is there a difference between these prints. The first one looks a bit > complex. So, why should it be used? > > my_age = 35 # not a lie > > print "my age %s." % my_age print "my age ", my_age > > Output: > %run "D:/Projects/Initiatives

syntax difference

2018-06-16 Thread Sharan Basappa
Is there a difference between these prints. The first one looks a bit complex. So, why should it be used? my_age = 35 # not a lie print "my age %s." % my_age print "my age ", my_age Output: %run "D:/Projects/Initiatives/machine learning/programs/five.py" my age 35. my age 35 -- https://mail.p

Re: pattern

2018-06-16 Thread Sharan Basappa
Dear Cameron, This is so kind of you. Thanks for spending time to explain the code. It did help a lot. I did go back and brush up lists & dictionaries. At this point, I think, I need to go back and brush up Python from the start. So, I will do that first. On Friday, 15 June 2018 09:12:22 UTC+5:3

Re: Python list vs google group

2018-06-16 Thread Paul St George
On 15/06/2018 17:33, T Berger wrote: On Friday, June 15, 2018 at 12:14:30 PM UTC-4, Mark Lawrence wrote: On 15/06/18 16:47, T Berger wrote: On Friday, June 15, 2018 at 11:31:47 AM UTC-4, Alister wrote: it certainly seems to be the source of most SPAM as such some users of this list/newsgroup

How to get the versions of dependecies

2018-06-16 Thread Cecil Westerhof
If I update prompt-toolkit, I get: ipython 6.4.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.3 which is incompatible. So I should not. At least not at the moment. But how do I get to know which versions of a package are needed? When Using: pip3 -vvv

Re: Python list vs google group

2018-06-16 Thread Gene Heskett
On Saturday 16 June 2018 12:31:28 Jim Lee wrote: > On 06/16/2018 08:36 AM, Richard Damon wrote: > > On 6/15/18 11:07 PM, Jim Lee wrote: > >>> [snip] > >>> > I once had a Mustek color scanner that came with a TWAIN driver.  > If the room temperature was above 80 degrees F, it would scan i

Re: For specific keys , extract non empty values in a dictionary

2018-06-16 Thread Peter Otten
Ganesh Pal wrote: > *How do I check few specific/selected keys in a dictionary and extract > their values if they are not empty* You mean not None. > o_num = {'one': 1, > 'three': 3, > 'bar': None, > 'five' : 5, > 'rum' : None, > 'seven' : Non

Re: Understanding memory location of Python variables

2018-06-16 Thread MRAB
On 2018-06-16 17:38, ip.b...@gmail.com wrote: Hi everyone, I'm intrigued by the output of the following code, which was totally contrary to my expectations. Can someone tell me what is happening? myName = "Kevin" id(myName) 47406848 id(myName[0]) 36308576 id(myName[1]) 2476000 I expecte

Re: Understanding memory location of Python variables

2018-06-16 Thread Joel Goldstick
On Sat, Jun 16, 2018 at 12:38 PM, wrote: > Hi everyone, > > I'm intrigued by the output of the following code, which was totally contrary > to my expectations. Can someone tell me what is happening? > myName = "Kevin" id(myName) > 47406848 id(myName[0]) > 36308576 id(myName[1

For specific keys , extract non empty values in a dictionary

2018-06-16 Thread Ganesh Pal
*How do I check few specific/selected keys in a dictionary and extract their values if they are not empty* *Example : Extract the values for key "one","three","seven" and "nine” if they are not empty* *Input :* *o_num = {'one': 1,* * 'three': 3,* * 'bar': None,* *

Understanding memory location of Python variables

2018-06-16 Thread ip . bcrs
Hi everyone, I'm intrigued by the output of the following code, which was totally contrary to my expectations. Can someone tell me what is happening? >>> myName = "Kevin" >>> id(myName) 47406848 >>> id(myName[0]) 36308576 >>> id(myName[1]) 2476000 I expected myName[0] to be located at the same

Re: Python list vs google group

2018-06-16 Thread Jim Lee
On 06/16/2018 08:36 AM, Richard Damon wrote: On 6/15/18 11:07 PM, Jim Lee wrote: [snip] I once had a Mustek color scanner that came with a TWAIN driver.  If the room temperature was above 80 degrees F, it would scan in color - otherwise, only black & white.  I was *sure* it was a hardware pro

Re: Python list vs google group

2018-06-16 Thread Richard Damon
On 6/15/18 11:07 PM, Jim Lee wrote: > > > On 06/15/2018 07:08 PM, Richard Damon wrote: >> On 6/15/18 9:00 PM, Jim Lee wrote: >>> >>> On 06/15/2018 05:00 PM, Chris Angelico wrote: On Sat, Jun 16, 2018 at 4:52 AM, Rob Gaddi wrote: > On 06/15/2018 11:44 AM, Larry Martell wrote: >>

Scanner freakishness [was Re: Python list vs google group]

2018-06-16 Thread Steven D'Aprano
On Sat, 16 Jun 2018 11:54:15 +1000, Chris Angelico wrote: > On Sat, Jun 16, 2018 at 11:00 AM, Jim Lee wrote: >> I once had a Mustek color scanner that came with a TWAIN driver. If >> the room temperature was above 80 degrees F, it would scan in color - >> otherwise, only black & white. I was *

Re: text mining

2018-06-16 Thread Brian Oney via Python-list
На 15 юни 2018 г. 14:57:46 GMT+02:00, Steven D'Aprano написа: >Seriously, you are asking strangers to help you out of the goodness of >their heart. If your intention was to send the message that you're >lazy, >drunk, or just don't give a damn about the question, you were >successful. Answers

XSD data mapper lib

2018-06-16 Thread Nagy László Zsolt
  Hello! I wonder what kind of XSD <-> Python class mapper should I use for my project. I need something that can generate classes from XSD files, and then parse XML to an objecttree and also dump object trees to XML. I'll be using Python version 3.6 and I would prefer to use something that is b