Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open the default Python or Julia in the Basic Console #3033

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)
### Added

- Support for Python 3.13.
- You can now open a detached Basic Console with the default Python or Julia from the Consoles menu. Default
Python and Julia are defined in app settings (File->Settings->Tools)

### Changed

Expand Down
17 changes: 17 additions & 0 deletions spinetoolbox/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,23 @@ def icon(self, info):
return super().icon(info)


def basic_console_icon(language):
"""Returns an SVG icon for the given language or an empty QIcon if not available.

Args:
language (str): Kernel language

Returns:
QIcon: Icon
"""
if language == "python":
return QIcon(":/symbols/python-logo.svg")
elif language == "julia":
return QIcon(":/symbols/julia-logo.svg")
else:
return QIcon()


def ensure_window_is_on_screen(window, size):
"""
Checks if window is on screen and if not, moves and resizes it to make it visible on the primary screen.
Expand Down
Loading
Loading