Re: missing pydoc gui

2007-12-26 Thread TommW
JimG wrote:
> On Dec 26, 1:56 pm, Bernard Delmée <[EMAIL PROTECTED]>
> wrote:
>> (I know replying to self is a sure sign of aging :-)
>> A quick update: after installing the 'tkinter' fedora
>> package (still in live-cd mode), the following 3 lines
>> script does what "pydoc -g " should:
>>
>>  import Tkinter
>>  import pydoc
>>  pydoc.gui()
>>
>> HTH,
>>
>> Bernard.
> 
> Brilliant!  That's an easy solution to my problem.  I'll try posting
> to one of the Fedora forums to see if anyone there knows why.  I
> appreciate your help with this.  I love Linux but every now and then
> you run into one of its annoying little oddities


Jim:

I have a copy of Fedora 8 in a VMachine.  I found that I could get the 
Pydoc Server to start by doing the following.  I also found that I had 
to install tkinter first.  I then modified a copy of "pydoc" in usr/bin 
as follows:

#!/usr/bin env python2.5

import pydoc
if __name__ == '__main__':
 pydoc.gui()# Was pydoc.cli() in the original 
"pydoc"



I then named it "pydocgui", saved it to the desktop for now, then set it 
to open with Python in its document properties.

If I double click on this file, then select run from the dialog, the 
Pydoc Server opens.

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


Re: JSON and Firefox sessionstore.js

2009-04-22 Thread TommW

Steven D'Aprano wrote:
Unless I'm badly mistaken, the Firefox sessionstore.js file is supposed 
to be JSON.


In Python 3.0, I do this:


import json
filename = '.mozilla/firefox/2z5po7dx.default/sessionstore.js'
json.load(open(filename))

Traceback (most recent call last):
  File "/usr/local/lib/python3.0/json/decoder.py", line 340, in raw_decode
obj, end = next(self._scanner.iterscan(s, **kw))
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.0/json/__init__.py", line 267, in load
parse_constant=parse_constant, **kw)
  File "/usr/local/lib/python3.0/json/__init__.py", line 307, in loads
return _default_decoder.decode(s)
  File "/usr/local/lib/python3.0/json/decoder.py", line 323, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.0/json/decoder.py", line 342, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded


Am I doing something wrong? Am I mistaken about sessionstore.js being 
JSON? Is there a bug in json?


If it matters, I'm using Firefox 2.0.0.5 under Linux.





Steven:

The json files are used for bookmark backups in FF 3.0 series.

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