Nov-20-2019, 04:23 PM
(This post was last modified: Nov-20-2019, 04:23 PM by newbieAuggie2019.)
(Nov-20-2019, 03:51 PM)buran Wrote: It looks like something with IDLE
It seems that it is not only with IDLE, as with PyScripter, it stops the paste process at the point IDLE takes as a null byte. Maybe it's something related to r'\0**' being converted into r' **' instead of being printed as r'\0**' inside the string? If I run actually the program:
import re string1 = 'Agent Cheesecake was a double agent.' agentNamesRegex = re.compile(r'Agent (\w)\w*') mo0 = agentNamesRegex.sub(r'\0**', string1) print(f"This is string1 '{string1}' with r'\0**' after censorship: {mo0}\n")with PyScript, the output is the following:
Output:*** Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32. ***
*** Remote Python engine is active ***
>>>
*** Remote Interpreter Reinitialized ***
This is string1 'Agent Cheesecake was a double agent.' with r'
>>>
so it doesn't even finish printing and executing the whole program.On another level, I know that IDLE is not a very good terminal, but it's something like driving a Mercedes and not using its original brakes.
All the best,
newbieAuggie2019
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs