Re: Why this regex for string literals can't handle escaped quotes?.... '"(\\.|[^"])*"'

2018-08-09 Thread cseberino
Wow. Thanks. That cleared everything up. cs -- https://mail.python.org/mailman/listinfo/python-list

Why this regex for string literals can't handle escaped quotes?.... '"(\\.|[^"])*"'

2018-08-09 Thread cseberino
Why this regex for string literals can't handle escaped quotes? '"(\\.|[^"])*"' See this... >>> string_re = '"(\\.|[^"])*"' >>> re.match(string_re, '""') <_sre.SRE_Match object; span=(0, 6), match='""'> >>> re.match(string_re, '"aa\"aa"') <_sre.SRE_Match object; span=(0, 4), match=

Re: Dealing with errors in interactive subprocess running python interpreter that freeze the process

2018-08-02 Thread cseberino
> Another possibility: If the ONLY thing you're doing with stdout/stderr > is passing them through to the screen, simply don't change them. Let > them remain bound to the console. You can have a pipe for stdin > without also having pipes for the others. But that won't work if you > intend to do a

Re: Dealing with errors in interactive subprocess running python interpreter that freeze the process

2018-08-02 Thread cseberino
> subprocess is not meant for interaction through the pipes. That is why, > I have been told, IDLE uses a socket for interaction. Multiprocess is > apparently better suited for interaction without resorting to a socket. So use normal socket on localhost for this? Don't you still need subpro

Re: Dealing with errors in interactive subprocess running python interpreter that freeze the process

2018-08-02 Thread cseberino
> As others have mentioned, separate threads for the individual pipes > may help, or if you need to go that far there are specialised > libraries, I believe (pexpect is one, but from what I know it's fairly > Unix-specific, so I'm not very familiar with it). I'm on Linux so pexpect is a possibil

Re: Dealing with errors in interactive subprocess running python interpreter that freeze the process

2018-08-02 Thread cseberino
> -I think the Python interpreter actually sends its output to stderr, so to > capture it you'd probably want it to go to the same place as stdout, so use > stderr = subprocess.STDOUT Yes that captured the error messages! Thanks! > -You're only reading 1 line out output for each thing, so i

Dealing with errors in interactive subprocess running python interpreter that freeze the process

2018-08-01 Thread cseberino
I can run python3 interactively in a subprocess w/ Popen but if I sent it text, that throws an exception, the process freezes instead of just printing the exception like the normal interpreter.. why? how fix? Here is my code below. (I suspect when there is an exception, there is NO output to stdi