LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-21-2009, 03:04 PM   #1
hocheetiong
Member
 
Registered: Jul 2007
Location: Penang , Malaysia.
Distribution: red hat linux
Posts: 129

Rep: Reputation: 15
Smile python syntax: how to send chracter to buffer?


i want to send a chracter(not in Hexadecimal Format) to buffer via Python script, what is correct syntax?

1. example for send character "B" to buffer 1000bytes: (This is using Hexadecimal format)

buffer = '\x42' * 1000

**So if i want to send a character "Thisisacomputer" to buffer but not in Hexadecimal format, what is the correct syntax?

Thank you. :-)
 
Old 11-23-2009, 08:40 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 1,421

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
When you say "send" do you mean assign the value to the buffer?
Quote:
**So if i want to send a character "Thisisacomputer" to buffer but not in Hexadecimal format, what is the correct syntax?
Code:
buffer = "Thisisacomputer"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[python] syntax Error : invalid syntax Python_user Programming 2 09-06-2009 12:52 PM
send failed: No buffer space available 0perand Linux - Wireless Networking 1 11-17-2007 05:26 PM
Increasing send buffer with sysctl bpottle Linux - General 1 07-05-2006 01:45 PM
Send data to the keyboard buffer rrodrigues Programming 5 07-20-2004 09:26 AM
Send Receive Buffer in Linux? defa0009 Linux - General 6 06-21-2003 04:14 PM


All times are GMT -5. The time now is 10:48 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration