Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '"""': 0.07; 'importerror:': 0.07; 'interpreter.': 0.07; 'bug.': 0.09; 'implements': 0.09; 'subset': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'bug': 0.12; 'bug,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'letting': 0.16; 'modules.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'server,': 0.19; 'import': 0.22; 'aug': 0.22; 'putting': 0.22; 'cc:addr:python.org': 0.22; 'install': 0.23; 'library,': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'operations,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'run': 0.32; 'actual': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'library.': 0.36; 'url:org': 0.36; 'first': 0.61; 'such': 0.63; 'provide': 0.64; 'statement,': 0.68; 'cuts': 0.84; 'to:none': 0.92; 'serious': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=PdjnnH4SkmeqYV1TQqbd6pSePTP161U/G2y5u3ZYx8M=; b=nC6pyRlzDH60qQkO9UIJ4ziZzhOQ+MeqaIeb3z8DOkEN+W6a0fV0muPht+eNxP0esh 2vaQcKpdaFcipR2FYflNdA7X9LCEiSUogbmbzRO3ha4vP22IuteNfkJrZD1Q2c7ySyNb eYLX4rWFEPVz1xsZh83sLN31nr3dRKcfh5n1MkNhlmV8uw3UsFsTFWmeL/uxB8FufROh xstb+48TXxN9cr38mXChOrMxaRtaGZcGtUqJPWHS1aJ6se0nvtW8CimpVQa1WOX8VMnB 9cX4PElm7a/eGKrW3k4at8s7zoibe74PwayNuNLT6CrVtlWAd5jAdn5So5XKDYUOYn8T RNRA== MIME-Version: 1.0 X-Received: by 10.50.176.202 with SMTP id ck10mr32162130igc.2.1407116628343; Sun, 03 Aug 2014 18:43:48 -0700 (PDT) In-Reply-To: <53dee1e2$0$9505$c3e8da3$5496439d@news.astraweb.com> References: <53dee1e2$0$9505$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 4 Aug 2014 11:43:48 +1000 Subject: Re: CodeSkulptor From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407116631 news.xs4all.nl 2897 [2001:888:2000:d::a6]:36659 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75645 On Mon, Aug 4, 2014 at 11:29 AM, Steven D'Aprano wrote: >> Putting that in codeskulptor gets >> >> Line 4: ImportError: No module named datetime > > Well that's a bug in CodeSkultor. datetime is a standard Python library, if > CodeSkulptor doesn't provide it, that's a serious bug. I think it's not a bug, but a restriction; since it's letting you run code on their server, and since Python sandboxing is a hard problem, CodeSkulptor cuts down the available modules. From the docs: http://www.codeskulptor.org/docs.html#tabs-Python """ CodeSkulptor implements the following subset of the Python standard library. To use these operations, first import the relevant module with an import statement, such asimport math. """ Solution: Don't try to run Python code in your browser, but download and install an actual interpreter. ChrisA