Re: pip --user by default

2018-01-15 Thread Abdur-Rahmaan Janhangeer
another thing which amazed me with pip is that you can write library1 == 1.2.7 library2 == 3.6.1 in requirements.txt and pip install requirements.txt will install those libs On 13 Jan 2018 17:16, "Thomas Jollans" wrote: > Hi, > > I recently discovered the wonders of pip.conf: if I create a fi

Re: Generating SVG from turtle graphics

2018-01-15 Thread Abdur-Rahmaan Janhangeer
https://image.online-convert.com/convert-to-svg On 15 Jan 2018 02:55, "Niles Rogoff" wrote: > On Sun, 14 Jan 2018 16:32:53 +0400, Abdur-Rahmaan Janhangeer wrote: > > > maybe save to .png then use another tool to svg > > PNG is a bitmap format[1], so you can't covert it to an SVG (a vector > form

Re: Detecting a cycle in a graph

2018-01-15 Thread Frank Millman
"MRAB" wrote in message news:1f67363c-4d2a-f5ac-7fa8-b6690ddba...@mrabarnett.plus.com... On 2018-01-15 06:15, Frank Millman wrote: > I start my cycle-detection with a node with 0 incoming connections. > > def find_cycle(node, path): > for output in node.outputs: > if output in p

Re: Can utf-8 encoded character contain a byte of TAB?

2018-01-15 Thread Chris Angelico
On Tue, Jan 16, 2018 at 8:29 AM, Peng Yu wrote: >> Just to be clear, TAB *only* appears in utf-8 as the encoding for the actual >> TAB character, not as a part of any other character's encoding. The only >> bytes that can appear in the utf-8 encoding of non-ascii characters are >> starting with

Re: Can utf-8 encoded character contain a byte of TAB?

2018-01-15 Thread Peng Yu
> Just to be clear, TAB *only* appears in utf-8 as the encoding for the actual > TAB character, not as a part of any other character's encoding. The only > bytes that can appear in the utf-8 encoding of non-ascii characters are > starting with 0xC2 through 0xF4, followed by one or more of 0x80 t

Re: Detecting a cycle in a graph

2018-01-15 Thread MRAB
On 2018-01-15 06:15, Frank Millman wrote: "Christian Gollwitzer" wrote in message news:p3gh84$kfm$1...@dont-email.me... Am 14.01.18 um 22:04 schrieb Christian Gollwitzer: > Am 14.01.18 um 09:30 schrieb Frank Millman: >> I need to detect when a 'cycle' occurs - when a path loops back on >> its

Re: pip --user by default

