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! 3 1128
On May 31, 3:25*pm, Dennis Lee Bieber <wlfr...@ix.netcom.comwrote:
On Sat, 31 May 2008 11:44:14 -0700 (PDT), corvettecra...@gmail.com
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...@ix.netcom.com * * * * * * *wulfr...@bestiaria.com
* * * * * * * * HTTP://wlfraed.home.netcom.com/
* * * * (Bestiaria Support Staff: * * * * * * * web-a...@bestiaria.com)
* * * * * * * * HTTP://www.bestiaria.com/
No, what I mean is for the user to input text directly into the python
program, then the program would save it to a file and display it after
it is created.
On 31 Mag, 21:28, corvettecra...@gmail.com wrote:
On May 31, 3:25*pm, Dennis Lee Bieber <wlfr...@ix.netcom.comwrote:
On Sat, 31 May 2008 11:44:14 -0700 (PDT), corvettecra...@gmail.com
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...@ix.netcom.com * * * * * * *wulfr....@bestiaria.com
* * * * * * * * HTTP://wlfraed.home.netcom.com/
* * * * (Bestiaria Support Staff: * * * * * * * web-a...@bestiaria.com)
* * * * * * * * 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/
On Jun 1, 1:44*am, corvettecra...@gmail.com wrote:
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!
Use a multi-line text-input widget (available on any widget library)
To open a file in python for reading:
filepointer = file('path/to/file', 'r')
then read it like this:
for line in filepointer:
dosomethingwith(f)
or:
filecontent = filepointer.read()
To open a file for writing:
filepointer = file('path/to/file', 'w')
to write to a file:
filepointer.write(somestring) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: nospam |
last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types,
so, since it seems to me that Partial Types is still in the design or
development stages at Microsoft, I am going to ask...
|
by: jojobar |
last post by:
Hello,
I am trying to use vs.net 2005 to migrate a project originally in vs.net
2003. I started with creation of a "web site", and then created folders for
each component of the site.
I read...
|
by: Stan Sainte-Rose |
last post by:
Hi,
What is the better way to save image into a database ?
Just save the path into a field or save the image itself ?
I have 20 000 images (~ 10/12 Ko per image ) to save.
Stan
|
by: cjl |
last post by:
PHPers:
I am a total beginner, so please excuse my very simple question.
I have been playing with PHP on Windows XP, and mostly using Notepad2
(http://www.flos-freeware.ch/notepad2.html) for...
|
by: Eric_Dexter |
last post by:
All I am after realy is to change this
reline = re.line.split('instr', '/d$')
into something that grabs any line with instr in it take all the
numbers and then grab any comment that may or may...
|
by: James |
last post by:
Today my friend ask me a question about setting logsecond to -1. The
following sentences were copied from DB2 InforCenter:
"By setting logsecond to -1, you will have no limit on the size of the...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |