{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/9353","repository_url":"https://api.github.com/repos/ipython/ipython","labels_url":"https://api.github.com/repos/ipython/ipython/issues/9353/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/9353/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/9353/events","html_url":"https://github.com/ipython/ipython/issues/9353","id":143185826,"number":9353,"title":"Syntax for getting shell output as a string","user":{"login":"Chiel92","id":1030961,"avatar_url":"https://avatars.githubusercontent.com/u/1030961?v=3","gravatar_id":"","url":"https://api.github.com/users/Chiel92","html_url":"https://github.com/Chiel92","followers_url":"https://api.github.com/users/Chiel92/followers","following_url":"https://api.github.com/users/Chiel92/following{/other_user}","gists_url":"https://api.github.com/users/Chiel92/gists{/gist_id}","starred_url":"https://api.github.com/users/Chiel92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chiel92/subscriptions","organizations_url":"https://api.github.com/users/Chiel92/orgs","repos_url":"https://api.github.com/users/Chiel92/repos","events_url":"https://api.github.com/users/Chiel92/events{/privacy}","received_events_url":"https://api.github.com/users/Chiel92/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-24T08:35:22Z","updated_at":"2016-04-30T00:30:40Z","closed_at":null,"body":"In the IPython shell, we have a distinguishing syntax for having output returned as a string or as a list.\r\nI'm not sure about the usecase of the latter in its current form, but it appears to exist.\r\n\r\n```ipython\r\nIn [5]: !echo asdf\r\nasdf\r\n\r\nIn [6]: !!echo asdf\r\nOut[6]: ['asdf']\r\n```\r\n\r\nCould we introduce this syntax for assignment as well?\r\nI.e. like\r\n\r\n```ipython\r\nIn [7]: test = !echo asdf\r\nIn [8]: print(test)\r\nasdf\r\n\r\nIn [9]: test = !!echo asdf\r\nIn [10]: print(test)\r\n['asdf']\r\n```\r\n\r\nThis would make things concise and consistent. Also, the current way of obtaining a string from a bash command is\r\n\r\n```ipython\r\ntest = !echo asdf\r\ntest = LSString(test.n)\r\n```\r\n\r\nNot only does this need two lines of code instead of one, it also has performance overhead for unnecessary splitting and joining the output."},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/215914533","html_url":"https://github.com/ipython/ipython/issues/9353#issuecomment-215914533","issue_url":"https://api.github.com/repos/ipython/ipython/issues/9353","id":215914533,"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":"2016-04-30T00:30:40Z","updated_at":"2016-04-30T00:30:40Z","body":"I'm going to side with Thomas on that one, and you can already use `test.s` to get the string, and as SList inherit a list you can also just use it as is, or use `list(test)` "}}