2018-01-15 Thread Skip Montanaro
> I just tried that and it turns out that that installs the package into > the main anaconda/miniconda installation rather than the conda env. > Definitely not what you want. Yes, installing in the root environment (as it's called) is generally a bad idea. I use Conda at work, in a shared sort of

Re: requests / SSL blocks forever?

2018-01-15 Thread Jon Ribbens
On 2018-01-15, Nagy László Zsolt wrote: >> In other words: if the server starts to send the response, but then >> stops sending it (without closing the connection), then this will block >> forever anyway. > Or maybe I misunderstood the docs and the timeout means the max. time > elapsed between rec

Re: pip --user by default

2018-01-15 Thread Thomas Jollans
On 2018-01-15 19:46, Skip Montanaro wrote: >>> Inside of a virtualenv, what's the difference between a --user install >>> and a system one? >>> >> >> It errors out: >> >> % pip install --user urllib3 >> Can not perform a '--user' install. User site-packages are not visible >> in this virtualenv. >

Re: pip --user by default

2018-01-15 Thread Skip Montanaro
>> Inside of a virtualenv, what's the difference between a --user install >> and a system one? >> > > It errors out: > > % pip install --user urllib3 > Can not perform a '--user' install. User site-packages are not visible > in this virtualenv. I was able to 'pip install --user ...' a package yest

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
> In other words: if the server starts to send the response, but then > stops sending it (without closing the connection), then this will block > forever anyway. Or maybe I misunderstood the docs and the timeout means the max. time elapsed between receiving two chunks of data from the server? --

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
> (a) are you setting daemon=True on the thread? > (b) are you setting a timeout on the requests call? Hmm setting the timeout might not be the solution. This is from the docs of the requests module: > > Note > > |timeout| is not a time limit on the entire response download; rather, > an exception

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
2018. 01. 13. 15:03 keltezéssel, Jon Ribbens írta: > On 2018-01-13, Nagy László Zsolt wrote: >> I have a multi threaded Windows service written in Python. It is running >> on 3.6.2.  Sometimes I cannot stop the service, because on of the >> threads won't exit. I have narrowed down the problem to

Re: pip --user by default

2018-01-15 Thread Thomas Jollans
On 2018-01-15 18:33, Rob Gaddi wrote: > > Inside of a virtualenv, what's the difference between a --user install > and a system one? > It errors out: % pip install --user urllib3 Can not perform a '--user' install. User site-packages are not visible in this virtualenv. -- https://mail.pyth

Re: pip --user by default

2018-01-15 Thread Rob Gaddi
On 01/13/2018 04:54 AM, Thomas Jollans wrote: Hi, I recently discovered the wonders of pip.conf: if I create a file ~/.config/pip/pip.conf* with: [install] user = true then pip will install to the --user site-packages by default, rather than trying to install packages into system directories.

Re: Can utf-8 encoded character contain a byte of TAB?

2018-01-15 Thread Random832
On Mon, Jan 15, 2018, at 09:35, Peter Otten wrote: > Peng Yu wrote: > > > Can utf-8 encoded character contain a byte of TAB? > > Yes; ascii is a subset of utf8. > > If you want to allow fields containing TABs in a file where TAB is also the > field separator you need a convention to escape the

Re: Generating SVG from turtle graphics

2018-01-15 Thread Anssi Saari
Peter Otten <__pete...@web.de> writes: > Then convert to SVG with an external tool. It looks like ghostscript can do > that: > > $ gs -dBATCH -dNOPAUSE -sDEVICE=svg -sOutputFile=tmp_turtle.svg tmp_turtle.ps And if not (I at least don't have svg output on three ghostscripts I tried), pstoedit can

Re: Can utf-8 encoded character contain a byte of TAB?

2018-01-15 Thread Peter Otten
Peng Yu wrote: > Can utf-8 encoded character contain a byte of TAB? Yes; ascii is a subset of utf8. Python 2.7.6 (default, Nov 23 2017, 15:49:48) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> ascii = "".join(map(chr, range(128))) >>> uni = asci

Can utf-8 encoded character contain a byte of TAB?

2018-01-15 Thread Peng Yu
Hi, I use the following code to process TSV input. $ printf '%s\t%s\n' {1..10} | ./main.py ['1', '2'] ['3', '4'] ['5', '6'] ['7', '8'] ['9', '10'] $ cat main.py #!/usr/bin/env python # vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8: import sys for line in sys.stdin

Re: Where is the usage of (list comprehension) documented?

2018-01-15 Thread Thomas Jollans
On 2018-01-15 00:01, Peng Yu wrote: > Hi, > > I see the following usage of list comprehension can generate a > generator. Does anybody know where this is documented? Thanks. > > $ cat main.py > #!/usr/bin/env python > > import sys > lines = (line.rstrip('\n') for line in sys.stdin) > print lines

Re: Where is the usage of (list comprehension) documented?

2018-01-15 Thread Ned Batchelder
On 1/14/18 9:57 PM, Dan Stromberg wrote: On Sun, Jan 14, 2018 at 3:01 PM, Peng Yu wrote: Hi, I see the following usage of list comprehension can generate a generator. Does anybody know where this is documented? Thanks. Here's the (a?) generator expression PEP: https://www.python.org/dev/peps/