is there any class to handle a SESSION (like php) in Python? not in django, but I want to use it with PyQt
thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The short answer is that there is no
$SESSIONvariable in Python.Python tends not to put things in global scope like PHP. Therefore, if you are accessing a user’s session id, it will probably be accessed via dot notation
module_name.ClassName.session. If you would like to create a PyQt app that acts as a webserver, you could probably adapt a web framework’s implementation.Others’ responses to similar queries suggest implementing sessions via a simple database[1]. You could try assigning unique ids with
uuid, and storing them with tools likesqlite3orpickle.[1] http://ubuntuforums.org/showthread.php?t=859645