{"action":"created","issue":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/1283","labels_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1283/labels{/name}","comments_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1283/comments","events_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1283/events","html_url":"https://github.com/spyder-ide/spyder/issues/1283","id":57967144,"number":1283,"title":"runfile vs run selection","user":{"login":"spyder-issues-migrator","id":11021581,"avatar_url":"https://avatars.githubusercontent.com/u/11021581?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-issues-migrator","html_url":"https://github.com/spyder-issues-migrator","followers_url":"https://api.github.com/users/spyder-issues-migrator/followers","following_url":"https://api.github.com/users/spyder-issues-migrator/following{/other_user}","gists_url":"https://api.github.com/users/spyder-issues-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-issues-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-issues-migrator/subscriptions","organizations_url":"https://api.github.com/users/spyder-issues-migrator/orgs","repos_url":"https://api.github.com/users/spyder-issues-migrator/repos","events_url":"https://api.github.com/users/spyder-issues-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-issues-migrator/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/1%20star","name":"1 star","color":"FFFFFF"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-17T19:09:30Z","updated_at":"2015-02-17T19:09:32Z","closed_at":null,"body":"_From [kinnison...@gmail.com](https://code.google.com/u/104685941974947235171/) on 2013-02-25T14:39:23Z_\n\nSpyder Version:  2.1.14dev3\r\nPython Version:  2.7.3\r\nQt Version:      4.8.1, PyQt4 (API v2) 4.9.1 on Linux \n\nWhat steps will reproduce the problem?\n\n 1. make a script with the following code: print(1/5)\r\n2. run the script via runfile (F5)\r\n3. run the script via selection (select the code and F9) What is the expected output? What do you see instead? First execution prints 0, second execution prints 0.2.  I prefer the 0.2, but I expect that I should get the same answer both times. \n\nPlease provide any additional information below\n\n.\n\n_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1283_"},"comment":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/comments/74730346","html_url":"https://github.com/spyder-ide/spyder/issues/1283#issuecomment-74730346","issue_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1283","id":74730346,"user":{"login":"spyder-issues-migrator","id":11021581,"avatar_url":"https://avatars.githubusercontent.com/u/11021581?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-issues-migrator","html_url":"https://github.com/spyder-issues-migrator","followers_url":"https://api.github.com/users/spyder-issues-migrator/followers","following_url":"https://api.github.com/users/spyder-issues-migrator/following{/other_user}","gists_url":"https://api.github.com/users/spyder-issues-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-issues-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-issues-migrator/subscriptions","organizations_url":"https://api.github.com/users/spyder-issues-migrator/orgs","repos_url":"https://api.github.com/users/spyder-issues-migrator/repos","events_url":"https://api.github.com/users/spyder-issues-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-issues-migrator/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T19:09:32Z","updated_at":"2015-02-17T19:09:32Z","body":"_From [rdb...@gmail.com](https://code.google.com/u/104365189212835975583/) on 2014-09-21T20:39:26Z_\n\nI just ran into this myself and I have to disagree that this is an invalid bug. A big advantage of having an interpreter console built in is you can type in snippets of code to see what it does when you're not sure about some aspect of the language. This is especially useful for debugging when a program is behaving unexpectedly. I don't think it's too much to ask for runfile and the console to behave the same when running the same piece of code. The work-around is fine once you know what's going on, but if the problem is in the middle of a hundred lines of code, and your test values appear to be correct in the console but your if statement branches the wrong way in the program anyhow, it can mean extra hours of debugging time to get to the point where you realize you need the work-around to get consistent values. Anyway, instead of the work-around suggested, imo it's probably better to just upgrade to python 3.x."}}