I suddenly saw this marking next to one of the files in my Python project working on PyCharm. What does it mean?
I didn't get any tooltip when hovering over this icon to tell me what it meant, nor did I find any reference to it in a Google search.
The .py file is greyed out and marked with an X in the Project View because you chose the option "Mark as Plain Text". You can reverse it by choosing "Mark as 'Python'". Both options are available by right-clicking on the file in Project View.
Exclude files and folders
Marking dynamically generated files as excluded can speed up the indexing and overall IDE performance. Excluded files remain a part of a project, but are ignored by code completion, navigation, indexing, and inspections.
Related
I am trying to tag my python files in Windows 10. However, it seems not to working. I right click on the file, see the details, go to details tab and then... nothing?
I see some file properties, but I can't change them. The only thing I am able to do is "remove properties and personal information". What do you suggest?
Example:
I have a file which gets numbers as an input from the user and sorts the numbers.
My tags would be "sorting" and "input"
It is my understanding that, out of the box, Windows 10 supports a limited number of file types for tagging. Python files are not among those supported types. Therefore, some additional steps need to be taken.
This article details how to use the free File Meta Association Manager available from GitHub to enable tags for file types that aren't supported out of the box.
Once File Meta Association Manager installer file is downloaded from the repository release page install it.
Under the File Extensions list, scroll down and find .py. Then on the left side, select the "Simple" profile.
Once the simple profile is selected, then click "Add File Meta Handler".
Click the button to Restart Explorer.
Open Explorer and right click on a py file and add tags. Note, I did not need to update the registry for this to work.
What if py isn't in the list?
From this article:
If you can not find a specific file extension in the File Meta Association Manager, no application has registered the file extension so far. If you do associate a file extension with an application ("Always open with ..."), this does not create a registry entry. Therefore, associating an extension with an application is not sufficient that this extension gets listed in the File Meta Association Manager.
To add an extension not listed yet, you have to start the registry editor with administrator privileges, go to "HKEY_LOCAL_MACHINE" → "SOFTWARE" → "Classes" and choose "New → Key" from the context menu.
In my settings, I have the TODO bound to highlight in yellow, yet in the actual code it does not highlight. Here is a screenshot of my settings: Editor -> TODO
Does anyone know how to fix this?
EDIT: I even tried re-installing Pycharm and I still have the issue.
EDIT 2: In the TODO Window, it is saying "0 TODO items found in 0 files". I believe this means it is looking in the wrong files to check for TODO items. However, when I try to find TODO items in "this file" it still doesn't work. Does anyone know why this is?
Go to Preferences (or Settings), Project Structure, and make sure the folder with your files is not in the "Excluded" tab's list.
Click the folder you want to include and click on the "Sources" tab. Click Apply, then OK!
It should work.
I recently updated PyCharm Professional and my TODOs no longer worked. I went into settings and changed the alert icon, then saved, and retyped them and they worked. I imagine for my case, there was a delay in the new version picking them up. Might just need to retype them to get them working again, though the reboot should have addressed this.
Not sure if your pattern is causing this, but mine is set up like so, with two separate patterns:
\btodo\b.*
\bfixme\b.*
Neither is case sensitive, BTW...
Perhaps try some other patterns to see if you can get those to work.
I think the problem for me was the same as explained by #theBrownCoder but I couldn't find the project structure settings.
Apart from not showing TODO's another symptom was impossibility to go to function definitions defined in other files and inability to rename python files with the error: "Selected element is used from non-project files. These usages won't be renamed."
Googling for this the solution that worked for me was to delete the .idea folder (make sure to back it up just in case, you will lose the configurations).
I had the exact same problem, and the solution suggested by theBrownCoder worked perfectly.
For those who cannot find which menu theBrownCoder is referring to, go to File > Settings > Project: "Title of Project" > Project Structure.
It is in the dropdown of Project in Settings where you can also select your Python interpreter.
It might be the file type.
Right click, Override File Type.
I had this issue with a text file and it's copy, only the first one would use #TODO
I've just installed Visual Studio Code and am using it to browse a folder for a project written in Python. Is there a way for me to tell Visual Studio Code to filter the view in the Explorer pane to show only certain files -- specifically, only those files with a .py extension which are Python source code files?
Brandon Taylor
Kind of. First I would suggest to open the settings and set workbench.list.keyboardNavigation to filter (so your list get filtered immediately).
Be sure to have the focus on the explorer window and not in the editor then. Now simply start to type .py. It will filter all files that contain the filter string in its filenames. It seems that you can't use regex to be sure to just find files that end with .py. You would also find a file like animal.python.js. But I think this is a good start and fits most cases.
You can enable, disable and clear the filter when hovering over the filter string on the right side of the explorer window and click the appropriate buttons.
Additional information can be found here.
I just started using PyCharm as my IDE for Python. At the moment whenever I open a new .py file, I have to go to Code -> Configure Current File Analysis..., and then change the highlighting to syntax (preference) for every individual .py file.
Is there a way to change this for every file automatically, by default?
First post on stackoverflow by the way.
Thanks!
If you prefer not to see PyCharm's code inspections, I would suggest creating a new inspections profile that does no inspections. To do that, go to the Code -> Configure Current File Analysis dialog like you have been, but this time click on the Configure inspections link. At the top, click the "Manage" dropdown and copy the current profile into a new profile which you'll name "No inspections". Then uncheck everything, save the new inspections profile, and you'll be done. All new .py files should now be created under your "No inspections" profile.
Note that as far as I can tell, the inspection settings get saved per-project, rather than as a global setting. But changing the inspection profile once per project shouldn't be too much of a hassle.
If you click on the icon resembling a downard-pointing triangle in the PyDev Package Explorer and then select "Customize View", The "Available Customizations" pop-down allows the user to select which of a standard set of files are visible in the package explorer.
That's great if you wish to exlude or include certain standard types of file from the view, however I'd like to exclude a type which is currently unknown to PyDev.
In this case, I'd like to exclude "*,cover" - that's any automatically generated coverage report file. PyDev creates these files any time you try to run a coverage analysis but does not seem to have a way of excluding these files from the views. I'd love to hide all the ",cover" files in order to reduce the clutter in my package explorer.
To the left of the down arrow is the "Setup custom filters" button. You can enter custom filters delimited by commas. If that file name indeed has a comma in it, then you will have to enter the filter as *cover since *,cover is treated as two separate filters.