Path: csiph.com!news.swapon.de!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Philipp Klaus Krause Newsgroups: de.comp.lang.python Subject: Re: Migration Python 2 auf 3 Date: Fri, 16 Mar 2018 15:35:02 +0100 Organization: solani.org Lines: 19 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: solani.org 1521210902 12002 eJwFwQEBACAIA7BKB/2ROCLaP4Ibh0wnpqjJx9eCDyb2qn12LLuO6CwU7lQWl1Pg8+yERX8QXRBu (16 Mar 2018 14:35:02 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Fri, 16 Mar 2018 14:35:02 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-Reply-To: X-NNTP-Posting-Host: eJwNx8EBwCAIA8CVpCSA4xRq9h/B3u/oYTGJYICiduX3rkYRXlu0Y1l/j1dYzoyWHjWX0AD7Ag6WEOM= X-User-ID: eJwNwokRwCAMA7CVCIkNHSfv/iPQk6AU5jGChvkZItnfxPJwHypMw0xk7rSwd+Xh0s0q9I0HKnsRjA== Cancel-Lock: sha1:qdMctEtNDJDRD5LmAumIta0FG7g= Content-Language: en-US Xref: csiph.com de.comp.lang.python:5141 Der Rat, from __future__ import print_function zu verwenden, hat mir schonmal weitergeholfen. Vielen Dank. Nun hätte ich noch ein m = re.match(r'([^/]*)/([^/]*)/([^/]*)/(.*)$', name) if (m >= 3): base = m.group(3) das mit Python 2 funktioniert, aber mit Python 3 nicht: Traceback (most recent call last): File "./compact-results.py", line 50, in if (m >= 3): TypeError: '>=' not supported between instances of '_sre.SRE_Match' and 'int' Philipp