Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: eryk sun Newsgroups: comp.lang.python Subject: Re: Guido sees the light: PEP 8 updated Date: Sun, 17 Apr 2016 00:01:30 -0500 Lines: 39 Message-ID: References: <5711c1b3$0$1596$c3e8da3$5496439d@news.astraweb.com> <87shym6kpo.fsf@elektro.pacujo.net> <87h9f26ioa.fsf@elektro.pacujo.net> <1460809922.1918014.580580553.0AE05EE4@webmail.messagingengine.com> <878u0d7az5.fsf@elektro.pacujo.net> <85vb3huxjn.fsf@benfinney.id.au> <20160416165027.0fe70e5f@bigbox.christie.dr> <20160416203052.2598ad15@bigbox.christie.dr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de CTxfbVHX53PjWE+ghvUDgAjlT7TvyDtvH0q2KI0l8jGw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'api.': 0.04; 'subject:PEP': 0.07; 'buffer,': 0.09; 'cmd': 0.09; 'yeah,': 0.09; 'python': 0.10; '(but': 0.15; '2016': 0.16; 'command,': 0.16; 'ctrl+c': 0.16; 'emulation': 0.16; 'paste.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'resize': 0.16; 'resized': 0.16; 'selects': 0.16; 'sizing': 0.16; 'surrogate': 0.16; 'terribly': 0.16; 'wrote:': 0.16; 'basically': 0.18; 'settings': 0.20; 'windows': 0.20; 'handles': 0.20; 'meant': 0.22; 'ctypes': 0.22; 'keyboard': 0.22; 'sat,': 0.23; 'properties': 0.24; 'tim': 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'linux': 0.26; 'room': 0.27; 'message-id:@mail.gmail.com': 0.27; 'regular': 0.29; 'chase': 0.29; 'dialog': 0.29; 'restart': 0.29; 'running.': 0.29; 'windows,': 0.29; 'window': 0.30; 'probably': 0.31; 'another': 0.32; "can't": 0.32; 'screen': 0.32; 'maybe': 0.33; 'run': 0.33; 'stream': 0.33; 'changing': 0.34; 'running': 0.34; 'received:google.com': 0.35; 'text': 0.35; 'mix': 0.35; 'step': 0.36; 'but': 0.36; 'instead': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'agree': 0.37; 'display': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'still': 0.40; 'some': 0.40; 'within': 0.64; 'useful.': 0.72; 'fonts': 0.84; 'window,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=RToPdsdAveJAtTknYtbWDQZUyPtur3LwsMXiZu8sw0Y=; b=e5o71+GjJQHd1Ii9sm+KwqJMt1f2u+vRAlBA7Byv6swZB5eUtk4t2uasmspjMpKmAM //uhP59sRoELta2v4PqZl4E7SXVGVxdLm/0mIipKmFhUnpDUq8y1i7AV/XcFLfJyBQHO 3zSw/MBXAAPoFv+WrM3vCFscdrolL0dPImGh5eKmb8ifsYSVUg+dFSo5/Xa0m8TvouA/ LeWMC21INdvSpN4ocdgeF753MPM34mFl4Wwcxm38JBBrRL7k0QDYGW+bcGDvUlSGBLzz ud8eGER2lqqx7krAwE74jzmuq9sRY0sFdyhgX201JLwHYEBntpKMPMotdAkfLTpw7+/D 5/Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=RToPdsdAveJAtTknYtbWDQZUyPtur3LwsMXiZu8sw0Y=; b=c5wMupE5zNtKAiNTSyc9n4zpuaX3nebr/ToqZ0iuMdOvyF2x0HV1ttBNDVhle97WAG UDTco+nnCRJvHIYnUJjOCSsIYeFoWPaNeo5JlexX+PwqbkCErZLV8E1iieEYXLeIXDX/ CINDn9vUIs+DjG6KfKEQCK2RT3TWjGr2d4sufBNg1l9EVJIxFxMCG9KqaCTxZg2CEsCw wjClE3prHaY1cPTzTbax0N1ZKqctR/SVxyOqUOKdW7AsyFK6c93pXsibY9Vv/xYT4uzF gE7lNrNOV1LhsfxlfqD1Cb7LTo2H2oCYeYJ6sx5/omc70CTa5o/cDyKq4TcUo444tbA5 0EDw== X-Gm-Message-State: AOPr4FWgXjCD7BIMKHivqYkn7hWjeA7qW4LgbhPSuqVVkj+IiJIK8IhjTPVV65AWn7f0jnnvHXDKPqD4MCn2lg== X-Received: by 10.50.225.163 with SMTP id rl3mr12614747igc.74.1460869330347; Sat, 16 Apr 2016 22:02:10 -0700 (PDT) In-Reply-To: <20160416203052.2598ad15@bigbox.christie.dr> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <5711c1b3$0$1596$c3e8da3$5496439d@news.astraweb.com> <87shym6kpo.fsf@elektro.pacujo.net> <87h9f26ioa.fsf@elektro.pacujo.net> <1460809922.1918014.580580553.0AE05EE4@webmail.messagingengine.com> <878u0d7az5.fsf@elektro.pacujo.net> <85vb3huxjn.fsf@benfinney.id.au> <20160416165027.0fe70e5f@bigbox.christie.dr> <20160416203052.2598ad15@bigbox.christie.dr> Xref: csiph.com comp.lang.python:107160 On Sat, Apr 16, 2016 at 8:30 PM, Tim Chase wrote: > On 2016-04-16 19:39, eryk sun wrote: >> On Sat, Apr 16, 2016 at 4:50 PM, Tim Chase wrote: >> > I also do some editing/diffing within a cmd.exe window on Windows >> > which is limited to 80 characters unless you do some hijinks in >> > the settings to expand it. >> >> Try `mode con cols=120 lines=30`. > > Yeah, that will do it, as will going into the settings and changing > it. But basically every other program on Windows, and every console > on Linux/BSD/Mac will let me resize a terminal running while another > program is running. For a cmd.exe window, I have to quit, issue the > `mode` command, restart my application, and return to where I was. cmd.exe doesn't own a window. You probably meant the console host/server, conhost.exe. cmd has handles for StandardInput, StandardOutput, and StandardError -- which may be handles for console I/O, but not necessarily. I agree that the classic console window has a bad UI. It can only be resized up to the size of the screen buffer, which is not terribly useful. There's no way to change the screen buffer size when manually sizing the window. You have to either use the properties dialog or the API. In Python you can run mode.com via subprocess.call('mode.com con cols=120'). Or you can use ctypes to call GetConsoleScreenBufferInfoEx and SetConsoleScreenBufferInfoEx. The Windows 10 console is a significant step in the right direction. It automatically resizes the screen buffer with text wrapping, selects a text stream instead of a rectangle, and uses regular keyboard shortcuts such as Ctrl+C and Ctrl+V for copy and paste. It still has room for improvement, however. It doesn't support fonts that mix half-width and full-width glyphs. It can't display characters that use multiple WCHAR values, such as astral characters (UTF-16 surrogate pairs) and decomposed characters. It doesn't support ANSI/VT100 terminal emulation (but maybe this is in the works for the new Linux subsystem).