Why this fails??

2012-02-29 Thread Smiley 4321
Why below fails - #!/usr/bin/python import pickle class MyClass(object): Field1 = None Field2 = None def __init__(self, dictionary): self.__dict__.update(dictionary) my_List = {'Field1': 'Apple', 'Field2': 'Orange'} myInst = MyClass(my_List) with open('/t

Pickle handling dictionary

2012-02-28 Thread Smiley 4321
I was successful in testing pickle with multiple objects both READ & WRITE. I did WRITE as - --- #!/usr/bin/python import pickle class apple_Class(object): def __init__(self, **kwds): self.__dict__.update(kwds) myInst = apple_Class() myInst.FirstString = "Apple" myInst.SecondString =

GUI for pickle read

2012-02-28 Thread Smiley 4321
Can I have some thoughts about - building a GUI to display the results of the pickle read? A prototype code should be fine on Linux. ~ BR -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle performing class instantiation ??

2012-02-28 Thread Smiley 4321
#x27; is not defined -- On Tue, Feb 28, 2012 at 8:44 PM, Smiley 4321 wrote: > I am looking for pickle performing class instantiation, something as > prototype like - > > - Have a class > - Instantiate the class with 3 parameters > - pickle the class instance > - genera

Pickle performing class instantiation ??

2012-02-28 Thread Smiley 4321
I am looking for pickle performing class instantiation, something as prototype like - - Have a class - Instantiate the class with 3 parameters - pickle the class instance - generate a bytestream (.pkl) using pickle.dump -- http://mail.python.org/mailman/listinfo/python-list

pickling to an output file.

2012-02-28 Thread Smiley 4321
I have created a bytestream (readfile.pkl) from pickle.dump() already in different folder (say /tmp) succesfully. Now I wish to open the file, read it and finally write the output to a file to "output.txt". To read the file bytestream file (readfile.pkl) I did perform as -- --- import pickle def

Re: storing in list and retrieving.

2012-02-24 Thread Smiley 4321
Thanks. It was very simple with using 'pickle'. Thanks. -- On Thu, Feb 23, 2012 at 4:01 PM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Smiley 4321 wrote: > >> It requires concepts of 'python persistence' for the code to be designed . &

Re: storing in list and retrieving.

2012-02-23 Thread Smiley 4321
It requires concepts of 'python persistence' for the code to be designed . Else it simple. Looking for some flow?? On Thu, Feb 23, 2012 at 12:01 PM, Chris Angelico wrote: > On Thu, Feb 23, 2012 at 5:24 PM, Smiley 4321 wrote: > > I need to write two file using pyt

storing in list and retrieving.

2012-02-22 Thread Smiley 4321
I need to write two file using python script as below - 1. Store.py: Write a script to store a list say "store_list = ["Apple", "Orange", "PineApple". “and so on” ]" to disk. 2. Retrieve.py: Read the object stored in the ‘Store.py’ file and print the contents of this list. I have to run on L

Reading sub-string from a file

2012-02-16 Thread Smiley 4321
All, I am a python newbie. Let's say I have a filename (test.conf) as below - int Apple(int, int); void Jump_OnUnload(float, int); int Jockey_Apple_cat_1KK(float, int, char, int); int Jockey_Apple_cat_look(int, float, int, int); int Jockey_Apple_cat_test_ki21es(int, int, int, int); int Jock