Skip to content
Advertisement

Securely Erasing Password in Memory (Python)

How do you store a password entered by the user in memory and erase it securely after it is no longer need? To elaborate, currently we have the following code: After calling the login method, what do we need to do to fill the area of memory that contains password with garbled characters so that someone cannot recover the password

Find Hyperlinks in Text using Python (twitter related)

How can I parse text and find all instances of hyperlinks with a string? The hyperlink will not be in the html format of <a href=”http://test.com”>test</a> but just http://test.com Secondly, I would like to then convert the original string and replace all instances of hyperlinks into clickable html hyperlinks. I found an example in this thread: Easiest way to convert

Python and MySQL: is there an alternative to MySQLdb?

Is there a module written purely in Python that will allow a script to communicate with a MySQL database? I’ve already tried MySQLdb without success. It requires too much: GCC, zlib, and openssl. I do not have access to these tools; even if I did, I don’t want to waste time getting them to work together. I’m looking for tools

Django form – set label

I have a form that inherits from 2 other forms. In my form, I want to change the label of a field that was defined in one of the parent forms. Does anyone know how this can be done? I’m trying to do it in my __init__, but it throws an error saying that “‘RegistrationFormTOS’ object has no attribute ’email'”.

How to remove the left part of a string?

I have some simple python code that searches files for a string e.g. path=c:path, where the c:path part may vary. The current code is: What is a simple way to get the text after Path=? Answer Starting in Python 3.9, you can use removeprefix:

Advertisement