Help: C char bits operations to python converting

gangli at msn.com gangli at msn.com
Wed Sep 27 00:01:05 CEST 2000


How could I convert following C statments to Python?
   char tmp_ch, tmp_ch0, tmp_ch1;
   tmp_ch = 'K' - 'A';          /* -> 10 */
   tmp_ch0 = ('N' - 'A') << 4;  /* -> -48 */
   tmp_ch1 = tmp_ch+ tmp_ch0;   /* -> -38 */
   tmp_ch = ~tmp_ch1;           /* -> -37 */
   tmp_ch = tmp_ch^2;           /* -> -39 */


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list