I am opening a .txt file with my PyCharm IDE that contains multiple links among several other lines of text (actually these are logs from a continuously running script).
Like so:
----------------------- session start, Tuesday 12.10.2021, 12:48:53
>> some logs... -- 12:49:34
link: https://www.example.com/p/CU5Hn-RsSB9
>> more logs... -- 12:49:34
Now for convenience I would like to be able to click on that link rather than copy/pasting it to my browser - it seems like this should be a possible setting somewhere in PyCharm: But I cannot seem to find it and also not find any information on it on the web.
Anybody knows how to make links clickable in .txt files opened in PyCharm?
The ideal solution you are asking for would be configuring clickable URL links in the editor window but that is not currently supported by PyCharm.
That kind of configuration is hardcoded in the PyCharm IDE. For example, URLs are clickable if they're inside a Python comment or a Markdown file, but they can't be turned on/off; only the colors highlights can be configured (and thus the corresponding dialogues in the settings are an integral part of PyCharm that can't be changed.) Neither is there any way to create new file types with those configurations. You can see one such example by going to File > Settings > Editor > Color Scheme > Markdown and checking the Auto Link item in the list.
In these cases the alternative to your specification would be installing a plugin that implements the functionality. I searched the JetBrains Marketplace but I think no plugin is currently available that implements what you want. (A few are close, like TxtReader or Awesome Console but these still rely on sending the file/output to the console, they don't make the links clickable in the editor window.)
Having said that, the closest native alternative using vanilla PyCharm (without installing plugins) would be running the Terminal as an External tool to read the .txt file. This has the desirable advantage of opening the file inside the IDE and since PyCharm supports several terminals you get the flexibility of using the terminal specific settings you prefer.
Here's an example of configuring PyCharm's External Tool to open the .txt using Window's CMD. (Using the command line arguments /c more is terminal specific. Also notice the use of the $FilePath$ and $ProjectFileDir$ PyCharm specific macros.)
After your External Tool is configured you can use it by right clicking on the open file in the editor window or in the Project files view. In the terminal you can see the .txt file having the clickable URL.
Another alternative could be configuring the IDE's External Tool to launch a 3rd party text editor to open the .txt file; but the main drawback of that approach is it would open the file outside PyCharm.
For me, it looks like you can display a clickable link to a file, provided :
the file exists,
the file is a python file (ends with '.py'),
the file is in the project (the file owns to a directory inside the project)
for example, your file is "main.py" and your project root is "/Users/puiseux/GitHub/myproject" then the two lines
>>> filename = "/Users/puiseux/GitHub/myproject/main.py"
>>> print('File "%s", line %d' % (filename, 12))
will display a clickable link to the line 12 of file "main.py"
File "/Users/puiseux/GitHub/crypto/main.py", line 12
If you do not fulfill one of three conditions, it does not work
Related
In Visual Studio Code, from the Explorer pane, how can I drag a PNG file from my images folder and drop it in place in a markdown file, so that VS Code inserts the path to the dropped image?
Currently, VS Code just opens the image in a new tab.
I've reviewed the suggested answers, as well as the available markdown extensions, with no luck finding an answer.
Any assistance is appreciated!
I've looked it up everywhere too, bharath is entirely correct, for now you could just use right click -> copy path and paste it, It's quite tedious compared to a drag and drop solution, but Hopefully there would be an asset for that, If someone made this:
https://marketplace.visualstudio.com/items?itemName=mushan.vscode-paste-image
definitely something similar for just dragging and dropping would be possible
It seems like this is not possible yet in vscode as compared to visual studio. There seems to be a pending feature request on their GitHub issues page (link below) which was opened long back and not yet closed.
https://github.com/Microsoft/vscode/issues/5240
It should be in vscode v1.67 - it is in the Insiders Build now.
And see the v1.67 Release Notes: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_67.md#markdown-drop-into-editor-to-create-link:
You can now quickly create markdown links by dragging and dropping
files from VS Code's explorer into a markdown editor. Simply hold
Shift while dragging the file over a markdown editor to drop it into
the editor and create a link to it:
If the file looks like an image, we will automatically insert an
markdown image. Otherwise we add a normal markdown link.
This also works when dragging some types of files from other
applications, such as dragging and dropping images from a web browser:
enable Workbench > Editor > Drop Into Editor: Enabled
That allows you to Shift drag an image file into an editor without opening a new editor of that image.
enable Markdown > Editor > Drop: Enabled
Also see v1.68 Release Notes, pasting an image or file to create a link:
Paste files to insert Markdown links
We've added experimental support pasting to insert images or file
links in markdown.
This requires enabling "editor.experimental.pasteActions.enabled": true. You can currently copy files from the VS Code explorer. Pasting
image files inserts image references while pasting normal text files
inserts links to those files.
subject: If you want an image in any folder of your vscode.
simply follow the steps.
1.Go to vscode then right click on a folder in which you want your image and then choose reveal in file explorer. After that you can simply copy your image into the vs code folder.
I have installed npp plugins from sourceforge nppgtags on latest notepad++ version but i am not able to effectively use that. I am facing these problem
Is there any shortcut for nppgtags plugin of notepad to search references, create DB, search definition and other command?
On the sourceforge page the image of the plugin have 3 windows
nppgtags
doc-switcher
tag-view
but i am only getting nppgtags window. am i missing something here or i need to install some other plugin for effectively using it.
adding image url: image of the plugin on notepad++
Got answer from developer on sourcefourge. link
I want to know if this plugin has any keyboard shortcut in it.
I haven't predefined any shortcuts on purpose because when you have a lot of plugins those might have conflicting shortcut keys. So I've left the shortcut definitions to the user and to his preference.
To set a shortcut in Notepad++ go to the Settings menu, Shortcut Mapper... . Chose Plugin Commands, find NppGTags commands in the list and define whatever shortcuts you need. Those will be saved in your Notepad++ config folder, shortcuts.xml file.
what are the other plugin you are using in that.
The one on the left is actually Notepad++ internal function - Doc Switcher. Go to Notepad++ Settings menu, Preferences... , select General. Find there Document List Panel and mark Show + optionally Disable extension column as it is in my case.
The one on the right is TagsView plugin. It is available through PluginManager and can be also found in SourceForge if you search for it.
The names of the plugins can actually be seen from their windows titles. Just look at the screenshots, above each plugin's sub-window. There is written its name.
I am trying to install opencv in windows. The manual (secn 1.4) says "choose a build [e.g. vs2010, win32] and download", but there is only the full executable file available (for 2.4.2). So I downloaded that file, which then expanded into several directories. However, this directory list does not match what is shown under item 7 of the section - mainly the "bin" directory is missing. So I guess something more has to be done besides just clicking on the executable.
Under "build" dir, I see x86/vc10/bin (I am guessing that vc10 stands for visual c++ 2010). But how do I install these and link visual studio 2010 with it? The manual only says to setup "OPENCV_DIR" variable which should have "bin" under it, but I dont have that.
This seems like a real problem any new user would face with opencv installation. Any correct instructions and link available on how to install for windows+visual studio 2010?
Updates: Full solution posted below.
After much experimentation, I have got opencv-2.4.2(win-exe) + vstudio2010-express working together. Thanks to Abid, for providing a helpful link, an additional helpful link is http://blog.hcilab.org/bastian/2012/06/installing-opencv-2-4-windows-7-visual-studio
Here is the full list of steps:
set system var OPENCV_DIR = install_dir\build
set system var TBBROOT = tbb_install_dir
path += ;%OPENCV_DIR%\x86\vc10\bin;%TBBROOT%\bin\ia32\vc10
create empty project: File->New->Project->Win32ConsoleApp
add the following items in project->Properties:
ConfigProperties->VC++Dirs->Include: $(OPENCV_DIR)\include;$(TBBROOT)\include
Linker->General->AdditionalLibDirs: $(OPENCV_DIR)\x86\vc10\lib;$(TBBROOT)\lib\ia32\vc10
Linker->Input->AdditionalDeps: add lib items from opencv and tbb (in Debug and Release modes).
for details of which files to include, see http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to
download image-display test file from above site, save it in the project dir. But the Test.cpp in that page requires more inputs, so it does not work easily. Instead, use the code from http://docs.opencv.org/doc/tutorials/introduction/display_image/display_image.html#display-image
Properties->ConfigProps->Debugging->CommandArgs: mention file name to be loaded
Tools->Option->Debugging->Symbol->MS-Server=yes (this removes most of the "PDB not found" errors)
Tools->Settings->ExpertSettings=on (this also removes some errors)
copy tbb_debug.dll and tbb.dll from TBBROOT\bin\ia32\vc10 to the project dir (I dont know why these are not automatically picked up with the settings done above)
Ctrl+F5 to run (start without debugging)
i think your installation is OK. just need to configure with VS
in Project Properties > C/C++ >
Add Additional Include Directory: C:\opencv\build\include;C:\opencv\build\include\opencv
C/C++ > Linker > Input add Additional Dependencies :
C:\opencv\build\x86\vc9\lib\opencv_core231.lib
C:\opencv\build\x86\vc9\lib\opencv_flann231.lib
C:\opencv\build\x86\vc9\lib\opencv_highgui231.lib
C:\opencv\build\x86\vc9\lib\opencv_imgproc231.lib
and more if needed
add OPENCV_DIR environment variable with value C:\opencv\build\x86\vc10\bin
more detail follow this OpenCV 2.1 with MS Visual Studio
I have a Windows Installer XML (WiX 3.5) project and five localization files for my installer. Therefore WiX creates five .msi files, for every language one. How can i put all in one .msi and let the user select the language when executing the installer?
I heard something about a bootstrapper, but then i would have a Setup.exe and i need a msi file. Is it not possible to adabt the localization strings after compiling with WiX?
This can be done using transforms. Please take a look at this article:
http://www.installsite.org/pages/en/msi/articles/embeddedlang/
There are 2 parts to making this happen,
localisation of the Installer UI, and/or
choice of installed files.
The method I chose will automatically select the local (or near local) language, and can also be forced to a specific transform using command line options. This doesn't prompt the user to choose which language to install in - so maybe it doesn't actually meet your needs.
The second 'installed files' doesn't seem to be documented as well and I was recently asking about it in Why would MST not include files with different content.
As a response provided there is now an ANT build script using Windows7 SDK & antdotnet
I'm trying to find a tool for Windows that I can use to preview .tex and .mp files as they are saved. Does such a tool exist? I have TeXworks installed which has a handy build button (this displays the result in another window), but I'd rather use Emacs. Also, TeXworks does not compile .mp files.
Perhaps there's a more elegant way to preview files, other than the approach I'm thinking of.
Solution is to use pdflatex and Sumatra PDF, since this viewer auto-reloads the file.