Mi sa proprio di sì, sai?

Infatti ti conviene forse aprire un file temporaneo, scrivere il nuovo
testo, aggiungere il testo del file originale, cancellarlo e rinominare il
file temporaneo nel file originale.

Ma solo se il testo è tanto.

Ciao.
Marco.

On Sat, 18 May 2024, 19:30 Gabriele Battaglia, <iz4...@libero.it> wrote:

> Ciao. Ho passato "ta+" ad open per apprire un file di testo in modalità
> append. Vorrei aggiungere il testo in cima, non in fondo.
>
> E' possibile o devo farlo io a mano caricando il contenuto in una
> variabile, aggiungendo in cima ciò che voglio e poi salvando tutto nel
> file?
>
> Grazie.
>
> --
> Gabriele Battaglia (IZ4APU)
> --... ...--  -.. .  .. --.. ....- .- .--. ..-  - ..-  . .
> Sent from my Giant Desktop PC
>
> _______________________________________________
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
>
_______________________________________________
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python

Rispondere a