Re: .split() Qeustion

2013-08-18 Thread wxjmfauth
Le dimanche 18 août 2013 01:30:14 UTC+2, Gregory Ewing a écrit : > wxjmfa...@gmail.com wrote: > > > Na + Cl --> NaCl > > > > > > the chemist combines *one mole* of sodium and *one > > > mole* of chlorine to get *one mole* of sodium chloride > > > > > > It's independent of the number of

Re: .split() Qeustion

2013-08-17 Thread Gregory Ewing
wxjmfa...@gmail.com wrote: Na + Cl --> NaCl the chemist combines *one mole* of sodium and *one mole* of chlorine to get *one mole* of sodium chloride It's independent of the number of "particles" in a mole. The actual number chosen for the unit is arbitrary, but number of particles is st

Re: .split() Qeustion

2013-08-17 Thread Roy Smith
I wrote: >> The recipe says, "Add one mole of carbon atoms". So, does the >> chemist follow the recipe and count out 6.022 x 10^23 atoms like >> he's supposed to? No. He says, "I don't have time for that. I'll >> just weigh out 12 grams. Good enough for government work." Sheesh. In articl

Re: .split() Qeustion

2013-08-17 Thread wxjmfauth
Le vendredi 16 août 2013 15:23:37 UTC+2, Roy Smith a écrit : > In article <2d88bc0f-fdcb-4685-87ed-c17998dd3...@googlegroups.com>, > > wxjmfa...@gmail.com wrote: > > > > > A chemist has to work and is always working in mole; as his > > > balance can only measure a mass, the calculation mole <

.split() Qeustion

2013-08-16 Thread Alfonso Andalon Jr.
-- http://mail.python.org/mailman/listinfo/python-list

Re: .split() Qeustion

2013-08-16 Thread Chris Angelico
On Sat, Aug 17, 2013 at 3:38 AM, Steven D'Aprano wrote: > On Fri, 16 Aug 2013 05:27:49 +, Dave Angel wrote: > >> I figure it just under a foot. I once attended a lecture by Grace >> Hopper where she handed out "nanoseconds," pieces of wire about a foot >> long. > > Is that based on the speed

Re: .split() Qeustion

2013-08-16 Thread Steven D'Aprano
On Fri, 16 Aug 2013 05:27:49 +, Dave Angel wrote: > I figure it just under a foot. I once attended a lecture by Grace > Hopper where she handed out "nanoseconds," pieces of wire about a foot > long. Is that based on the speed of light in a vacuum, speed of light in copper, speed of electr

Re: .split() Qeustion

2013-08-16 Thread Gregory Ewing
Gene Heskett wrote: Where a 1 degree shift, may or may not have been noticeable, was the cable equivalent of 7.7601420788892939683e-10 seconds, which was for the small foam cored cables used for such, with a Propagation Velocity of 0.78*C, only a very short length of cable. I'd have figured ho

Re: .split() Qeustion

2013-08-16 Thread Gene Heskett
On Friday 16 August 2013 10:27:36 Dave Angel did opine: > Roy Smith wrote: > > In article <520da6d1$0$3$c3e8da3$54964...@news.astraweb.com>, > > > > Steven D'Aprano wrote: > >> On Thu, 15 Aug 2013 16:43:41 +0100, Chris Angelico wrote: > >> > A mole is as much a number (6e23) as the light ye

Re: .split() Qeustion

2013-08-16 Thread Gene Heskett
On Friday 16 August 2013 10:07:12 Roy Smith did opine: > In article <520da6d1$0$3$c3e8da3$54964...@news.astraweb.com>, > > Steven D'Aprano wrote: > > On Thu, 15 Aug 2013 16:43:41 +0100, Chris Angelico wrote: > > > A mole is as much a number (6e23) as the light year is a number > > > (9.5e15

Re: .split() Qeustion

2013-08-16 Thread Grant Edwards
On 2013-08-16, Roy Smith wrote: > In article , > Ben Finney wrote: > >> Avogadro's Number is worth remembering, for mocking the pseudo-science >> of homeopathy http://www.1023.org.uk/what-is-homeopathy.php>. > > You have obviously never argued science with a homeopath if you believe > that know

