{"action":"created","issue":{"url":"https://api.github.com/repos/fragmuffin/cqparts/issues/85","repository_url":"https://api.github.com/repos/fragmuffin/cqparts","labels_url":"https://api.github.com/repos/fragmuffin/cqparts/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/fragmuffin/cqparts/issues/85/comments","events_url":"https://api.github.com/repos/fragmuffin/cqparts/issues/85/events","html_url":"https://github.com/fragmuffin/cqparts/issues/85","id":322328862,"number":85,"title":"Question: Howto get stdout output from cqparts/cadquery scripts","user":{"login":"gntech","id":1529109,"avatar_url":"https://avatars3.githubusercontent.com/u/1529109?v=4","gravatar_id":"","url":"https://api.github.com/users/gntech","html_url":"https://github.com/gntech","followers_url":"https://api.github.com/users/gntech/followers","following_url":"https://api.github.com/users/gntech/following{/other_user}","gists_url":"https://api.github.com/users/gntech/gists{/gist_id}","starred_url":"https://api.github.com/users/gntech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gntech/subscriptions","organizations_url":"https://api.github.com/users/gntech/orgs","repos_url":"https://api.github.com/users/gntech/repos","events_url":"https://api.github.com/users/gntech/events{/privacy}","received_events_url":"https://api.github.com/users/gntech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-11T15:00:12Z","updated_at":"2018-05-11T17:37:41Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I like to have print() statements or log.info() statments in my code that shows information about script progress, calculated design values, and so on. Is it possible somehow? Right now it looks like it is swallowed by FreeCAD somehow. Sometimes I get the output from the script after the entire script is finished. I dont get error or tracebacks from the script which is annoying as well.\r\n\r\n``` python\r\nimport os\r\nfrom ct1 import CoffeTable\r\n\r\ntable = CoffeTable()\r\n\r\nworking_folder = os.path.dirname(os.path.realpath(__file__))\r\ndir2d = os.path.join(working_folder, \"build/2d\")\r\ndir3d = os.path.join(working_folder, \"build/3d\")\r\ndirgltf = os.path.join(working_folder, \"build/gltf\")\r\n\r\nprint(table.tree_str(name=\"ct1\"))\r\n\r\nprint(\"Exporting part SVG 2D-views\")\r\nif not os.path.isdir(dir2d):\r\n    os.makedirs(dir2d)\r\ntable.find('leg_0').local_obj.exportSvg(os.path.join(dir2d, \"ct1_leg.svg\"), view_vector=(0,1,0))\r\ntable.find('shelf_0').local_obj.exportSvg(os.path.join(dir2d, \"ct1_shelf.svg\"), view_vector=(0,0,-1))\r\ntable.find('glass_top').local_obj.exportSvg(os.path.join(dir2d, \"ct1_glass_top.svg\"), view_vector=(0,0,1))\r\n\r\nprint(\"Exporting part STEP 3D-models\")\r\nif not os.path.isdir(dir3d):\r\n    os.makedirs(dir3d)\r\ntable.find('leg_0').exporter(\"step\")(os.path.join(dir3d, \"ct1_leg.step\"))\r\ntable.find('shelf_0').exporter(\"step\")(os.path.join(dir3d, \"ct1_shelf.step\"))\r\ntable.find('glass_top').exporter(\"step\")(os.path.join(dir3d, \"ct1_glass_top.step\"))\r\n\r\nprint(\"Exporting assembly GLTF-model\")\r\nif not os.path.isdir(dirgltf):\r\n    os.makedirs(dirgltf)\r\ntable.exporter('gltf')(os.path.join(dir3d, \"ct1.gltf\"))\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/fragmuffin/cqparts/issues/comments/388433523","html_url":"https://github.com/fragmuffin/cqparts/issues/85#issuecomment-388433523","issue_url":"https://api.github.com/repos/fragmuffin/cqparts/issues/85","id":388433523,"user":{"login":"gntech","id":1529109,"avatar_url":"https://avatars3.githubusercontent.com/u/1529109?v=4","gravatar_id":"","url":"https://api.github.com/users/gntech","html_url":"https://github.com/gntech","followers_url":"https://api.github.com/users/gntech/followers","following_url":"https://api.github.com/users/gntech/following{/other_user}","gists_url":"https://api.github.com/users/gntech/gists{/gist_id}","starred_url":"https://api.github.com/users/gntech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gntech/subscriptions","organizations_url":"https://api.github.com/users/gntech/orgs","repos_url":"https://api.github.com/users/gntech/repos","events_url":"https://api.github.com/users/gntech/events{/privacy}","received_events_url":"https://api.github.com/users/gntech/received_events","type":"User","site_admin":false},"created_at":"2018-05-11T17:37:41Z","updated_at":"2018-05-11T17:37:41Z","author_association":"CONTRIBUTOR","body":"@jmwright I run the script above from command line like so: `python build_ct1.py`  and I get this output to the terminal.\r\n\r\n``` bash\r\n$ python build_ct1.py\r\nNo handlers could be found for logger \"cqparts.assembly\"\r\nExporting assembly GLTF-model\t\t\r\n```\r\n\r\nIt is very strange, only the last print() statement gets printed"}}
{"actor":{"display_login":"gntech"}}