library not initialized pygame

2021-05-04 Thread Quentin Bock
code: #imports and variable for loop import pygame running = True #initializes pygame pygame.init() pygame.mixer.init() pygame.font.init() #creates the pygame window screen = pygame.display.set_mode((1200, 800)) #Title and Icon of window pygame.display.set_caption("3.02 Project") icon =

library not initialized (pygame)

2021-05-02 Thread Quentin Bock
Code: #imports and variables for game import pygame from pygame import mixer running = True #initializes pygame pygame.init() #creates the pygame window screen = pygame.display.set_mode((1200, 800)) #Title and Icon of window pygame.display.set_caption("3.02 Project") icon =

text displays on screen only when I click to exit the program

2021-04-30 Thread Quentin Bock
code with comments for context: #Create a text based game where the user must find 3 items before completing a level #imports and variables for game import pygame from pygame import mixer running = True #initializes pygame pygame.init() #creates the pygame window screen =

need help with a translation issue

2021-04-17 Thread Quentin Bock
I'm trying to take the user input and let them change the target language or dest code: from deep_translator import GoogleTranslator import googletrans import sys language_list = googletrans.LANGUAGES print(language_list) feedback = input("Would you like to translate a sentence of your own?

setting user input equal to target language in Google Translator

2021-04-16 Thread Quentin Bock
is it possible to set the target language of a translation to be the input from a user? I have tried inputting specific abbreviations that would normally be accepted as the target language but it remains in Icelandic and I would like to change the target language based on the user's input without

FileNotFoundError: [Errno 2] No such file or directory: ''

2021-04-14 Thread Quentin Bock
I receive this error when I try to open a file The file (what I'm trying to open) is in the same folder as the program I'm trying to open it from; why is it saying no such file or directory? this is the only part of the code that causes the error file = open('Egils Saga 1-15.txt', "r")

translating external files type thing

2021-04-13 Thread Quentin Bock
okay, so I'm making a translating program, and I have files set to be translated (they're in Icelandic) and I want all of them to be read in English but I'm not sure how to open the files and translate them at the same time. I'm also not even sure how to translate an external file to English from

googletrans problems in python

2021-04-13 Thread Quentin Bock
so I've been experiencing problems with googletrans in python and just found a solution that actually works for me. If you have not tried this option and are having problems with googletrans try this method: *This may work for some and not other I'm too sure install googletrans 3.1.0 using pip

googletrans in python

2021-04-12 Thread Quentin Bock
Can someone explain the basics of googletrans in python? I want to make a program that translates stories into English, but I'm not sure how to get a translation printed. Also, is this needed to be done in an HTML file inside python? If so can someone provide basic code for a translation and how

firewall in python

2021-03-28 Thread Quentin Bock
Is it possible to create a firewall inside python and then run that instead of the windows defender firewall? If so how would that work or how would that be made? Thanks :) Virus-free.

thought

2021-03-21 Thread Quentin Bock
Note: Previous comments have been made on this, this is my reply to another response of this question. I would have it so, the "admin" of the program would be able to change if devices are allowed on that network, and would also be able to remove and make certain devices always receive a password

thought

2021-03-21 Thread Quentin Bock
I had a recent thought about someone's wifi/network connection and password. Could it be possible to create a program that will randomize a new password every 24 hours (letters and numbers) and when the program is opened (or notification would be sent) you can see the new password to log into the

file location/directory

2021-03-14 Thread Quentin Bock
how can I change the path that python takes to run certain files, I'm starting to create game and I want those in separate folders, so how can I change it so that python runs the program with the files from that folder?

pygame font issue

2021-03-13 Thread Quentin Bock
Code that contains the problem: score_value = 0 font = pygame.font.SysFont('freesansbold.ttf', 32) error: in font_constructor font = Font(fontpath, size) pygame.error: font not initialized Can someone explain why it's saying font not initialized and provide a solution? I have tried typing in

pygame "font not intialized"

2021-03-12 Thread Quentin Bock
my code is almost identical to this so I hope it's okay that I don't include all of my code error message: font = pygame.font.Font('freesansbold.ttf', 32) pygame.error: font not initialized Tutorial Link: https://www.youtube.com/watch?v=FfWpgLFMI7w Timestamp to this part of the video: 1:55:08 --

"unexpected argument"

2021-03-09 Thread Quentin Bock
Error 1: Space Invaders.py:90: SyntaxWarning: "is" with a literal. Did you mean "=="? if bullet_state is "fire": Error 2: line 66, in if event.key == pygame.K_SPACE: AttributeError: 'Event' object has no attribute 'key' Code: import pygame import random # Space Invaders! background =

pygame errors

2021-03-06 Thread Quentin Bock
#Space Invaders! #Title and Icon pygame.display.set_caption("Space Invaders") icon = pygame.image.load('space-invaders.png') pygame.display.set_icon(icon) #Player player_Image = pygame.image.load('player.png') player_X = 370 player_Y = 480 def player(): screen.blit(player_Image, player_X,

trouble using pygame

2021-03-05 Thread Quentin Bock
So, I recently downloaded the pygame module, this code is from a youtube tutorial by the way, I am following along the tutorial, the error involves the pygame.init() and also says this: import pygame # Initialize Pygame pygame.init() #create the screen screen = pygame.display.set_mode((800,

Problem with printing statement when condition is false

2021-03-04 Thread Quentin Bock
Okay so, this is my biggest project, I'm not advanced in Python in any way so don't expect it to be perfect. I made a trivia game and for the most part, it works but I can't get it to print "Incorrect" and then what the answer was for all but one of my questions and I don't know why. I use PyCharm

How can I make this more complex?

2020-11-09 Thread Quentin Bock
grade = input("Enter your grade: ") if grade >= 90: print("You got an A ") if grade >= 80: print("You got a B ") if grade >= 70: print("You got a C") if grade >= 60: print("You got a D ") if grade >= 50: print("You failed") How can I make this to say if your grade is 90 or

Re: returning totals in functions of math

2020-11-08 Thread Quentin Bock
? On Sun, 8 Nov 2020 at 14:37, <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2020-11-08 at 19:00:34 +, > Peter Pearson wrote: > > > On Sun, 8 Nov 2020 13:50:19 -0500, Quentin Bock > wrote: > > > Errors say that add takes 1 positional argument but 3 were g

answer not correct

2020-11-08 Thread Quentin Bock
*def add(numbers):* * total = 1* * for x in numbers:* * total += 1* * return total* *print(add[1999, -672, 64]))* *the answer I get is 4 but it should be 1,411* -- https://mail.python.org/mailman/listinfo/python-list

returning totals in functions of math

2020-11-08 Thread Quentin Bock
Errors say that add takes 1 positional argument but 3 were given? Does this limit how many numbers I can have or do I need other variables? Here is what I have: def add(numbers): total = 1 for x in numbers: total += x return total print(add(1999, -672, 84)) I have a multiply

Help

2020-11-03 Thread Quentin Bock
So, I'm newer to Python and I'm messing around with math functions and multiplication, etc. here is my line of code: def multiply(numbers): total = 1 for x in numbers: total *= x return total print(multiply((8, 2, 3, -1, 7))) When I run this, my answer