{"action":"created","issue":{"url":"https://api.github.com/repos/hylang/hy/issues/913","repository_url":"https://api.github.com/repos/hylang/hy","labels_url":"https://api.github.com/repos/hylang/hy/issues/913/labels{/name}","comments_url":"https://api.github.com/repos/hylang/hy/issues/913/comments","events_url":"https://api.github.com/repos/hylang/hy/issues/913/events","html_url":"https://github.com/hylang/hy/issues/913","id":101843935,"number":913,"title":"How can i write hy code in python file?","user":{"login":"acekingke","id":7586502,"avatar_url":"https://avatars.githubusercontent.com/u/7586502?v=3","gravatar_id":"","url":"https://api.github.com/users/acekingke","html_url":"https://github.com/acekingke","followers_url":"https://api.github.com/users/acekingke/followers","following_url":"https://api.github.com/users/acekingke/following{/other_user}","gists_url":"https://api.github.com/users/acekingke/gists{/gist_id}","starred_url":"https://api.github.com/users/acekingke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acekingke/subscriptions","organizations_url":"https://api.github.com/users/acekingke/orgs","repos_url":"https://api.github.com/users/acekingke/repos","events_url":"https://api.github.com/users/acekingke/events{/privacy}","received_events_url":"https://api.github.com/users/acekingke/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-19T09:18:31Z","updated_at":"2016-05-19T03:13:07Z","closed_at":"2015-08-19T09:40:10Z","body":"such as I define hy code like that:\r\n```\r\n(defn lex_get [ x]\r\n\t(-> x (get 0) (get 1)))\r\n```\r\ncan It define diectly in python file as string ,than call hy method to build python function ?"},"comment":{"url":"https://api.github.com/repos/hylang/hy/issues/comments/220217451","html_url":"https://github.com/hylang/hy/issues/913#issuecomment-220217451","issue_url":"https://api.github.com/repos/hylang/hy/issues/913","id":220217451,"user":{"login":"fragrans","id":102768,"avatar_url":"https://avatars.githubusercontent.com/u/102768?v=3","gravatar_id":"","url":"https://api.github.com/users/fragrans","html_url":"https://github.com/fragrans","followers_url":"https://api.github.com/users/fragrans/followers","following_url":"https://api.github.com/users/fragrans/following{/other_user}","gists_url":"https://api.github.com/users/fragrans/gists{/gist_id}","starred_url":"https://api.github.com/users/fragrans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fragrans/subscriptions","organizations_url":"https://api.github.com/users/fragrans/orgs","repos_url":"https://api.github.com/users/fragrans/repos","events_url":"https://api.github.com/users/fragrans/events{/privacy}","received_events_url":"https://api.github.com/users/fragrans/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T03:13:07Z","updated_at":"2016-05-19T03:13:07Z","body":"hi farhaven,\r\n\r\nSorry, I forgot to mention, sample code with following error:\r\n`\r\nC:\\Users\\LL L>c:\\Python27\\python.exe\r\nPython 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import hy\r\n>>>\r\n>>> x = hy.lex.tokenize(\"(defn foo [] (print 'fnord))\")\r\n>>> hy.importer.hy_eval(x, globals(), \"__main__\")\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"c:\\Python27\\lib\\site-packages\\hy\\importer.py\", line 110, in hy_eval\r\n    hytree.replace(foo)\r\nAttributeError: 'list' object has no attribute 'replace'\r\n>>>\r\n`"}}