Newbie: Check first two non-whitespace characters

2015-12-31 Thread otaksoftspamtrap
I need to check a string over which I have no control for the first 2 non-white space characters (which should be '[{'). The string would ideally be: '[{...' but could also be something like ' [ { '. Best to use re and how? Something else? -- https://mail.python.org/mailman/listinfo/pyt

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread otaksoftspamtrap
Thanks much - both solutions work well for me On Wednesday, December 30, 2015 at 2:57:50 PM UTC-8, Ben Finney wrote: > kierkega...@gmail.com writes: > > > How do I get from here > > > > t = ('1024', '1280') > > > > to > > > > t = (1024, 1280) > > Both of those are assignment statements, so I

Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread otaksoftspamtrap
How do I get from here t = ('1024', '1280') to t = (1024, 1280) Thanks for all help! -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie looking for elegant solution

2015-03-24 Thread otaksoftspamtrap
On Tuesday, March 24, 2015 at 8:29:24 PM UTC-7, Chris Angelico wrote: > On Wed, Mar 25, 2015 at 2:13 PM, wrote: > > I have a list containing 9600 integer elements - each integer is either 0 > > or 1. > > > > Starting at the front of the list, I need to combine 8 list elements into 1 > > by trea

Newbie looking for elegant solution

2015-03-24 Thread otaksoftspamtrap
I have a list containing 9600 integer elements - each integer is either 0 or 1. Starting at the front of the list, I need to combine 8 list elements into 1 by treating them as if they were bits of one byte with 1 and 0 denoting bit on/off (the 8th element would be the rightmost bit of the first