Python change app_name in win10toast - python

Recently i tried to make a toast notification i used the package win10toast.
Then i couldn't get rid of the "Python" app name at the top. If i compile it to an exe it says "yourapp.exe" is there a way to change that this is my code:
from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Test","Test",duration=10)
Here is a screenshot of how it looks:
I hope it is possible because i saw a application written in python that had the website url at the top. If there is no way to do that in win10toast is there a other library that can do that?
Would be amazing if someone could help me <3

I know I'm a little bit late and you've probably already moved on in your life, but I do know of a new module. My own! (Win10Toast) Unfortunately I haven't added capability to change the name, however you can use the updated version of Microsoft Toasts! It also allows you to put buttons on. You can check out Microsoft's page to see what can go in the XML and this StackOverflow page for how to use that XML in Python with the WinRT module.
I am planning on updating Win10Toast to use the WinRT module, but haven't gotten around to it yet.

Related

No module named sublime

I'm trying to work on some old code that used a library I'm not very familiar with anymore, and am getting the 'No module named' error. I'm using sublime text editor on windows. I had edited some things in build to run c++ previously if that might effect it.
If the library in particular matters, it is youtube_dl
I have tried $pip install -upgrade youtube_dl but it hasn't changed anything.
The code that is throwing an error is import youtube_dl
I searched around on the internet, and I found an answer.
(Edited for clarity)
”Sublime is a module only available in Sublime Text embedded Python interpreters.
import sublime will only work from a plugin or inside the console, not on your system Python interpreter.”
The forum post is here.
Not sure if this will help, as I do not know if you are trying to import sublime, but this is literally all the info I could find.
Hopefully this helps!

Can't import a cynthonized file after successful compilation (Python3)

I want to speed up my python code so i tried to translate it in c thanks to cython. I followed the basics tutorials and other youtube videos and i finally could create a functions_cython.c file. But somehow i just can't import it. I tried to import it in my main file, i also tried in another file named 'testing.py' but I always receive errors saying that the module 'functions_cython' does not exist, while it actually is in the file. Do you have any idea why ? (i linked some images if that can help)
The problem was because I was using PyCharm's "community version" and this version (in opposition of the professional one) does not allow to import .c formats. I switched to VS Code.

Python 3 Pyperclip Installed but Module not Found

I'm trying to copy some text to clipboad in my python program, so I've installed pyperclip via pip command via Windows command line interface, it says everything is successfully installed, not a problem. However, when I import the thing into my project, I get
from tkinter import *
from tkinter import ttk
import pyperclip
import binascii
#my code...
...
ModuleNotFoundError: No module named 'pyperclip'
So I was like *** that, maybe it's broken, I found a little library that does exactly the same, called "clipboard". Exactly the same installation procedure - from the command line. Same successful installation. Same ModuleNotFoundError. So clearly something wrong on my side, but I have no idea what it is, no idea where to look and what to do. I just want to be able to copy some text to clipboard. Multiplatform. That's it.
It's Python 3.8, Windows 10
pyperclip-1.8.0
pip-20.2.2
If I need to show you some logs or tell you something about my installation, please tell me what exactly to do and where to find information you may need. I'm good with instructions, but I don't have much (any) experience rummaging through logs and python installation folders.
Similar posts have slightly different problems, I didn't find any clear solution or hints that I could understand. No reply seemed like a solution to me.
Anyway, I would really appreciate any help from the community. Being unable to simply copy something to clipboard is killing me, especially since it's the only thing I can't implement. And it's just one function for one button to copy one short piece of text. It's like being stuck at 99% loading, when everything is done, and you just can't write the final line of code, haha.
Pycharm uses a virtualenv for pycharm projects. Navigate through:
Pycharm >> File >> Settings(or press Ctrl+Alt+S on win) >> Project:Name >> Project Interpreter >> Click on the plus(+) symbol above the scroll bar and type in pyperclip and press install package.
And this will install pyperclip for your Pycharm IDE. Since pycharm uses a virtual env for its projects you can change it in the project interpreter section as well, and then the pyperclip you installed from the cmd using pip, will be available to be used on that global version of python(now used by your Pycharm too).
If you still have any errors or doubts, do let me know :D
Cheers

How to get quick documentation working with PyCharm and Pytorch

I'm running PyCharm on Windows 10, and installed PyTorch following the getting started guide. Where I used Chocolatey and Anaconda to set up everything.
I can run the PyTorch tutorials from inside the PyCharm IDE without any problems. So I feel like I have a proper set up, but there aren't any intellisense documentations for any of the PyTorch APIs.
For example;
import torch
x = torch.randn(128, 20)
If I mouse over randn and press CTRL+Q then PyCharm shows me a popup of the function definition without any documentation.
I'm expecting to see Python comments from the API documentation for that function:
https://pytorch.org/docs/stable/torch.html?highlight=randn#torch.randn
I'm a new beginner with Pytorch and Python, but this is something that I often have access to from inside the IDE with many other languages and libraries. So I feel like this should be possible to get working, but I can't seem to find any instructions on how to fix this.
I was able to get it working by doing the following:
PyStorm 2019.3
Open the settings for external documentation:
File / Settings / Tools / External Documentation
Add the following URL patterns:
Module Name: torch.nn.functional
URL: https://pytorch.org/docs/stable/nn.functional.html#{element.qname}
Module Name: torch
URL: https://pytorch.org/docs/stable/{module.basename}.html#{element.qname}
Seems to work for most APIs but you have to trigger the quick documentation tool window. This won't show docs if you CTRL+CLICK something.
You probably want to get Kite. It has this feature (that I use intensively) called co-pilot where you can get python docs immediately. I don't know if it's Linux/Mac specific but works for any editor, nit just Pycharm.
It's just another solution
PyCharm2022.1.x still cannot display torch(1.10) documentation.
#Reactgular 's answer is helpful. But the url that works for me is different.
Following the steps:
file --settings--tools -- external documentation -- add
Module Name: torch
URL/Path Pattern: https://pytorch.org/docs/stable/generated/{element.qname}.html#{element.qname}
Actually the above steps only let the pycharm show a link. But it is better than nothing. just click the link and a default browser will open the documentation.
You can also specify a customized browser instead of the system default browser: file-- settings-- tools --web browsers and preview
torch quick doc
I was about just to add a comment for Reactgular's solution but it turned out I didn't have enough "reputation" to do it.
For the torch.nn.functional module, I found it is more helpful to do this to jump directly to the detailed documentation for the function you are searching for.
torch.nn.functional
https://pytorch.org/docs/stable/generated/{element.qname}.html#{element.qname}
But of course, this is not a stable page so I guess it may not work later, so be careful about it.

no module named menu_pool

i installed django cms correctly but it says no module named menu_pool
do i have to install other menu plugin?
this path from menus.menu_pool import menu_pool i cannot find, what is the problem? can someone please help me find the clue
i followed the django-cms docs as written here: http://docs.django-cms.org/en/2.3/getting_started/tutorial.html#configuration-and-setup
It looks like Python can do import menus just fine, otherwise the error message would be different. A quick search through the docs for menus reveals that you likely want MenuPool instead of your second menu_pool.
If I'm not mistaken, from menus.menu_pool import MenuPool should give you your expected behavior. Then MenuPool will be in your namespace, so you can do nodes = MenuPool.get_nodes(), and anything else you wish.
Not much experience with django but you should check the module files installed on your system itself to see if there is some mistake or not.
You can get the directory address from sys.path variable in python itself.
Most of the time source is installed with python modules, so you can open up those files and see for yourself if this module is really there or not.
Or you can use the dir(menus) to see what modules are there under menus.

Categories