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

  • SEARCH
  • Home
  • 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 8390681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:03:50+00:00 2026-06-09T19:03:50+00:00

In Scapy, I took the first 28 Bytes of a few packets and saved

  • 0

In Scapy, I took the first 28 Bytes of a few packets and saved each as a hexadecimal string. Whenever I want to print those strings all together (they are saved in a list), the following happens:

>>> print myStrings[0]
['E\x00\x00W\x00\x00@\x00\x01\x11\xe7-\x8a`t\x86\xd5\x92\xbd\xef0\x1a\xa4\xe8\x00C\xe2k', ['E\x00\x00W\x00\x00@\x00\x01\x11\xe7-\x8a`t\x86\xd5\x92\xbd\xef0\x1a\xa4\xe8\x00C\xe2k']]

But if I want to print each string separately:

>>> for p in tmpStrAns:
...     print p[0]
... 
EW@�-�`t�Ւ��0��C�k
E8@�L�`t�Ւ��0��$�L
E8@�L�`t�Ւ��0��$�L

(MyStrings is a list of lists: [[string1, [string2,string3,...], ...] )

What’s happening here?

  • 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-09T19:03:52+00:00Added an answer on June 9, 2026 at 7:03 pm

    When printing a list, Python calls list.__str__, which calls repr on each of its items.

    When printing a string, Python outputs the string directly.

    >>> print "\x11"
    �
    >>> print ["\x11"]
    ['\x11']
    >>> print repr("\x11")
    '\x11'
    

    The repr method on strings converts non-printable characters to their hexadecimal representation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Scapy, I want to manually match packets with their corresponding ICMP time-exceeded messages.
I would like to parse the first two bytes of a packets payload using
I'm programming an application in Python/Scapy that behaves like wireless 802.1X supplicant. I want
I want to put an instance of scapy.layers.dhcp.BOOTP on a multiprocessing.Queue . Every time
I'm using scapy, and I want to create a packet and calculate its' checksum
In Scapy (which uses tcpdump to capture packets), I'm extracting timestamps from a data
I'm using Scapy to replay some dumped packets in which I change the TTL
I'm trying to get RSSI or signal strength from WiFi packets. I want also
I am working on integrating scapy with twisted, but I ran into this very
Well, I know its possible, using external libraries and modules such as scapy. 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.