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


Groups > free.it.comp.lang.python > #1

input e redirezione

X-Received by 10.107.165.197 with SMTP id o188mr17229593ioe.1.1460821982553; Sat, 16 Apr 2016 08:53:02 -0700 (PDT)
X-Received by 10.140.28.136 with SMTP id 8mr803667qgz.15.1460821982513; Sat, 16 Apr 2016 08:53:02 -0700 (PDT)
Path csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!g8no2308296igr.0!news-out.google.com!10ni43155qgx.0!nntp.google.com!10no4241743qgg.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups free.it.comp.lang.python
Date Sat, 16 Apr 2016 08:53:02 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=79.41.201.174; posting-account=1eBdwAoAAADp_G3YrKC0QRXRGyWD5G4B
NNTP-Posting-Host 79.41.201.174
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <4e0fa7d4-75f3-477c-b53c-f1b93cdc9111@googlegroups.com> (permalink)
Subject input e redirezione
From eproser@gmail.com
Injection-Date Sat, 16 Apr 2016 15:53:02 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com free.it.comp.lang.python:1

Show key headers only | View raw


Saluto il NG

Ho un problema e confido nel vostro prezioso aiuto.

Ho un programmino che richiede all'utente
alcuni dati con raw_input('domanda'), li elaboro e
visualizza un testo che varia sempre come risultato
dell'elaborazione.

Fin qui tutto bene.

A volte pero' anziche' visualizzare il testo,
l'utente vorrebbe ridirigerlo su un file

Niente di piu' semplice (Linux e Python 2.7)

mio_programma.py > testo.txt

purtroppo mi ridirige anche raw_input,
cioe' la frase contenuta nella chiamata
a raw_input NON la visualizza sul terminale
ma la "scrive" nel file.

Vorrei evitare di chiede ulteriormente 
se vuole salvarlo su file e chiedere il nome:
vorrei fare tutto con la redirezione >.

Qualcuno ha una dritta per me?

Grazie a tutti in anticipo.

Back to free.it.comp.lang.python | Next | Find similar


Thread

input e redirezione eproser@gmail.com - 2016-04-16 08:53 -0700

csiph-web