User Profile

Collapse

Profile Sidebar

Collapse
rdrewd
rdrewd
Last Activity: Apr 27 '12, 09:43 PM
Joined: Sep 12 '07
Location: Westbury, NY
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • rdrewd
    replied to how to convert a string to binary ?
    ord('h') gives you the integer value of the ASCII code for 'h'. (Longer story and potentially much bigger integer values for a unicode character). bin(i) will convert an integer to a bitstring.

    >>> bin(ord('h'))
    '0b1101000'

    Note that there's a 0b prefix to mark the bit string as a bit string and that leading 0 bits are suppressed.
    >>> print len(bin(ord('h' )))
    9

    ...
    See more | Go to post
    Last edited by rdrewd; Apr 27 '12, 09:43 PM. Reason: Add link to function documentation.

    Leave a comment:


  • Assuming you are using matplotlib to produce your graphs, see the 3rd example on

    http://matplotlib.sourceforge.net/us..._tutorial.html

    - The example with 3 sets of data on one graph (red dashes, blue squares and green triangles).

    pyplot does accept multiple lists of y values as a single argument, but you'd need to test it to see how that works out. Given your situation, I think you should stick to the...
    See more | Go to post
    Last edited by rdrewd; Apr 26 '12, 07:49 AM. Reason: Fix typo.

    Leave a comment:

No activity results to display
Show More
Working...