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: patch-diff.githubusercontent.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:6bef715b-bf31-3c18-ebb1-58ef7e56d2e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFDC:3301CD:6265590:80F59C7:696DABF1 |
| html-safe-nonce | bfad0f5bc7a9aa239006e7c4644e87925f39b225e03c13d4e77f08d63949a9f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkRDOjMzMDFDRDo2MjY1NTkwOjgwRjU5Qzc6Njk2REFCRjEiLCJ2aXNpdG9yX2lkIjoiMjQ5OTg2ODQ2MzUyMTk2NzA4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 17e9d43372249cf23c153bb5a6553ce6d2d277001274bfd11762068b082da00f |
| 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 | 4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064 |
| 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 | 7e5ae23c70136152637ceee8d6faceb35596ec46 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width