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 8535117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:21:29+00:00 2026-06-11T10:21:29+00:00

I want a normal format for the MAC-Address I got from get_node(). The format

  • 0

I want a normal format for the MAC-Address I got from get_node().

The format I get is 0x0L0xdL0x60L0x76L0x31L0xd6L, I want the 0x deleted and the L-term to a real hex number. It should be 00-0D-60-76-31-D6 .

How can I realize this?

def getNetworkData (self):
    myHostname, myIP, myMAC =  AU.getHostname()

    touple1 = (myMAC & 0xFF0000000000) >> 40
    touple2 = (myMAC & 0x00FF00000000) >> 32
    touple3 = (myMAC & 0x0000FF000000) >> 24
    touple4 = (myMAC & 0x000000FF0000) >> 16
    touple5 = (myMAC & 0x00000000FF00) >> 8
    touple6 = (myMAC & 0x0000000000FF) >> 0

    readableMACadress = hex(touple1) + hex(touple2) + hex(touple3) + hex(touple4) + hex(touple5) + hex(touple6) 

    print readableMACadress

    return myHostname, myIP, readableMACadress
  • 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-06-11T10:21:31+00:00Added an answer on June 11, 2026 at 10:21 am

    Use

    readableMACaddress = '%02X-%02X-%02X-%02X-%02X-%02X' % (touple1, touple2, touple3, touple4, touple5, touple6)
    

    More concisely, you can eliminate the temporary touple variables by using

    readableMACaddress = '-'.join('%02X' % ((myMAC >> 8*i) & 0xff) for i in reversed(xrange(6)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to retrieve data from stored procedure in table format like normal sql
I want to automatically format an XML schema definition file. All the normal pretty-print
Hi I want to convert normal image into mirror i.e flop effect in BLACKBERRY
Given the following sequence: normal %(b)BOLD% normal I want to transform this into the
I have a Blackberry project in which I want to change normal image to
I want my activity (a normal activity with a digital clock at the center
I have normal sqlite database and want to use fts3. As mentioned in http://www.sqlite.org/fts3.html
I want to position an element in normal css relative to the element before
I want to set the thumb image of a slider for a normal state,
I want to have a delete user link in a normal Activerecord table, but

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.