KivyMD examples not getting correctly displayed - material-design

I've downloaded KivyMD on my windows machine from here
KivyMD path _ _ _\Python36-32\Lib\site-packages\kivymd
I'm trying to see how the widgets look with MD and when I run .py files I only get a blank window.
This seems to be the case for almost all examples (.py files) under the kivymd folder.
Appreciate any inputs.
.

cd ...\Python36-32\Lib\site-packages\kivymd\demos\kitchen_sink
run python main.py
Note
Not all .py programs in ...\Python36-32\Lib\site-packages\kivymd will display a window. You can run python accordion.py and it will display a window of accordion widget.

Related

PyCharm - Print link in console

My script creates a file "wave_output.xlsx" and I would link to print a link to that file so I can click on it in the console to open it instead of navigating to the folder to open it each time the script is run. If I run:
print("https://google.com")
I get a link to Google that I can click on, and it opens Google in my browser. But if I run:
path = os.path.abspath("wave_output.xlsx")
print(path)
I get the output:
C:\Users...\wave_output.xlsx
as text and I can't click on it. How can I make that path a link I can click on?
Using Python 3.10 in PyCharm Community Edition 2022.1.3 on Windows 10.

Terminal doesn't open window on top Mac - Atom

I am currently using Atom to code in Python3 on my Mac and I have a package installed ("atom-python-run") which launches a terminal window with the command "python3 {path}" with 'path' being the current working directory with filename.py included. It opens just fine and runs perfectly, but the window doesn't open on top of my atom window but behind it instead. I have to click it every time to see the terminal window and it's really frustrating. I also hate using CMD+Tab to find it as well.
This is a bug in the package I'm using (I think) and I don't want to wait for them to fix it. Are there any methods in OS X to ALWAYS open Terminal on top of every other window? Or a third-party application? I can't find a solution to this problem anywhere online.
If you install the scripts package and use it, the output will be written to a window in the Atom application and will be shown at completion. Go to the Atom package page and search for the word script. You should get a hit on the "script" package. Install this package by just clicking on the install button and then open Atom and the python script you wish to run. Now in Atom go to the packages menu item and from that menu select "script". You'll be given several options, choose "run script" and your script should run showing the output in a window at the bottom of the Atom window.

Script that opens cmd from spyder

I am working on a text adventure with python and the issue i am having is getting spyder to open a interactive cmd window. so far i have tried os.systems('cmd / k') to try and open this which it did but i could not get any code to run and kept getting an app could not run this file error. my current code runs off a import module that pulls the actual adventure from another source code file. how can i make it to where only one file runs and opens the cmd window to play the text adventure?
(Spyder maintainer here) Cmd windows are hidden by default because there are some packages that open lot of them while running code (e.g. pyomo).
To change this behavior, you need to go to
Tools > Preferences > IPython console > Advanced settings > Windows adjustments
and deactivate the option called Hide command line output windows generated by the subprocess module.
I found myself in a similar situation, developing code for a research group with heavy Spyder usage. I came up with this workaround to force usage of the vanilla Popen class regardless of whether or not it is run from Spyder (full disclosure I have not tested it very aggressively):
import subprocess
try:
from spydercustomize import SubprocessPopen
except ImportError:
SubprocessPopen = subprocess.Popen
else:
SubprocessPopen = SubprocessPopen.__bases__[0]
process = SubprocessPopen()

PyCharm does not find pygame [duplicate]

I've downloaded pygame-1.9.1release.tar.gz from the Pygame website. I extracted and installed it and it's working fine in the command line Python interpreter in Terminal (Ubuntu). But I want to install it for some IDE, like PyCharm. How can I do it?
Well, you don't have to download it for PyCharm here. You probably know how it checks your code. Through the interpreter! You don't need to use complex command lines or anything like that. You need to is:
Download the appropriate interpreter with PyGame included
Open your PyCharm IDE (Make sure it is up to date)
Go to File
Press Settings (Or Ctrl + Alt + S)
Double click on the option that looks like Project: Name_of_Project
Click on Project Interpreter
Choose the interpreter you want to use that includes PyGame as a module
Save your options
And you are ready to go! Here is an alternate (I have never done this, please try to test it)
Add PyGame in the same folder as your PyCharm file (Your PyCharm stuff is always in
a specific file placed by you during installation/upgrade)
Please consider putting your PyCharm stuff inside a folder for easy access.
I hope this helps you!
For PyCharm 2017 do the following:
File - Settings
Double click on your project name
Select Project Interpreter
Click on green + button on the right side of the window
Type Pygame in search window
Click Install package.
Not I'm saying that the answers above won't work, but it might be frustrating to a newbie to do command line magic.
If you are using PyCharm and you are on a Windows 10 machine use the following instructions:
Click on the Windows start menu and type cmd and click on the Command Prompt icon.
Use the command pushd to navigate to your PyCharm project which should be located in your user folder on the C:\ drive. Example: C:\Users\username\PycharmProjects\project name\venv\Scripts.
(If you are unsure go to the settings within PyCharm and navigate to the Python Interpreter settings. This should show you the file path for the interpreter that your project is using. Credit to Anthony Pham for instructions to navigate to interpreter settings.)
HINT: Use copy and paste in the command prompt to paste in the file path.
Use the command pip install pygame and the pip program will handle the rest for you.
Restart you Pycharm and you should now be able to import pygame
Hope this helps. I had a fun time trying to find out the correct way to get it installed, so hopefully this helps someone out in the future.
I just figured it out!
Put the .whl file in C:\Program Files\Anaconda3
While in the folder, click on the blue File tab in the upper left corner of the Window Explorer (assuming you're using Windows)
Click on Open Windows PowerShell as administrator
Write or just copy and paste: py -m pip install pygame
It should start installing
Done!
I hope it works for you. I know it did for me.
I already had pygame installed with python38-32
since its working just fine with it. I used this version of python us my project interpreter.
1.File -settings
2.according to your settings look for project interpreter
3.click on your current project interpreter and click on the add symbol
4.choose system interpreter
5.select the python version thats works with pygame for you
6.Note: some versions of pygame don't work with some versions of python be sure
of what are you doing.
7.hope it works.

cx_freeze executable runs from cmd but not on click

After dealing with all .egg issues with cx_freeze, I'm having issues running the .exe on click or from .bat. If I run the .exe from cmd, it runs perfectly. But if I click on the .exe, I get a popup list of errors that goes off the page.
I've tried changing the base=None and base=Win32GUI to no avail.
I'm running python 3.4 from and Anaconda environment. The errors make it look like on running, the .exe is looking in the normal python path, but there are references the the correct python path as well.
Any experiences with this?
Error from clicking. This goes off the screen so I can't see the final error:
error

Resources