Re: Question about files?



On 31 Mag, 21:28, corvettecra...@xxxxxxxxx wrote:
On May 31, 3:25 pm, Dennis Lee Bieber <wlfr...@xxxxxxxxxxxxx> wrote:





On Sat, 31 May 2008 11:44:14 -0700 (PDT), corvettecra...@xxxxxxxxx
declaimed the following in comp.lang.python:

I want to create a program where a user can type what ever they want
to, have it saved to a file, and the be able to re-open it and read
it. How would I do this? Thanks!

import os
os.system("edit")     # may be Windows specific

        Start with:http://www.catb.org/~esr/faqs/smart-questions..html

(or, to expand on it... Exactly what part of the task are you having
problems with? Opening files for read/write/update? Designing a command
set for an editor? Designing a GUI for a text editor; what toolkit, does
it have a generic text edit widget already? Do you really need to write
another text editor when there are so many available that come with most
operating systems (Windows: edit, notepad, maybe even wordpad;
UNIX/Linux type systems: vi, vim, gvim, emacs) or can be downloaded
(SciTE) )

--
        Wulfraed        Dennis Lee Bieber               KD6MOG
        wlfr...@xxxxxxxxxxxxx              wulfr....@xxxxxxxxxxxxx
                HTTP://wlfraed.home.netcom.com/
        (Bestiaria Support Staff:               web-a...@xxxxxxxxxxxxx)
                HTTP://www.bestiaria.com/

No, what I mean is for the user to input text directly into the python
program

You can use raw_input() to ask user to type something, then use open()
to create a file and write in it.
http://docs.python.org/lib/bltin-file-objects.html

then the program would save it to a file and display it after
it is created.

What do you mean by "display"?
Open that file with a text editor? Print the content of the file on
screen?


--- Giampaolo
http://code.google.com/p/pyftpdlib/
.



Relevant Pages

  • Re: Word Editor
    ... text editor and how to apply formatting. ... > I'm doing this project for my school project. ... the license was about $1500/developer and we only purchased ... >>> this very confusing since I'm playing with pixel in designing my form, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Roguelikes not for newbies?
    ... I've already installed freepascal and the lazarus editor, ... windows apps, designing forms the way I described above. ... About advice in designing a roguelike game, ... VisualC# is a good option? ...
    (rec.games.roguelike.development)
  • Re: Question about files?
    ... Designing a GUI for a text editor; ... it have a generic text edit widget already? ... UNIX/Linux type systems: vi, vim, gvim, emacs) or can be downloaded ...
    (comp.lang.python)
  • text editor example
    ... I'm writing a text editor to support a little application ... i'm designing from myself. ... I've already composed a trivial menù bar to handle ... improve the functionality implemented through the menù bar. ...
    (comp.lang.tcl)