Python Forum

Full Version: Restrictions in online coding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!
I am doing coding for a class project, but I am not in a coding class. This means I can take any coding help. However, I am using school computers where downloading things is not allowed. I code python on IDLE at home, but I am using repl.it at school.

The problem I am running into is that I need to save data across runs- just a few lists. With IDLE, I could just use a .txt file, but I cannot do this with repl.it. 

Is there any other way to do this? If so, what is the easiest way? (I'm still relatively new to Python)

Thanks!

-Lux
I can't find any information on downloading code from repl.it.
The only suggestion I would have is to cut and paste the code.
If you are able to use a dongle on your school machine, you can
use ctrl-c (to copy) and ctrl-v (to paste)

Can you login to repl.it at home?
I'm sorry, I don't think I made my problem clear. I am taking user inputted lists. I want to be able to save this data so I can use it the next time I run the program. Normally, I would do this with a text file, but that is not a option.
I would like to know if there is a different way to do this, or if using a different online compiler might help.
Sorry about the confusion.
A usb drive, with your text files on it?
Could you use the python module 'shelve'? Or is this prevented by the same constraints as using a txt file?
I think I know what you are trying to do now.
You're trying to save python lists to a file, correct
for this you can use json files. see: https://docs.python.org/3.4/library/json.html
You need some kind of "pastebin" site. See pastebin.com or others.
(Feb-17-2017, 07:51 PM)merlem Wrote: [ -> ]Could you use the python module 'shelve'? Or is this prevented by the same constraints as using a txt file?

Thanks for the advice! I tried shelve and it worked very well.