pygame

How to plot images as a radial tree only using math

廉价感情. 提交于 2020-05-29 09:37:47
问题 I've found this answer that is coded in C# to plot nodes in a radial tree and gained a lot of information. The problem is that I am having a hard time reading C# and can't exactly figure out the entirety of what's going on. The goal is to try and render a radial tree like the image below, into a game and dynamically show and hide the points based on progress. The majority of radial trees I see use networkx or matplotlib , but I don't want to bloat the game with packages when I only need to

pygame error: “ImportError: No module named 'pygame'”

核能气质少年 提交于 2020-05-29 02:34:09
问题 This is my situation: I tried importing pygame in both python 3.4.2 and python 3.6.3 using both pip and pip3 respectively. In the python 3.4.2 shell: Traceback (most recent call last) is: File "", line 1, in import pygame ImportError: No module named 'pygame' In the python 3.6.3 shell: Traceback (most recent call last): File "", line 1, in import pygame File "C:\Users\aditya dand\AppData\Local\Programs\Python\Python36\lib\site-packages\pygame__init__.py", line 141, in from pygame.base import

pygame error: “ImportError: No module named 'pygame'”

旧街凉风 提交于 2020-05-29 02:30:15
问题 This is my situation: I tried importing pygame in both python 3.4.2 and python 3.6.3 using both pip and pip3 respectively. In the python 3.4.2 shell: Traceback (most recent call last) is: File "", line 1, in import pygame ImportError: No module named 'pygame' In the python 3.6.3 shell: Traceback (most recent call last): File "", line 1, in import pygame File "C:\Users\aditya dand\AppData\Local\Programs\Python\Python36\lib\site-packages\pygame__init__.py", line 141, in from pygame.base import

pygame error: “ImportError: No module named 'pygame'”

匆匆过客 提交于 2020-05-29 02:29:28
问题 This is my situation: I tried importing pygame in both python 3.4.2 and python 3.6.3 using both pip and pip3 respectively. In the python 3.4.2 shell: Traceback (most recent call last) is: File "", line 1, in import pygame ImportError: No module named 'pygame' In the python 3.6.3 shell: Traceback (most recent call last): File "", line 1, in import pygame File "C:\Users\aditya dand\AppData\Local\Programs\Python\Python36\lib\site-packages\pygame__init__.py", line 141, in from pygame.base import

screen sharing in python

故事扮演 提交于 2020-05-25 05:19:40
问题 Hi I'm stuck and I did not find anything helpful on the internet. I'm trying to make a screen-sharing program in python. The problem is that I can't send the screen in at least 24 fps, because when I take a screenshot with PIL (ImageGrab), something delays there. my client will get the picture (screenshot) from the server and "blit" it to the screen using pygame. Server: # -*- coding: utf-8 -*- import socket import os import threading from PIL import ImageGrab def RetrFile(name, sock): while

How can you make the previous line disappear in python?

泪湿孤枕 提交于 2020-05-24 03:41:06
问题 I'm making a constellation that starts from (0,0). The previous line has to disappear after a two second delay and when the left is clicked within the two second delay, white circles should appear. I don't know why my timer isn't working and I'm not sure how to make the line disappear. Also the circles don't appear. This is my code from pygame import * import random init() size = width, height = 700, 700 screen = display.set_mode(size) button = 0 BLACK = (0, 0, 0) GREEN = (0, 255, 0) RED =

Pygame Button with rounded Corners, border_radius argument does not work

我们两清 提交于 2020-05-23 18:48:06
问题 I am currently learning pygame. When programming rectangles with rounded corners I encountered a problem. pygame.draw.rect() draw a rectangle rect(surface, color, rect) -> Rect rect(surface, color, rect, width=0, border_radius=0, border_radius=-1, border_top_left_radius=-1, border_top_right_radius=-1, border_bottom_left_radius=-1) -> Rect Draws a rectangle on the given surface. border_radius (int) -- (optional) used for drawing rectangle with rounded corners. The supported range is [0, min

Checking Pygame Version

跟風遠走 提交于 2020-05-23 09:13:25
问题 I'm very new to both Python and Pygame. I have Python 3.5.1 32-bits installed on Window and Pygame 1.9.2 Python 3.5 installed as well. But in case if i forget, is there a way to check the pygame version I have installed from either command line or Python IDLE. For Python, I use python -V But for Pygame, I don't know how to. Sorry in advance if my question is silly. 回答1: Use this: pip show <pack_name> Alternative: pip freeze | grep <pack_name> 回答2: I know this question is a year old and has an

Mp3 player - the “file not found” messagebox.showerror shows up every time I play a file

浪子不回头ぞ 提交于 2020-05-17 06:04:49
问题 The code below is a media player (mp3). It worked perfectly until I added the show_details() function which is supposed to show the length and timing of the song, the error message "file not found" appears when playing a file (The file does play! but the error message pops everytime). Once I take off the 3 lines consisting of 'a', 'total_length' and 'print' statements, the error stops to show up and the song of course plays normally. What is the problem with my code? filelabel = Label(root,

Mp3 player - the “file not found” messagebox.showerror shows up every time I play a file

南笙酒味 提交于 2020-05-17 06:04:23
问题 The code below is a media player (mp3). It worked perfectly until I added the show_details() function which is supposed to show the length and timing of the song, the error message "file not found" appears when playing a file (The file does play! but the error message pops everytime). Once I take off the 3 lines consisting of 'a', 'total_length' and 'print' statements, the error stops to show up and the song of course plays normally. What is the problem with my code? filelabel = Label(root,