If you like start up a second python interpreter in

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: he value you put in before, with no html at all. A web browser would actually be well within its rights to refuse to render anything at all here, since this clearly isn’t a valid ‘web page’ – but fortunately for us, most web browsers will do the sensible thing and just show the plain text that comes back under these circumstances. Try typing: print server[’pythonTest1’] and you should get back the ‘hello’ string you’ve just put in. Finally, make sure you can unset the value by typing: del(server[’pythonTest1’])3 and once again take a look at the contents of the server store using your browser to convince yourself that it has indeed removed the key/value pair. Just to convince yourself that this is acting as a simple distributed system, set some variable using a browser and the URL method, and once you’ve done that, get that variable in python. Then try it the other way round. If you like, start up a second python interpreter in another window (but from the same directory), and try setting a key/value pair in one, and retrieving it in the other. Now we have a means of causing a ‘central server’ to remember a state set by one program, and retrieving it in a totally independent other program. If you can find someone else who's got to this stage, you’re welcome (in fact, encouraged) to spend a few minutes with them trying to talk to their server instead of your own – all you have to do is to substitute their username instead of yours in the URL of the parameter to the im.IMServer; they can then set a key/value pair, which you can retrieve. IMPORTANT: you MUST do this in co ­operation with the other person. You MUST NOT UNDER ANY CIRCUMSTANCES mess around with someone else’s server without their consent because...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern