[Tutor] attempting to install PIP

2014-11-24 Thread Paul LaBerge
Hello, I’m trying to install PIP on a Mac running Yosemite. I downloaded get-pip.py from https://pip.pypa.io/en/latest/installing.html . I copied it to /usr/local/bin/ then ran python get-pip.py. It repeatedly downloaded something up to a count o

Re: [Tutor] attempting to install PIP

2014-11-24 Thread Albert-Jan Roskam
> From: Paul LaBerge >To: tutor@python.org >Sent: Monday, November 24, 2014 6:05 AM >Subject: [Tutor] attempting to install PIP > > > >Hello, >I’m trying to install PIP on a Mac running Yosemite. I downloaded get-pip.py >from https://pip.pypa.io/en/latest/installing.html. I copied it to >/usr

Re: [Tutor] multiprocessing question

2014-11-24 Thread Albert-Jan Roskam
 - Original Message - > From: Cameron Simpson > To: Python Mailing List > Cc: > Sent: Monday, November 24, 2014 2:20 AM > Subject: Re: [Tutor] multiprocessing question > > On 23Nov2014 22:30, Albert-Jan Roskam > wrote: >> I created some code to get records from a potentially gia

[Tutor] pexpect interactive password entry for luks device

2014-11-24 Thread Adam Gold
I'm trying to do something really simply (I think) with pexpect but must be missing an obvious step. I want to ssh from host to guest, establish a CIFS connection on the guest to a share somewhere else on the local network, open a luks loop device on the share by entering the password (I don't wan

[Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread boB Stepp
Python 2.7.8 Win7Pro >>> str = "0123456789" >>> str[-1] '9' >>> str[-3:-1] '78' >>> str[-3:] '789' I understand that the above is "the way it is" in Python, but I am puzzled why the designers did not choose that str[-3:-1] returns '789', especially since str[-1] returns '9'. What is the reason fo

Re: [Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread Zachary Ware
On Mon, Nov 24, 2014 at 12:32 PM, boB Stepp wrote: > Python 2.7.8 > Win7Pro > str = "0123456789" str[-1] > '9' str[-3:-1] > '78' str[-3:] > '789' > > I understand that the above is "the way it is" in Python, but I am > puzzled why the designers did not choose that str[-3:-1] re

Re: [Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread boB Stepp
On Mon, Nov 24, 2014 at 12:57 PM, Zachary Ware wrote: [...] > > Have I clarified or muddied it for you? :) Clarified, I believe, if my following statements are correct: I did not consider that the behavior was symmetric with positive indices. So, index 0 is the "center" relative to which positive

Re: [Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread boB Stepp
On Mon, Nov 24, 2014 at 1:06 PM, boB Stepp wrote: > On Mon, Nov 24, 2014 at 12:57 PM, Zachary Ware > wrote: > [...] >> >> Have I clarified or muddied it for you? :) > > Clarified, I believe, if my following statements are correct: I did > not consider that the behavior was symmetric with positive

Re: [Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread Zachary Ware
On Mon, Nov 24, 2014 at 1:06 PM, boB Stepp wrote: > On Mon, Nov 24, 2014 at 12:57 PM, Zachary Ware > wrote: > [...] >> >> Have I clarified or muddied it for you? :) > > Clarified, I believe, if my following statements are correct: I did > not consider that the behavior was symmetric with positive

Re: [Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread Steven D'Aprano
On Mon, Nov 24, 2014 at 12:32:27PM -0600, boB Stepp wrote: > Python 2.7.8 > Win7Pro > > >>> str = "0123456789" > >>> str[-1] > '9' > >>> str[-3:-1] > '78' > >>> str[-3:] > '789' > > I understand that the above is "the way it is" in Python, but I am > puzzled why the designers did not choose that

Re: [Tutor] multiprocessing question

2014-11-24 Thread Cameron Simpson
On 24Nov2014 12:56, Albert-Jan Roskam wrote: > From: Cameron Simpson On 23Nov2014 22:30, Albert-Jan Roskam wrote: I created some code to get records from a potentially giant .csv file. This implements a __getitem__ method that gets records from a memory-mapped csv file. In order for this to

Re: [Tutor] attempting to install PIP

2014-11-24 Thread Paul LaBerge
Thanks for all your suggestions. I took the option of downloading .tar.gz pip from PyPI; untar; cd to it; then; sudo python setup.py install This installed successfully finishing with: Processing dependencies for pip==6.0.dev1 Finished processing dependencies for pip==6

[Tutor] ran into a problem with pip install

2014-11-24 Thread Clayton Kirkwood
I was trying to pip install beautifulsoup and ran into the following error. It appears to be 2.x because of the print. I am installing to a python 3.4.2. What do I need to do? I tried to log a bug report to PyPI Bug Reports but that apparently isn't the cool thing to do. I can't perceive why the te

Re: [Tutor] ran into a problem with pip install

2014-11-24 Thread Zachary Ware
On Mon, Nov 24, 2014 at 10:28 PM, Clayton Kirkwood wrote: > I was trying to pip install beautifulsoup and ran into the following error. > It appears to be 2.x because of the print. Your diagnosis is correct, beautifulsoup 3.2.1 is written for Python 2. > I am installing to a python 3.4.2. What d

Re: [Tutor] multiprocessing question

2014-11-24 Thread eryksun
On Sun, Nov 23, 2014 at 7:20 PM, Cameron Simpson wrote: > > A remark about the create_lookup() function on pastebin: you go: > > record_start += len(line) > > This presumes that a single text character on a line consumes a single byte > or memory or file disc space. However, your data file is utf

Re: [Tutor] "Philosophical" question about string slicing from end of a string

2014-11-24 Thread eryksun
On Mon, Nov 24, 2014 at 1:33 PM, Zachary Ware wrote: > Also note that there's no way to get the last member with a negative > second index. Also note that, given a -1 step, there's no way to get the first member with a non-negative second index. >>> s[-1:0:-1] '987654321' It requires a