Python Forum
Newbie Start with Text or Table?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie Start with Text or Table?
#1
I'm totally new. Going to write a little thing to keep one or two hundred strings maybe 250 chars long is all.

Better to write them to a text file or better to get straight into tables in mysql or such?
Reply
#2
what you store your data as is very much dependent on what you plan to do with it after it is stored.

What is in the text? is it formatted in such a way that it can be retrieved by key?

Other formats may be appropriate, such as JSON file.

Show some sample data.
Reply
#3
You don't need a program to do that. Writing a text file sounds perfect.
Reply
#4
It's a little game for my small son. So I do need a program.

Essentially he wants to write in questions and get back random answers.

Nonsense is fine. He found something like this on the web and wants to do it himself, have the control to put in his own text.

well they might not be questions even so that it becomes a fake nonsense 'conversation'.
Reply
#5
You could perhaps try TinyDB for this persistence use case. Its usage is straightforward.
Reply
#6
To keep it simple for adding new strings and editing strings, I'd go ahead and use a text file, then read the strings in and pick random strings to display.

Other methods are fine and certainly have advantages. But, they will require you to write a "maintenance" section where you add and edit the strings. Text file avoids that as you can use Notepad or similar to make the modifications and use your program for the interaction.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  very newbie problem on text file zapad 2 197 Apr-12-2024, 06:50 PM
Last Post: zapad
  Color a table cell based on specific text Creepy 11 1,961 Jul-27-2023, 02:48 PM
Last Post: deanhystad
  Start print a text after open an async task via button Nietzsche 0 699 May-15-2023, 06:52 AM
Last Post: Nietzsche
  Use module docx to get text from a file with a table Pedroski55 8 6,101 Aug-30-2022, 10:52 PM
Last Post: Pedroski55
  How to perform DESC table sort on dates stored as TEXT type. hammer 7 2,190 Mar-15-2022, 01:10 PM
Last Post: hammer
  HELP: Combine records in a table with missing start or end date Techy_RN 1 1,640 Dec-16-2019, 08:51 PM
Last Post: Clunk_Head
  Converting a patterned string or text into excel table soup1987 1 2,131 Oct-03-2019, 01:37 AM
Last Post: Larz60+
  Python QGIS tool that replaces layout text labels with attributes from an input table geodenn92 1 2,664 Aug-13-2019, 06:05 AM
Last Post: buran
  How do i read particular text from text file and update those values in MS SQL table ganeshsai2912 33 14,842 Nov-20-2018, 12:55 AM
Last Post: ganeshsai2912
  What's the difference b/w assigning start=None and start=" " Madara 1 2,315 Aug-06-2018, 08:23 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020