Pizza Pro 11 Posted August 20, 2013 Report Share Posted August 20, 2013 Hi guys, I just wanted to share how I'm saving and loading project data without using tables. I'm not sure if this is a good idea or not. There might be a better way. But I found this easy for me, because it's easy to read the information visually, and I don't really like using tables. Specifying location by column, row is a bit hard for me to visualize when using tables. I like how Python uses dictionaries which ties elements to keys instead, so I think this concept is similar. Perhaps someone here might find this useful. Or perhaps you could give me some tips on doing it better... ==========Saving Data========== When saving data, I save it as an HTML file. And I save it in a format that's easily readable. Something like this: <p><b>Date:<b> August 32nd, 2012</p> <p><b>Variable 2:<b> This is the variable</p> etc. ===========Loading Data=========== When loading data, I use regular expressions to grab all the necessary variables by specifying the item they're next to. For example, if I wanted to load the variable 'Date', I select and open up the HTML file. And then I set the variable 'the_date' to a 'find regular expression' using something like this to grab the date: (?<=<p><b>Date:</b> ).*?(?=</p>) And voila! =========== Well, like I said, I'm not so sure if this is a good idea or not. But that's how I'm doing it at the moment. Mainly because I like the way the data is represented. What do you think? Quote Link to post Share on other sites
dankass 52 Posted August 20, 2013 Report Share Posted August 20, 2013 Why not... if you are that comfortable with regex I dont see why this is not a good idea... I personally use a database most of the time, but for settings files and such I often use an XML file and the xml plugin from aymen. But, I hate regex so, I avoid it like the plague:) Quote Link to post Share on other sites
Pizza Pro 11 Posted August 20, 2013 Author Report Share Posted August 20, 2013 Why not... if you are that comfortable with regex I dont see why this is not a good idea... I personally use a database most of the time, but for settings files and such I often use an XML file and the xml plugin from aymen. But, I hate regex so, I avoid it like the plague:) Ok. Well, I wasn't sure if there were any speed or memory issues doing it like this.... but I guess it should be ok then. I see. I have no idea how to use a database. Will learn it soon. Just had a look at the XML plugin. Looks pretty cool! Regex is a bit tricky, but it's really fun and easy to use once you get the hang of it. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.