What is the recommended way to append directories to the path segment? #1466
-
ExampleAs an example, in the undermentioned, I want to append the content of the variable " # Create and set up tree widget
self.tree_widget = PyQt6.QtWidgets.QTreeWidget()
tree_widget_header_labels: builtins.list = ["Name", "Location"]
self.tree_widget.setHeaderLabels(tree_widget_header_labels)
user_input_location: builtins.str = yarl.URL("applications:/").human_repr()
kioclient_items = BrightnessManager.acquire_applications(input_location=(user_input_location))
rendered_items: builtins.list = []
for i in builtins.range(builtins.len(kioclient_items)):
item = PyQt6.QtWidgets.QTreeWidgetItem(
[
f"{kioclient_items[i]}",
f"{user_input_location}"
]
)
rendered_items.append(item)
self.tree_widget.insertTopLevelItems(0, rendered_items) Related#138 (comment) appears relevant, although IDK whether it applies. Footnotes |
Beta Was this translation helpful? Give feedback.
Answered by
RokeJulianLockhart
Feb 8, 2025
Replies: 1 comment
-
Solution#!/usr/bin/env python3.13
url.with_path(path) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RokeJulianLockhart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution