Relative Content

Tag Archive for pythonpycharm

Question about the organization of the project in pycharm

I am making a project that contains 4 files of the py extension. in the main file, I import other files. there is a graphic in the emoyshen file. screen. when I run the main file, the emoyshen file is triggered first, and then another imported part of the code. what should I do to make the graphical window work simultaneously with the entire code, and not in front of it?

Trying to get my code to read a text file for existing users

I am relatively new to coding and I am creating a simple login system for an assignment. I have created code so far that is able to register new users and save that data to the text file, but I am having a huge mind blank on what to do to get it to register existing users. So for example, when the user goes to register, if the username already exists it stops them from proceeding; as well as when they go to login, it recognises them in the system. Not sure if I am over thinkiung things but if someone could point me in the right direction I would very much appreciate it!!! Thank you!

Looking to condense python code for a math game (Very new to python)

import random correct_g = 0 incorrect_g = 0 while True: user_input = input(‘Would you like to add, sub, multi? type “end” to end the game : ‘).lower() if user_input == ‘add’: number1: int = random.randrange(1, 100) number2: int = random.randrange(1, 100) add_answer = number1 + number2 print(number1, ‘ + ‘, number2) add_question = input(‘What is […]

How to Integrate Weighted Calculations for Grading

I would like calculate the final exam grade that a student may need to get their desired overall class score., given three inputs: the overall grade that they would have in the course IF they skipped the final and took the 0 (skipped_final), the final exam weight (final_weight), and the desired score that the student wants overall in the course. required_score is the final exam score I want to return. I included a test case below which says the student would need a 160% on the final to get a 90% overall, when they would actually only need an 87% on the final for this. Does anyone see an issue with my function?

Invalid Pycharm Interpreter after changing directory for project

I changed the directory of a project in PyCharm then deleted and configured a new local python interpreter even after the new interpreter was configured PyCharm still gives me a Invalid Local Interpreter error.
(By directory change I mean I moved my project into a new folder made inside the same parent folder the project already was.)