Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #5138

Re: [Python-de] Migration Python 2 auf 3

From Christopher Arndt <chris@chrisarndt.de>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] Migration Python 2 auf 3
Date 2018-03-16 14:44 +0100
Message-ID <mailman.107.1521208285.1867.python-de@python.org> (permalink)
References <p8ggsi$96i$1@solani.org> <9ad883a2-9c08-f1ba-71b8-06d730ba358f@chrisarndt.de>

Show all headers | View raw


Am 16.03.2018 um 14:29 schrieb Philipp Klaus Krause:
> print "%-35.35s" % base,
> 
> könnte ich in Python 3 wohl als
> 
> print("%-35.35s" % base, end=' ')
> 
> was aber wohl unter Python 2 nicht erlaubt ist.

Einfach

from __future__ import print_function

an den Beginn (erste nicht-leere / nicht-Kommentarzeile) der Quelldatei
schreiben.

https://docs.python.org/3/library/__future__.html

Chris

Back to de.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Migration Python 2 auf 3 Philipp Klaus Krause <pkk@spth.de> - 2018-03-16 14:29 +0100
  Re: [Python-de] Migration Python 2 auf 3 Christopher Arndt <chris@chrisarndt.de> - 2018-03-16 14:44 +0100
  Re: [Python-de] Migration Python 2 auf 3 Hartmut Goebel <h.goebel@crazy-compilers.com> - 2018-03-16 14:44 +0100
    Re: [Python-de] Migration Python 2 auf 3 Philipp Klaus Krause <pkk@spth.de> - 2018-03-16 15:32 +0100
  Re: Migration Python 2 auf 3 Philipp Klaus Krause <pkk@spth.de> - 2018-03-16 15:35 +0100
    Re: [Python-de] Migration Python 2 auf 3 Stefan Behnel <python-de@behnel.de> - 2018-03-16 15:46 +0100
    Re: [Python-de] Migration Python 2 auf 3 Christopher Arndt <chris@chrisarndt.de> - 2018-03-16 15:50 +0100
    Re: [Python-de] Migration Python 2 auf 3 Stefan Behnel <python-de@behnel.de> - 2018-03-16 17:05 +0100

csiph-web