Hello,
How do I convert a string like 'A' to its ASCII value(s) ?
Greets,
Benjamin 3 47789
Benjamin Hepp wrote: Hello,
How do I convert a string like 'A' to its ASCII value(s) ?
Greets, Benjamin
ord('A')
hth,
anton.
Benjamin Hepp wrote: Hello,
How do I convert a string like 'A' to its ASCII value(s) ?
The struct module is nifty, and most likely faster than ord()
#########
from struct import unpack
def toBytes(value):
"Turns a string into a list of byte values"
return unpack('%sB' % len(value), value)
print toBytes('ABCDEF G')
regards Max M This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Neil W. |
last post by:
I'm coming back to Perl after a long absence. I am trying to add up the
ascii values of the characters in a string. Can anyone refresh my memory?
Thanks.
|
by: Drew |
last post by:
I need to display the ASCII numeric values of each letter in a string.
I think strings are stored in unicode in C# (?)
I can convert the string to a char array but how do I get the ascii values
of each character?
Thanks,
Drew
|
by: Kermit Piper |
last post by:
Hello,
I have a function that lets me convert one character and throw an alert
with the corresponding ASCII value, but what I am having trouble with
is applying it to a text box. What I'm trying to do is when characters
are entered the function will loop through the entered values and throw
an alert for each of the corresponding ASCII values for each of the
characters entered. I am trying to alert the user for every character
that is...
|
by: Kermit Piper |
last post by:
Hello,
OK, almost there. Here's what I have so far, which handles characters
as they're typed in. Could someone please show me how I would loop
through all the values that are entered if a block of text was pasted
in, and then grab the ascii value(s) that are > 128?:
<script type="text/javascript">
function toASCII(s)
{
|
by: Jeffrey Spoon |
last post by:
Hello, I'm a bit stuck trying to convert a text file which contains
extended ASCII text and changing the ASCII values so they become
readable. I do this by subtracting 127 from the ASCII value. However, at
the moment I am just getting more gibberish so I'm probably doing
something wrong. I tried using ASCII Encoding before to get the ASCII
values. Although this worked for 0-127 ASCII values, extended ASCII gave
strange values (such as 1992...
| |
by: adnanahmed714 |
last post by:
hi all
i have a string
<cr><lf>999,1.52,32.85,5.91,15.81,1.39,26.17,15.75,12.3
want to calculate its ASCII values sum which is equal to 2411.How can i calculate ascii sum of all the string values.
thanks in advance
|
by: nmsreddi |
last post by:
Hi friends
I am working on serialport in c# ,i am using C#2005 i have successfully done the serial communication with GSM modem and able to send and receive data ,
the main problem ,the serial port class in C# is accepting only ASCII values upto 127 only, the values those greater than 127 ,is automatically converted to value 63(?) ,ihave searched alot in the net and finally found from MSDN that ,serialport class accepts only ASCII values...
|
by: manontheedge |
last post by:
I want to read in an image file ( bmp, jpeg, ... ) so I can retain it's ascii / binary values, and alter the image. How can I do this in C++ ( I'm using Visual Studio, various versions ).
so basically, I want to make a big matrix of values in an array.
I know this can be done using a hex editor, but in C++ I'm not sure how to get the ascii values. Any help is appreciated.
|
by: squrel |
last post by:
Hello All,
I have a table in my database with a field itemqty and the type was int and need to change it to decimal as i need the decimal point in my textbox.. i have a code for integer ascii values as bellow
i want to change this code and whtever i m doing my values is coming wrong coz i want both integer as well as decimal point ascii values.
can anyone help me in my code.
thank u in advance
Private Sub...
|
by: siddhanta |
last post by:
hi,
i read the ascii value from a file and wrote the decimal one in other file.
But values above "127" i.e. extended ascii are printed as" 65533."
here ais wat i did:
private void button1_Click(object sender, EventArgs e)
{
int b = new int;
StreamReader sw = new StreamReader("c: \\28D.09N");
for (int i = 0; i < 5000; i++)
{
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |