Deutsch   English   Français   Italiano  
<t4m9ft$f1g$1@gioia.aioe.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!news.mixmin.net!aioe.org!21JOAjfj9l9MK+tpRyNcKg.user.46.165.242.91.POSTED!not-for-mail
From: Dominique <zzz@aol.com.invalid>
Newsgroups: fr.comp.lang.python
Subject: =?UTF-8?Q?Pr=c3=a9sentation_propre_d=27une_interpolation=2e?=
Date: Sun, 1 May 2022 17:37:33 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t4m9ft$f1g$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="15408"; posting-host="21JOAjfj9l9MK+tpRyNcKg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.8.1
Content-Language: fr
X-Notice: Filtered by postfilter v. 0.9.2
Bytes: 1973
Lines: 34

Bonjour,

Soit une variable (x et y sont les valeurs à interpoler)

res=['x1 ', 12.456, 'y1 ', 12.96524], ['x ', 13.4587, 'y ', 
13.223527289798024], ['x2 ', 18.6548, 'y2 ', 14.562]

(le tout sur une ligne, bien sûr)

Si j'appelle ma variable, elle se présente (avec Spyder) à peu près 
correctement :

res
Out[73]:
(['x1 ', 12.456, 'y1 ', 12.96524],
  ['x ', 13.4587, 'y ', 13.223527289798024],
  ['x2 ', 18.6548, 'y2 ', 14.562])

Mais si je passe par print, ma variable apparaît sur une seule ligne.

print(res)
(['x1 ', 12.456, 'y1 ', 12.96524], ['x ', 13.4587, 'y ', 
13.223527289798024], ['x2 ', 18.6548, 'y2 ', 14.562])

J'ai alors deux questions. Comment forcer le print à se présenter sur 3 
lignes. Et, crise sur le râteau, comment avoir mes résultats alignés à 
gauche comme suit (si ça passe dans usenet...) :

(['x1 ', 	12.456, 	'y1 ', 	12.96524],
  ['x ', 	13.4587, 	'y ', 	13.223527289798024],
  ['x2 ', 	18.6548, 	'y2 ',	14.562])

En vous remerciant et vous souhaitant une bonne soirée,

Dominique