{"action":"created","issue":{"url":"https://api.github.com/repos/jupyter/nbconvert/issues/54","labels_url":"https://api.github.com/repos/jupyter/nbconvert/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/nbconvert/issues/54/comments","events_url":"https://api.github.com/repos/jupyter/nbconvert/issues/54/events","html_url":"https://github.com/jupyter/nbconvert/issues/54","id":92818328,"number":54,"title":"Export to .py should add 'import's","user":{"login":"InonS","id":6696011,"avatar_url":"https://avatars.githubusercontent.com/u/6696011?v=3","gravatar_id":"","url":"https://api.github.com/users/InonS","html_url":"https://github.com/InonS","followers_url":"https://api.github.com/users/InonS/followers","following_url":"https://api.github.com/users/InonS/following{/other_user}","gists_url":"https://api.github.com/users/InonS/gists{/gist_id}","starred_url":"https://api.github.com/users/InonS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InonS/subscriptions","organizations_url":"https://api.github.com/users/InonS/orgs","repos_url":"https://api.github.com/users/InonS/repos","events_url":"https://api.github.com/users/InonS/events{/privacy}","received_events_url":"https://api.github.com/users/InonS/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-03T08:06:30Z","updated_at":"2015-07-04T20:00:44Z","closed_at":"2015-07-03T13:37:30Z","body":"The .ipnb to .py translation works wonderfully, except that some imports are taken for granted when working in an IPython notebook. For the exported .py script to work properly, the packages and modules used should be explicitly 'imported' at the top of the .py file.\r\n\r\nI'm pretty sure this issue has to do with Jupyter more than IPython, seeing that nbconvert under the IPython repo has been inactive for a couple of years"},"comment":{"url":"https://api.github.com/repos/jupyter/nbconvert/issues/comments/118546195","html_url":"https://github.com/jupyter/nbconvert/issues/54#issuecomment-118546195","issue_url":"https://api.github.com/repos/jupyter/nbconvert/issues/54","id":118546195,"user":{"login":"Carreau","id":335567,"avatar_url":"https://avatars.githubusercontent.com/u/335567?v=3","gravatar_id":"","url":"https://api.github.com/users/Carreau","html_url":"https://github.com/Carreau","followers_url":"https://api.github.com/users/Carreau/followers","following_url":"https://api.github.com/users/Carreau/following{/other_user}","gists_url":"https://api.github.com/users/Carreau/gists{/gist_id}","starred_url":"https://api.github.com/users/Carreau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carreau/subscriptions","organizations_url":"https://api.github.com/users/Carreau/orgs","repos_url":"https://api.github.com/users/Carreau/repos","events_url":"https://api.github.com/users/Carreau/events{/privacy}","received_events_url":"https://api.github.com/users/Carreau/received_events","type":"User","site_admin":false},"created_at":"2015-07-04T20:00:44Z","updated_at":"2015-07-04T20:00:44Z","body":"Here is (roughly) what `%pylab` does\r\n```\r\nimport numpy\r\nimport matplotlib\r\nfrom matplotlib import pylab, mlab, pyplot\r\nnp = numpy\r\nplt = pyplot\r\nfrom IPython.core.pylabtools import figsize, getfigs\r\nfrom pylab import *\r\nfrom numpy import *\r\n```\r\n\r\nThe problem with writing loud and clear what not to do, is that people will not remember why it's wrong and what the issues are, they will just remember they can do it. \r\n\r\n"}}