Re: Extract lines from file, add to new files

Liste des GroupesRevenir à cl python 
Sujet : Re: Extract lines from file, add to new files
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 29. Jan 2024, 17:41:14
Autres entêtes
Organisation : Stefan Ram
Message-ID : <file-20240129174003@ram.dialup.fu-berlin.de>
References : 1
Rich Shepard <rshepard@appl-ecosys.com> writes:       how to specify a
variable in one file that has its values in another file.

  In the first file, you can write

variable = eval( open( "otherfile" ).read() )

  , and the value for "variable" will be taken from "otherfile".

$ echo 3.14 >otherfile
$ echo "v = eval( open( 'otherfile' ).read() ); print( v )" > thisfile
$ python3 thisfile
3.14
$


Date Sujet#  Auteur
29 Jan 24 o Re: Extract lines from file, add to new files1Stefan Ram

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal