{"action":"created","issue":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/1933","labels_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1933/labels{/name}","comments_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1933/comments","events_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1933/events","html_url":"https://github.com/spyder-ide/spyder/issues/1933","id":57983235,"number":1933,"title":"Unabling to create new folders by using two \"for\" loops","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/wontfix","name":"wontfix","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-17T21:15:40Z","updated_at":"2015-02-17T21:15:42Z","closed_at":null,"body":"_From [Giladda...@gmail.com](https://code.google.com/u/109815318391376110312/) on 2014-08-13T05:58:57Z_\n\nHi,\r\n\r\nI found a bug in SPYDER when trying to create new folders within two \"for loops\".\r\nMy code is:\r\n\r\n\r\nimport os\r\npath=os.getcwd()\r\nfor modularity in xrange(0,26):\r\n    m=modularity/100\r\n    for part in xrange(1,5):\r\n        os.chdir(path)\r\n        exec(\"new_folder = '\\mod&#37;s_part&#37;s'\" &#37; (m,part))\r\n        new_path=path + new_folder\r\n        if not os.path.exists(new_path):\r\n            os.makedirs(new_path)\r\n            os.chdir(new_path)\r\n\r\n\r\nIf I copy this to the console, the code works just fine, it creates 100 (25*4) new folders.\r\nHowever, if I run this code in a new dedicated python interpreter, only 4 new folders are created.\r\n\r\nCan anyone else verify this bug? I am using Spyder 2.2.5 that came with my python(x,y) version 2.7.6.1. My OS is windows 7 - 64bit.\r\n\r\nBest,\r\n\r\nGIlad\n\n_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1933_"},"comment":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/comments/74755157","html_url":"https://github.com/spyder-ide/spyder/issues/1933#issuecomment-74755157","issue_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1933","id":74755157,"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-17T21:15:41Z","updated_at":"2015-02-17T21:15:41Z","body":"_From [contrebasse](https://code.google.com/u/contrebasse/) on 2014-08-13T13:06:56Z_\n\nAlso, are you sure you need to use \"exec\" here ? This is really bad practice.\r\n\r\nThis should work (not tested):\r\nnew_folder = r'\\mod%s_part%s' % (m,part)"}}