ValueError: insecure pickle string

2011-03-28 Thread pradeepbpin
I am encountering 'Value Error: insecure string pickle' when trying to
execute the script on Ubuntu. The same script and the pickled file
works without any problem in Windows. For working in Ubuntu I just
copied both the script file and pickled file from Windows.


How can I get out of this error? Rather, I would like to have common
script and pickled file that can work platform independently.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ValueError: insecure pickle string

2011-03-28 Thread pradeepbpin


> For new data: an alternative is to open the file in binary mode for both
> reading and writing on all platforms. This will also allow you to switch to
> the more efficient binary pickle protocols.

Writing and reading the pickled file in binary mode seems to be
working. Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Help with pygtk About Dialog

2011-04-12 Thread pradeepbpin
How can I use a png/jpeg/gif  image file to set the logo in
gtk.AboutDiaog box of pyGTK ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Return Values & lambda

2011-02-21 Thread pradeepbpin
I have a main program module that invokes an input dialog box via  a
menu item. Now, the code for drawing and processing the input of
dialog box is in another module, say 'dialogs.py'. I connect the menu
item to this dialog box by a statement like,

manu_item.connect('activate', lambda a: dialogs.open_dilaog())

If this function open_dialog() returns a list of dialog inputs values,
how can I access those values in the main module ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Return Values & lambda

2011-02-21 Thread pradeepbpin
On Feb 22, 5:59 am, Steven D'Aprano  wrote:
> On Mon, 21 Feb 2011 16:43:49 -0800, Rafe Kettler wrote:
> > On Feb 21, 1:59 pm, pradeepbpin  wrote:
> >> I have a main program module that invokes an input dialog box via  a
> >> menu item. Now, the code for drawing and processing the input of dialog
> >> box is in another module, say 'dialogs.py'. I connect the menu item to
> >> this dialog box by a statement like,
>
> >> manu_item.connect('activate', lambda a: dialogs.open_dilaog())
>
> >> If this function open_dialog() returns a list of dialog inputs values,
> >> how can I access those values in the main module ?
>
> > Moreover, I don't see why you need a lambda in this case. Why not just
> > pass the function itself?
>
> My guess is that the callback function is passed a single argument, and
> open_dialog doesn't take any arguments, hence the wrapper which just
> ignores the argument and calls the function.
>
> --
> Steven


Thanks to all.

Pradeep
-- 
http://mail.python.org/mailman/listinfo/python-list


Hashbang error

2010-06-01 Thread pradeepbpin
I use gVim as an editor to create python scripts on a windows machine.
To run the same script on my ubuntu machine, I added a hashbang line
to the script. Now when I run this script from command line of ubuntu,
I get a bad interpreter error, like below

/usr/bin/python^M: bad interpreter: No such file or directory

This, I understand, is due to the interpretation of newline character
at the end of the hashbang.

I have checked and found out that this does not happen if I create the
script in Ubuntu with gVim.

Now, how can I avoid this error when I create the script on a windows
machine?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to read source code of python?

2010-06-10 Thread pradeepbpin
On Jun 10, 1:15 pm, News123  wrote:
> Leon wrote:
> > Hi, there,
> > I'm trying to read the source code of python.dd
> > I read around, and am kind of lost, so where to start?
>
> > Any comments are welcomed, thanks in advance.
>
> I use my favourite text editor with syntax highlighting.
>
> Next to it I use a web browser with pydoc and google.
>
> If uou're looking for an IDE that will help you a little more navigating
> in python code, then you could look at
>
> Eclipse
> or
> Netbeans
> both support python
>
> both are rather heavy weapons though.


In my opinion, pydoc would be a good choice. I am a fan of it.
-- 
http://mail.python.org/mailman/listinfo/python-list