Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 707259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:15:27+00:00 2026-05-14T04:15:27+00:00

I was given this Python code that would calculate an MD5 value for any

  • 0

I was given this Python code that would calculate an MD5 value for any phrase:

import md5
md5.new("Nobody inspects the spammish repetition").digest()

(The phrase here is: “Nobody inspects the spammish repetition”)

What I want to do is display this value in my browser. How do I do it in Python?

I tried all these variants, none of them worked:

import md5
show = md5.new("Nobody inspects the spammish repetition").digest()
print show

import md5
print md5.new("Nobody inspects the spammish repetition").digest()

import md5
md5.new("Nobody inspects the spammish repetition").digest()
print md5

import md5
md5.new("Nobody inspects the spammish repetition").digest()
print md5.new

update A:

By now (Monday, 5 April 2010, 07:19:35 GMT) I have received two answers from Ignacio Vazquez-Abrams and from Ji. Both have suggested pretty much the same thing. I have tried Ji’s code, but it didn’t work. Here is the screen shot of the error lines I received:
alt text
(source: narod.ru)

(I believe you need to right click on the image and choose “View the Image” to see it in a bigger size)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:15:28+00:00Added an answer on May 14, 2026 at 4:15 am

    In order to display the hexdigest in your browser you need to have some sort of web framework (in this case in python) that handles all the web serving for you.

    Here’s an example using web.py (I’ve copied the default example and adjusted for the md5). But you can use any other framework out there

    import web
    from md5 import md5
    
    urls = (
        '/(.*)', 'digest' 
    )
    
    app = web.application(urls, globals())
    
    class digest:        
        def GET(self):
            return md5("Nobody inspects the spammish repetition").hexdigest()
    
    if __name__ == "__main__":
        app.run()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this code: List<Integer> ints = new ArrayList<Integer>(); // Type mismatch: // cannot convert
Question: Given a list of integers, write python code to create a new list
[ Excluding any test code that just mocks a builtin ] Given that many
How do I get a tuple/list element given a condition in python? This occurs
Given this JavaScript code (which is just a comment referring to a url): //
Given a mean and standard-deviation defining a normal distribution , how would you calculate
I'd like to create a Python class decorator (*) that would be able to
Given a two-dimensional list, I would like to find everything that contains a sublist.
I have been given a file that I would like to extract the useful
I am trying to create this app on the iphone that given 6 letters,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.