Title: Introspection in Fiji Script Editor · Issue #84 · scijava/scyjava · GitHub
Open Graph Title: Introspection in Fiji Script Editor · Issue #84 · scijava/scyjava
X Title: Introspection in Fiji Script Editor · Issue #84 · scijava/scyjava
Description: I got around to testing introspection in scyjava, and it overall works quite nicely! However, when using the (Python3-enabled) Fiji's Script Editor, the reflection functions print to the calling terminal, rather than the Fiji script edit...
Open Graph Description: I got around to testing introspection in scyjava, and it overall works quite nicely! However, when using the (Python3-enabled) Fiji's Script Editor, the reflection functions print to the calling te...
X Description: I got around to testing introspection in scyjava, and it overall works quite nicely! However, when using the (Python3-enabled) Fiji's Script Editor, the reflection functions print to the callin...
Opengraph URL: https://github.com/scijava/scyjava/issues/84
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Introspection in Fiji Script Editor","articleBody":"I got around to testing introspection in scyjava, and it overall works quite nicely!\n\nHowever, when using the (Python3-enabled) Fiji's Script Editor, the reflection functions print to the calling terminal, rather than the Fiji script editor (see screenshot below). I suspect this behavior arises because all of the scyjava modules (like `src()` below) are imported prior to Fiji being initialized (i.e., in the /config/fiji.py script). At this time, `stdout` refers to the calling terminal, not the ScriptContextWriter. Because Python doesn't dynamically update imports, attempting to import the libraries again doesn't override `_stdout.write` to point to the script editor.\n\n\n\nA bad workaround is to append this to the beginning of the script:\n```python\n#@ ImageJ ij\nimport importlib\nimport scyjava.inspect\nfrom scyjava.inspect import methods, src\nimportlib.reload(scyjava.inspect)\nsrc(ij)\n```\n\nWhich then produces the ideal result:\n\n\nHowever, I'm not sure what the best method to accomplish this is. Maybe it'd be to somehow edit the config script to specify which writer to use. Ideally there's something simpler.","author":{"url":"https://github.com/ian-coccimiglio","@type":"Person","name":"ian-coccimiglio"},"datePublished":"2025-05-10T20:20:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/84/scyjava/issues/84"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:85870cc6-9676-7099-5a67-e9693cd8831d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6D0:220088:97731B:D2C154:696A8140 |
| html-safe-nonce | 2b096366e26ed47a773bed2b9fea8c1f49ded60d7006f8b44dc5084f68c496da |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkQwOjIyMDA4ODo5NzczMUI6RDJDMTU0OjY5NkE4MTQwIiwidmlzaXRvcl9pZCI6Ijg2OTQwMzY0MjM0MDU4OTYwMDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4d9a2abb52afdb9bf4a43ea34ca3402890f2e1b5b8314adddbe22faedbf6fb21 |
| hovercard-subject-tag | issue:3054503631 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scijava/scyjava/84/issue_layout |
| twitter:image | https://opengraph.githubassets.com/57bc4af6aed0d2a6d9fe00d8800c412117466bb065f89ada675b12c6ef7e4162/scijava/scyjava/issues/84 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/57bc4af6aed0d2a6d9fe00d8800c412117466bb065f89ada675b12c6ef7e4162/scijava/scyjava/issues/84 |
| og:image:alt | I got around to testing introspection in scyjava, and it overall works quite nicely! However, when using the (Python3-enabled) Fiji's Script Editor, the reflection functions print to the calling te... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ian-coccimiglio |
| hostname | github.com |
| expected-hostname | github.com |
| None | 913560fa317c3c5a71e34f9b19253c9f09d02b4b958a86c2a56f4c8541116377 |
| turbo-cache-control | no-preview |
| go-import | github.com/scijava/scyjava git https://github.com/scijava/scyjava.git |
| octolytics-dimension-user_id | 1262770 |
| octolytics-dimension-user_login | scijava |
| octolytics-dimension-repository_id | 113442144 |
| octolytics-dimension-repository_nwo | scijava/scyjava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 113442144 |
| octolytics-dimension-repository_network_root_nwo | scijava/scyjava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5998c30593994bf2589055aef7b22d368a499367 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width