WEB-NES-BAY

Learn Tips and tricks on Linux, Hacking, linux, PHP, Perl, Web, Hardware

bookmark bookmark
Posted by WEBNESBAY 6 COMMENTS

This quick tutorial will show you how to develop your own functional IM bot that works with Google Talk, Yahoo! Messenger, Windows Live and all other popular instant messaging clients. To get started, all you need to know are some very basic programming skills (any language would do) and web space to host your “bot”. I have created this using PHP. Using this  I can creat a dummy bot called “mynewbot” that listens to your IM messages. To see this [...]

Categories: Hacking, PHP
Posted by WEBNESBAY 1 COMMENT

The two data types, str and bytes, are mutually exclusive. One cannot legally combine them into one call. With the distinction between text and data, therefore, comes the need to convert between them.
>>> z = b”Hello World!”
>>> y = “Hello World!”
>>> type(z)
<class ‘bytes’>
>>> type(y)
<class ’str’>
To convert from str to bytes, use str.encode().
>>> b = str.encode(y)
>>> type(b) <class ‘bytes’> >>> b b’Hello World!’
To convert from bytes to str, use bytes.decode().
>>> a = bytes.decode(z)
>>> type(a)
<class ’str’>
>>> a
‘Hello World!’
For [...]

Categories: Python