Re: .split() Qeustion

2013-08-16 Thread Roy Smith
In article <2d88bc0f-fdcb-4685-87ed-c17998dd3...@googlegroups.com>, wxjmfa...@gmail.com wrote: > A chemist has to work and is always working in mole; as his > balance can only measure a mass, the calculation mole <-> mass > is always mandatory. That's because chemists are lazy. The recipe says,

Re: .split() Qeustion

2013-08-16 Thread wxjmfauth
- A mole is an amount of matter measured in [kg] . The Avogadro's number can only be a dimensionless number, [1] . The Avogadro's constant is the Avogadro's number (of "pieces" or "objects") per mol, [1 / mol]. A chemist has to work and is always working in mole; as his balance can only measu

Re: .split() Qeustion

2013-08-16 Thread Roy Smith
In article , Ben Finney wrote: > Avogadro's Number is worth remembering, for mocking the pseudo-science > of homeopathy http://www.1023.org.uk/what-is-homeopathy.php>. You have obviously never argued science with a homeopath if you believe that knowing Avogadro's number will in any way shake t

Re: .split() Qeustion

2013-08-15 Thread Ben Finney
Steven D'Aprano writes: > Not quite. A mole (abbreviation: mol) is a name for a specific number, > like couple (2) or dozen (12) or gross (144), only much bigger: 6.02e23. > And I can't believe I still remember that value :-) Avogadro's Number is worth remembering, for mocking the pseudo-scien

Re: .split() Qeustion

2013-08-15 Thread Dave Angel
Roy Smith wrote: > In article <520da6d1$0$3$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> On Thu, 15 Aug 2013 16:43:41 +0100, Chris Angelico wrote: >> >> > A mole is as much a number (6e23) as the light year is a number >> > (9.5e15). >> >> Not quite. A mole (abbreviat

Re: .split() Qeustion

2013-08-15 Thread Steven D'Aprano
On Fri, 16 Aug 2013 04:39:16 +, Steven D'Aprano wrote: > On Thu, 15 Aug 2013 22:56:57 +, Dave Angel wrote: > >> To expand a little on that, the unit of "amount of something" is a >> "gram mole", which is 6.2 **23 grams times the molecular (or atomic) >> weight. > > The unit of amount of

Re: .split() Qeustion

2013-08-15 Thread Steven D'Aprano
On Thu, 15 Aug 2013 22:56:57 +, Dave Angel wrote: > To expand a little on that, the unit of "amount of something" is a "gram > mole", which is 6.2 **23 grams times the molecular (or atomic) weight. The unit of amount of substance is mole. Gram-mole is an unfortunate synonym for mole. Unfortu

Re: .split() Qeustion

2013-08-15 Thread Roy Smith
In article <520da6d1$0$3$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Thu, 15 Aug 2013 16:43:41 +0100, Chris Angelico wrote: > > > A mole is as much a number (6e23) as the light year is a number > > (9.5e15). > > Not quite. A mole (abbreviation: mol) is a name for a spe

Re: .split() Qeustion

2013-08-15 Thread Steven D'Aprano
On Thu, 15 Aug 2013 17:40:43 -0400, Terry Reedy wrote: > On 8/15/2013 2:28 PM, Chris Angelico wrote: >> On Thu, Aug 15, 2013 at 5:54 PM, Joshua Landau >> wrote: >>> On 15 August 2013 16:43, Chris Angelico wrote: A mole is as much a number (6e23) as the light year is a number (9.5e15).

Re: .split() Qeustion

2013-08-15 Thread Steven D'Aprano
On Thu, 15 Aug 2013 19:28:46 +0100, Chris Angelico wrote: > On Thu, Aug 15, 2013 at 5:54 PM, Joshua Landau wrote: >> On 15 August 2013 16:43, Chris Angelico wrote: >>> A mole is as much a number (6e23) as the light year is a number >>> (9.5e15). >> >> A mole is a number. A light year is a unit.

Re: .split() Qeustion

2013-08-15 Thread Steven D'Aprano
On Thu, 15 Aug 2013 16:43:41 +0100, Chris Angelico wrote: > A mole is as much a number (6e23) as the light year is a number > (9.5e15). Not quite. A mole (abbreviation: mol) is a name for a specific number, like couple (2) or dozen (12) or gross (144), only much bigger: 6.02e23. And I can't bel

Re: .split() Qeustion

2013-08-15 Thread Dave Angel
Terry Reedy wrote: > On 8/15/2013 2:28 PM, Chris Angelico wrote: >> On Thu, Aug 15, 2013 at 5:54 PM, Joshua Landau wrote: >>> On 15 August 2013 16:43, Chris Angelico wrote: A mole is as much a number (6e23) as the light year is a number (9.5e15). >>> >>> A mole is a number. A light year is

Re: .split() Qeustion

2013-08-15 Thread Terry Reedy
On 8/15/2013 2:28 PM, Chris Angelico wrote: On Thu, Aug 15, 2013 at 5:54 PM, Joshua Landau wrote: On 15 August 2013 16:43, Chris Angelico wrote: A mole is as much a number (6e23) as the light year is a number (9.5e15). A mole is a number. A light year is a unit. A mole is an amount of som

Re: .split() Qeustion

2013-08-15 Thread Joshua Landau
On 15 August 2013 19:28, Chris Angelico wrote: > On Thu, Aug 15, 2013 at 5:54 PM, Joshua Landau wrote: >> On 15 August 2013 16:43, Chris Angelico wrote: >>> A mole is as much a number (6e23) as the light year is a number (9.5e15). >> >> A mole is a number. A light year is a unit. > > A mole is a

Re: .split() Qeustion

2013-08-15 Thread Chris Angelico
On Thu, Aug 15, 2013 at 5:54 PM, Joshua Landau wrote: > On 15 August 2013 16:43, Chris Angelico wrote: >> A mole is as much a number (6e23) as the light year is a number (9.5e15). > > A mole is a number. A light year is a unit. A mole is an amount of something. Avogadro's Number is a number, whi

Re: .split() Qeustion

2013-08-15 Thread Joshua Landau
On 15 August 2013 16:43, Chris Angelico wrote: > A mole is as much a number (6e23) as the light year is a number (9.5e15). A mole is a number. A light year is a unit. -- http://mail.python.org/mailman/listinfo/python-list

Re: .split() Qeustion

2013-08-15 Thread Chris Angelico
On Thu, Aug 15, 2013 at 4:30 PM, Lele Gaifax wrote: > MRAB writes: > >> On 15/08/2013 15:38, Lele Gaifax wrote: >>> wxjmfa...@gmail.com writes: PS A "mole" is not a number. >>> >>> Oh, nice to know. And OOC, what is a "mole" in your stupid science? >>> OTOH, WTF does that matter in current t

Re: .split() Qeustion

2013-08-15 Thread Lele Gaifax
MRAB writes: > On 15/08/2013 15:38, Lele Gaifax wrote: >> wxjmfa...@gmail.com writes: >>> PS A "mole" is not a number. >> >> Oh, nice to know. And OOC, what is a "mole" in your stupid science? >> OTOH, WTF does that matter in current thread and with Python in general? >> > A "mole" is a term from

Re: .split() Qeustion

2013-08-15 Thread MRAB
On 15/08/2013 15:38, Lele Gaifax wrote: wxjmfa...@gmail.com writes: As a stupid scientist, I have the habbit to compare things of the same nature with the same units. This *string* containing one *character* sys.getsizeof('a') 26 consumes 26 *bytes*. I'm not an expert in stupid science,

Re: .split() Qeustion

2013-08-15 Thread Lele Gaifax
wxjmfa...@gmail.com writes: > As a stupid scientist, I have the habbit to compare > things of the same nature with the same units. > > This *string* containing one *character* > sys.getsizeof('a') > 26 > > consumes 26 *bytes*. I'm not an expert in stupid science, and I fail to see the "commo

Re: .split() Qeustion

2013-08-15 Thread wxjmfauth
I perfectly knows what Python does. I missinterpreting nothing. I opened my example in binary mode just to show the real endings. It still remains the """...""" has its owns EOL and one has to be aware of it. No more, no less. ("""...""" and tokenize.py is funny) jmf -- http://mail.p

Re: .split() Qeustion

2013-08-15 Thread Steven D'Aprano
On Thu, 15 Aug 2013 02:46:20 -0700, wxjmfauth wrote: > A technical ascpect of triple quoted strings is that the "end of lines" > are not respected. > import zzz zzz.__doc__ > 'abc\ndef\n' You are misinterpreting what you are seeing. You are not reading lines of text from a file. You

Re: .split() Qeustion

2013-08-15 Thread Chris Angelico
On Thu, Aug 15, 2013 at 10:46 AM, wrote: > A technical ascpect of triple quoted strings is > that the "end of lines" are not respected. > import zzz zzz.__doc__ > 'abc\ndef\n' with open('zzz.py', 'rb') as fo: > ... r = fo.read() > ... r > b'"""abc\r\ndef\r\n"""\r\n' > > No

Re: .split() Qeustion

2013-08-15 Thread wxjmfauth
A technical ascpect of triple quoted strings is that the "end of lines" are not respected. >>> import zzz >>> zzz.__doc__ 'abc\ndef\n' >>> with open('zzz.py', 'rb') as fo: ... r = fo.read() ... >>> r b'"""abc\r\ndef\r\n"""\r\n' Now, one can argue... jmf -- http://mail.python.org/mailma

Re: .split() Qeustion

2013-08-15 Thread Duncan Booth
Joshua Landau wrote: > That's true with this example, but is: > > lines = [ > "Developments in high-speed rail, and high-speed", > "transport more generally, have historically been", > "impeded by the difficulties in managing friction", > "and air resistance, both of which become

Re: .split() Qeustion

2013-08-15 Thread wxjmfauth
Le mercredi 14 août 2013 19:14:59 UTC+2, Chris Angelico a écrit : > On Wed, Aug 14, 2013 at 6:05 PM, wrote: > > > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: > > >> I'm always and still be suprised by the number of hard coded > > >> '\n' one can find in Python code when the port

Re: .split() Qeustion

2013-08-15 Thread Steven D'Aprano
On Wed, 14 Aug 2013 13:05:50 -0400, random832 wrote: > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: >> I'm always and still be suprised by the number of hard coded '\n' one >> can find in Python code when the portable (here win) >> >> >>> os.linesep >> '\r\n' >> >> exists. > > Bec

Re: .split() Qeustion

2013-08-14 Thread Terry Reedy
On 8/14/2013 1:05 PM, random...@fastmail.us wrote: On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: I'm always and still be suprised by the number of hard coded '\n' one can find in Python code when the portable (here win) os.linesep '\r\n' exists. Because high-level code isn't

Re: .split() Qeustion

2013-08-14 Thread Chris Angelico
On Wed, Aug 14, 2013 at 6:29 PM, Tim Chase wrote: > On 2013-08-14 18:14, Chris Angelico wrote: >> On Wed, Aug 14, 2013 at 6:05 PM, wrote: >> > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: >> >> I'm always and still be suprised by the number of hard coded >> >> '\n' one can find in

Re: .split() Qeustion

2013-08-14 Thread Skip Montanaro
On Wed, Aug 14, 2013 at 12:05 PM, wrote: > Because high-level code isn't supposed to use the os module directly. That seems a bit extreme. One would hope that Guido and the rest of the crew created the os module so people would use it instead of resorting to other lower level hacks. A quick fi

Re: .split() Qeustion

2013-08-14 Thread Tim Chase
On 2013-08-14 18:14, Chris Angelico wrote: > On Wed, Aug 14, 2013 at 6:05 PM, wrote: > > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: > >> I'm always and still be suprised by the number of hard coded > >> '\n' one can find in Python code when the portable (here > >> win) > >> > >> >

Re: .split() Qeustion

2013-08-14 Thread Chris Angelico
On Wed, Aug 14, 2013 at 6:05 PM, wrote: > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: >> I'm always and still be suprised by the number of hard coded >> '\n' one can find in Python code when the portable (here >> win) >> >> >>> os.linesep >> '\r\n' >> >> exists. > > Because high-le

Re: .split() Qeustion

2013-08-14 Thread random832
On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: > I'm always and still be suprised by the number of hard coded > '\n' one can find in Python code when the portable (here > win) > > >>> os.linesep > '\r\n' > > exists. Because high-level code isn't supposed to use the os module directly

Re: .split() Qeustion

2013-08-14 Thread wxjmfauth
Le mercredi 14 août 2013 13:55:23 UTC+2, Joshua Landau a écrit : > On 14 August 2013 12:45, Peter Otten <__pete...@web.de> wrote: > > > Joshua Landau wrote: > > >> On 14 August 2013 09:30, Alister wrote: > > >>> I would agree with the last statement. > > >>> Please write list definitions as li

Re: .split() Qeustion

2013-08-14 Thread Alister
On Wed, 14 Aug 2013 11:31:01 +0100, Joshua Landau wrote: > On 14 August 2013 09:30, Alister wrote: >> On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: >> >>> On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: How can I use the '.split()' method (am I right in calling it a met

Re: .split() Qeustion

2013-08-14 Thread Joshua Landau
On 14 August 2013 12:45, Peter Otten <__pete...@web.de> wrote: > Joshua Landau wrote: >> On 14 August 2013 09:30, Alister wrote: >>> I would agree with the last statement. >>> Please write list definitions as lists rather than taking a short-cut to >>> save a few key presses >> >> That's true with

Re: .split() Qeustion

2013-08-14 Thread Peter Otten
Joshua Landau wrote: > On 14 August 2013 09:30, Alister wrote: >> On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: >> >>> On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: How can I use the '.split()' method (am I right in calling it a method?) without instead of writing eac

Re: .split() Qeustion

2013-08-14 Thread Joshua Landau
On 14 August 2013 09:30, Alister wrote: > On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: > >> On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: >>> How can I use the '.split()' method (am I right in calling it a >>> method?) without instead of writing each comma between words in the

Re: .split() Qeustion

2013-08-14 Thread Alister
On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: > On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: >> How can I use the '.split()' method (am I right in calling it a >> method?) without instead of writing each comma between words in the pie >> list in the following code? Also, is the

Re: .split() Qeustion

2013-08-13 Thread eschneider92
It's obvious that the word 'without' in my first sentence was meant to be ommited, and it's a simple question. Thank Gary! -- http://mail.python.org/mailman/listinfo/python-list

Re: .split() Qeustion

2013-08-13 Thread Krishnan Shankar
Hi, >How can I use the '.split()' method (am I right in calling it a method?) The .split() is a method in Python which comes as in built method for String objects in Python. Any string defined in python will have the ability to call this function. >>> var = 'Hello how r u?' >>> dir(var) ['__add_

Re: .split() Qeustion

2013-08-13 Thread Dave Angel
eschneide...@comcast.net wrote: > How can I use the '.split()' method (am I right in calling it a method?) > without instead of writing each comma between words in the pie list in the > following code? Also, is there a way to use .split instead of typing the > apostrophes? Thank you. > > import

Re: .split() Qeustion

2013-08-13 Thread Gary Herron
On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: How can I use the '.split()' method (am I right in calling it a method?) without instead of writing each comma between words in the pie list in the following code? Also, is there a way to use .split instead of typing the apostrophes? Than

.split() Qeustion

2013-08-13 Thread eschneider92
How can I use the '.split()' method (am I right in calling it a method?) without instead of writing each comma between words in the pie list in the following code? Also, is there a way to use .split instead of typing the apostrophes? Thank you. import random pie=['keylime', 'peach', 'apple', 'c