2

When coding in Python and executing this line of code:

print("https://stackoverflow.com/")

enter image description here

It is shown in the running console as a pretty nice link =).

But how can I archive that with a local path?

What is not working is:

print("file:///C:\Programs\something")
print("C:\Programs\something")

enter image description here

Cutton Eye
  • 3,207
  • 3
  • 20
  • 39
  • Does this answer your question? [Can IntelliJ create hyperlinks to the source code from log4j output?](https://stackoverflow.com/questions/458820/can-intellij-create-hyperlinks-to-the-source-code-from-log4j-output) – TheMisir Sep 14 '20 at 14:50
  • @TheMisir Are am I right, that this modifies the console it self and it provides the path of the file where the output comes from? - If not I didn't get it. – Cutton Eye Sep 16 '20 at 08:24

1 Answers1

3

You gotta convert those backslashes to forward slashes:

print("file:///C:\Programs\something".replace('\\', '/'))
Cutton Eye
  • 3,207
  • 3
  • 20
  • 39
j4nSolo
  • 342
  • 1
  • 14