Skip to content

extracting info from a text file in python

I am making a system in which when a user plays my game, it compares their score to what they have scored before by using a username and password. the info is stored in text file in the format: score*username*password. I am trying to get those into different variables so that I can check them against other va…

How does the ‘with’ statement work in kivy?

I have been playing with kivy, and I saw this: I don’t quite understand how it works. I was expecting to see something like: What am I missing? Answer with some_canvas sets an internal Kivy variable to that canvas. When canvas instructions are created they check if that variable is set to a canvas, and …

How can I translate SQL query to to django ORM

I’m working on making some data consults in Django but I don’t understand quite well its ORM system yet. I need to get the transactions’ quantity for a particularly transaction’s projections. To put it briefly, I want to translate this SQL query to Python/Django syntax: These are the m…

Joining two dataframes on columns they match

I have two dataframes. df1 has more elements (3) in column ‘Table_name’ than df2 (2). I want a resultant dataframe that only outputs the rows where df1 and df2 share the same column names. df1 df2 I want this to be the result. df_result This is what i tried but it doesn’t work: Answer You ne…

Load and Save Dictionary and Class Instances Python Script

Writing a python script that prompts the user by asking if they are are new or an existing user. If new, they will create a username, password, age. A User class instance should be created with that information along with adding the new username and password to the security dictionary. Once registered, or an …