[Tutor] Convert string to bytes

2014-12-31 Thread shweta kaushik
Hi all, I need help on this problem. I have one message packet in form of string s = '0xFE, 0x01, 0x01, 0x22, 0xFE, 0x02'. I have to send this data to MSP430 microcontroller, but it is not taking data if it is string. If I am passing this as hardcoded value s1 = 0xFE, 0x01, 0x01, 0x22, 0xFE, 0x02

[Tutor] Help on Python drop-down list options

2014-12-31 Thread Tammy Miller
Hello All, I need help on the following: I have a created a project from a csv file to calculate the mean and standard deviation. However, I would like to create a drop-down list and display the mean and standard deviation? Is there a module for that? Thank you, Tammy

Re: [Tutor] Help on Python drop-down list options

2014-12-31 Thread WolfRage
What is the user interface that your program is using, currently? IE: QT, GTK, Tkinter, Curses, Kivy, Pygame, Or None? What is the target system on which your program runs? How are you currently viewing the mean and standard deviation results? What version of Python are you using and what is your

Re: [Tutor] Convert string to bytes

2014-12-31 Thread WolfRage
I wrote a program to help me break out hex strings awhile ago. It was written to communicate with a Atmega 168. This is written for Python 3. Here is a snippet, see if this helps you. s4 = "28 40 7A 7C 05 00 00 34" hex_array = bytearray.fromhex(s4) print(s4) print(list(hex_array)) print(hex_arr

Re: [Tutor] Help on Python drop-down list options

2014-12-31 Thread Alan Gauld
On 31/12/14 13:49, Tammy Miller wrote: I need help on the following: I have a created a project from a csv file to calculate the mean and standard deviation. I assume that means you read the data from the CSV file and display the stats? However, I would like to create a drop-down list and d

Re: [Tutor] Convert string to bytes

2014-12-31 Thread Alan Gauld
On 31/12/14 10:08, shweta kaushik wrote: I have one message packet in form of string s = '0xFE, 0x01, 0x01, 0x22, 0xFE, 0x02'. I have to send this data to MSP430 microcontroller, but it is not taking data if it is string. If I am passing this as hardcoded value s1 = 0xFE, 0x01, 0x01, 0x22, 0xFE,

Re: [Tutor] Convert string to bytes

2014-12-31 Thread Alan Gauld
On 31/12/14 18:03, shweta kaushik wrote: I also did the same thing and its working... but i dint use this. I just did this and it is similar to what you said. >>> s = '0xFE, 0x01, 0x01, 0x22, 0xFE, 0x02' >>> packet = eval(s) (254, 1, 1, 34, 254, 2) >>> this is tuple, which my microcontroller is

Re: [Tutor] Convert string to bytes

2014-12-31 Thread shweta kaushik
Hi Alan, Thank you.. I also did the same thing and its working... but i dint use this. I just did this and it is similar to what you said. >>> s = '0xFE, 0x01, 0x01, 0x22, 0xFE, 0x02' >>> packet = eval(s) (254, 1, 1, 34, 254, 2) >>> this is tuple, which my microcontroller is able to recognize an

Re: [Tutor] Making Doubly Linked List with Less Lines of Code.

2014-12-31 Thread Steven D'Aprano
On Tue, Dec 30, 2014 at 05:40:04PM -0500, wolfrage8...@gmail.com wrote: > On Tue, Dec 30, 2014 at 2:37 PM, Danny Yoo wrote: > > If that's the case, then none of this requires linked list storage. > > > > Instead, we can represent this as a list of rows. Each row element > > would be itself a list

Re: [Tutor] Making Doubly Linked List with Less Lines of Code.

2014-12-31 Thread Steven D'Aprano
On Tue, Dec 30, 2014 at 09:41:33PM -0800, Alex Kleider wrote: > In the process of doing so I discovered that list multiplication does > not at all behave the way I expected (as demonstrated by the > 'bad_flip_2_D' function.) Well, don't keep us in suspense. How did you expect it to behave, and