Hi Ray
Great presentation and nice to meet you!
I tried the scrimba -scrim page you created and while it displays graph when loaded I get a weird error when trying to execute code , or modifying it...And When opening it is Firefox it doesn’t display at all a graph and it looks like you are trying to a add a CSV to read data from...
Also the issue mentioned about Python 3.9 not working in scrimba seems to be back( or my computer is messed up) ’this.addEntry’ ??
Reading from file:
Scrimba doesn’t allow reading from files placed in the ’file tree’...I’m not sure how ’true ’ that is, since it is obviously possible to have scripts on a page...
for my file reading tutorial we did a fake file read using local storage
https://scrimba.com/scrim/cn3GWrhJ
the csv files in my file tree are there as view only and don’t actually ’do anything’ - they basically just mimic what the setup would look like on a ’normal python environ’...without the scrimba lockdown of file reading/ writing
Ideas for ’reading data’ for chart in Scrimba
Works:
0. reuse the same method as in the filereading tutorial above, i.e preloading data into local storage and then using it
1. just place a variable above the code that contains all the data you are working with (messy and may take up alot of space, and not very ’sexy’ to look at for the user)
possible improvement: if preload code, could be moved to a secondary scriptfile, that would ’declutter/ clean up’ the index.py file to contain ’Only ’clean’ python code
-other alternative would be to hold the data in the index.html file...
I have not understood how to access/ share data between the various files used (index.html, index.py) So I am not sure how ’code’ in index.py can ’see ’ variables etc in the index.html file...
I am guessing this is ’my level of skill’ rather than that it is hard/ impossible ;-)
Don’t know
1. maybe it is possible to access data direct from a URL? that delivers a csv or some other format?
2. as above introducing a 2nd scriptfile to scrimba e.g.
-index.html
-index.py
-data.py
and in this data.py file you have a variable or a function/class that gives you the data which is hardcoded in that file...
The benefit again would be to declutter the index.py file to contain only ’actual correct non fake-workaround python code’ that looks exactly like what user would use ’in other environs’
except...the call for that function/use of class...unless the function overload something like the readfile workaround...
My problem is I am not able to get multiple script files or even sharing data( between files) to work...since I suck ;-)
I don’t know what best approach is...I like the Fileread workaround...it’s very nice...except all the code I have to put at top of index.py file, to ’hide from user’....if it could be moved to a separate script file or into the index.HTML page that would be even better ( for decluttering/ clean) purposes
So right now I am alittle stuck...first issue is that your graphing scrim isn’t executing properly except on load? I don’t even know where to start troubleshooting that...
Any ideas/ help much welcomed
Will restart and try another computer..