473,396 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with Python String

2
Hi,

how to convert this string:
'\\x02\\x06\\x0b\\x01$\\x00'
to this string:
'\x07\xd8\x02\x06\x0b\x01$\x00'
?

Thanks !

Dazdh
Feb 25 '08 #1
2 1351
dshimer
136 Expert 100+
Nothing original here, and you may have found it, but a search revealed the following
Expand|Select|Wrap|Line Numbers
  1. >>> s='\\x02\\x06\\x0b\\x01$\\x00'
  2. >>> eval("'%s'" % s)
  3. '\x02\x06\x0b\x01$\x00'
  4. >>> new=eval("'%s'" % s)
  5. >>> new
  6. '\x02\x06\x0b\x01$\x00'
at the following
http://mail.python.org/pipermail/pyt...ly/268855.html

Hi,

how to convert this string:
'\\x02\\x06\\x0b\\x01$\\x00'
to this string:
'\x07\xd8\x02\x06\x0b\x01$\x00'
?

Thanks !

Dazdh
Feb 25 '08 #2
dazdh
2
Thanks you very much. It works well.
Feb 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Rami A. Kishek | last post by:
Please help! Very strange installation problem. First, let me say I successfully installed and use Python 2.2.3 and 2.3 from the EXE binaries on a win ME machine. That machine previously had...
2
by: Read Roberts | last post by:
I have the current Windows binary install of Python 2.3.4 on my Windows XP system. I am pained to discover that tkFileDialog.askdirectory() returns a mangled path when a directory is selected...
2
by: Xah Lee | last post by:
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
14
by: Dennis Benzinger | last post by:
Hi! The following program in an UTF-8 encoded file: # -*- coding: UTF-8 -*- FIELDS = ("Fächer", ) FROZEN_FIELDS = frozenset(FIELDS) FIELDS_SET = set(FIELDS)
78
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only...
4
by: Petr Jakes | last post by:
Hi, I am using Python 2.4.3 on Fedora Core4 and "Eric3" Python IDE .. Below mentioned code works fine in the Eric3 environment. While trying to start it from the command line, it returns: ...
1
by: Benke | last post by:
Hello, I'm quite new to Python and embedding python in c++. I'm trying to write a function that i can use to call a python function. It should take 3 arguments, the name of the python file, the...
3
by: Marc 'BlackJack' Rintsch | last post by:
On Thu, 28 Aug 2008 09:13:00 -0700, SUBHABRATA wrote: a1, a2, a2, …, a20? You must be kidding. Please stop numbering names and use *meaningful* names instead! Could you describe them...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.