Creating a login page when passing json values showing me error class NoneType

0 votes
creating python login page showing me error, need how to pass JSON format in python input???when I pass JSON format it shows

error  <class 'NoneType'>
Nov 17, 2020 in Python by rehan
• 160 points
1,256 views

Hello @

Refer this:http://net-informations.com/python/err/nonetype.htm     if it not resolve your error can you please share your snippet so that we can help you out?

#appriciate your helping

email = input("enter your email ")

password = input("enter your password ")

print(email)

print(password)

def login(email, password):

    mycursor = mydb.cursor()

    query = " select * from users where email=%s AND password=%s"

    mycursor.execute(query,(email,password))

    cur = mycursor.fetchone()

    #  users = cursor.fetchall()

    print(type(cur))

    if cur is None:

        print("User not found, Register First")

else:

  print(cur)

login(email,password)

      

     Input which I am giving -

email "xyz@gmail.com"

password"12345"

how I'll resolve this and I am fetching my data from my db and I fetch data dynamically

Hey, @Rehan,

Could you please check on one thing on which line you are facing the particular error? Meanwhile executing your code snippet, on which line the error is comming up?

1 answer to this question.

0 votes
#appriciate your helping

email = input("enter your email ")

password = input("enter your password ")

print(email)

print(password)

def login(email, password):

    mycursor = mydb.cursor()

    query = " select * from users where email=%s AND password=%s"

    mycursor.execute(query,(email,password))

    cur = mycursor.fetchone()

    #  users = cursor.fetchall()

    print(type(cur))

    if cur is None:

        print("User not found, Register First")

else:

  print(cur)

login(email,password)

       

     Input which I am giving -

email "xyz@gmail.com"

password"12345"

how I'll resolve this and I am fetching my data from my db and I fetch data dynamically
answered Nov 17, 2020 by rehan
• 160 points

Hi, @Rehan.

Are you facing the error as "TypeError: 'NoneType' object is not subscriptable" ?

Related Questions In Python

0 votes
1 answer

How to Parse values from a JSON file?

import json from pprint import pprint with open('data.json') as ...READ MORE

answered Oct 15, 2018 in Python by Priyaj
• 58,060 points
1,978 views
0 votes
1 answer

Why am I getting a error when I am printing two different data types in python?

different data type is being used. that ...READ MORE

answered Mar 6, 2019 in Python by Mohammad
• 3,230 points
1,023 views
0 votes
1 answer
0 votes
1 answer

How to run code when a class is subclassed?

Classes (by default) are instances of the ...READ MORE

answered Nov 20, 2020 in Python by Gitika
• 65,850 points
520 views
+2 votes
4 answers

How can I replace values with 'none' in a dataframe using pandas

Actually in later versions of pandas this ...READ MORE

answered Aug 13, 2018 in Python by bug_seeker
• 15,520 points
122,211 views
0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

answered Apr 17, 2018 in Python by anonymous
3,441 views
0 votes
2 answers

Extracting data from a JSON file in Python

Here is what i found and was ...READ MORE

answered Nov 27, 2018 in Python by Rupali
29,682 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP