Un regalino utile...

Michele Campeotto micampe@f2s.com
Tue, 17 Apr 2001 15:58:45 +0200


This is a multi-part message in MIME format.

--Multipart_Tue__17_Apr_2001_15:58:45_+0200_0817c100
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

  Un semplice script in Python per cercare una parola nel glossario.

  Mettete questo file da qualche parte assieme al file del glossario
(rinominato in `glossario'), dategli i permessi di esecuzione e
lanciatelo... dovrebbe essere piuttosto semplice da usare.

  Nota: Usa Gtk+, quindi PyGtk deve essere installato...

  Spero sia utile a qualcuno
  Ciao

  -- Michele  -  www.moleskine.f2s.com

  "How many deaths will it take till he knows
   that too many people have died?"

      -- Bob Dylan, "Blowing in the wind"

--Multipart_Tue__17_Apr_2001_15:58:45_+0200_0817c100
Content-Type: application/octet-stream;
 name="glb"
Content-Disposition: attachment;
 filename="glb"
Content-Transfer-Encoding: base64

IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgpmcm9tIGd0ayBpbXBvcnQgKgoKdHJhZCA9IGludiA9IE5v
bmUKCmRlZiBsb29rdXBfd29yZCh3LCBkYXRhPU5vbmUpOgogICAgaW1wb3J0IHN0cmluZywgcmUK
ICAgIAogICAgd29yZCA9IGRhdGEuZ2V0X3RleHQoKQogICAgZ2xvc3NhcmlvID0gb3BlbignZ2xv
c3NhcmlvJykKICAgIGludmFyaWF0aSA9IFtdCiAgICB0cmFkb3R0aSA9IFtdCiAgICB0cmFkdXpp
b25lID0gRkFMU0UKICAgIGZvciBsaW5lIGluIGdsb3NzYXJpby5yZWFkbGluZXMoKToKICAgICAg
ICBpZiBsaW5lWzBdID09ICcqJzoKICAgICAgICAgICAgaWYgc3RyaW5nLmZpbmQobGluZSwgJ1Ry
YWRvdHRpJykgPj0gMDoKICAgICAgICAgICAgICAgIHRyYWR1emlvbmUgPSBUUlVFCiAgICAgICAg
ZWxpZiByZS5zZWFyY2goJyhcQXxcVyknICsgd29yZCArICdcVycsIGxpbmUpOgogICAgICAgICAg
ICBwcmludCBsaW5lCiAgICAgICAgICAgIGlmIHRyYWR1emlvbmU6CiAgICAgICAgICAgICAgICBs
aW5lID0gcmUuc3ViKCdcdCsnLCAnIC0+ICcsIGxpbmUpCiAgICAgICAgICAgICAgICB0cmFkb3R0
aS5hcHBlbmQobGluZSkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGludmFyaWF0
aS5hcHBlbmQobGluZSkKICAgIGlmIGxlbih0cmFkb3R0aSkgPiAwOgogICAgICAgIHRyYWQuc2V0
X3RleHQoc3RyaW5nLmpvaW4odHJhZG90dGksICcnKVs6LTFdKQogICAgZWxzZToKICAgICAgICB0
cmFkLnNldF90ZXh0KCdOb24gdHJvdmF0by4nKQogICAgaWYgbGVuKGludmFyaWF0aSkgPiAwOgog
ICAgICAgIGludi5zZXRfdGV4dChzdHJpbmcuam9pbihpbnZhcmlhdGksICcnKVs6LTFdKQogICAg
ZWxzZToKICAgICAgICBpbnYuc2V0X3RleHQoJ05vbiB0cm92YXRvLicpCgpkZWYgbWFpbigpOgog
ICAgZ2xvYmFsIHRyYWQsIGludgogICAgCiAgICB3aW4gPSBHdGtXaW5kb3coKQogICAgd2luLmNv
bm5lY3QoJ2RlbGV0ZV9ldmVudCcsIG1haW5xdWl0KQogICAgd2luLnNldF9ib3JkZXJfd2lkdGgo
NCkKICAgIHZib3ggPSBHdGtWQm94KHNwYWNpbmc9NCkKICAgIGhib3ggPSBHdGtIQm94KHNwYWNp
bmc9NCkKICAgIHZib3gucGFja19zdGFydChoYm94KQogICAgd29yZF9lbnRyeSA9IEd0a0VudHJ5
KCkKICAgIHdvcmRfZW50cnkuY29ubmVjdCgnYWN0aXZhdGUnLCBsb29rdXBfd29yZCwgd29yZF9l
bnRyeSkKICAgIGhib3gucGFja19zdGFydCh3b3JkX2VudHJ5LCBUUlVFLCBUUlVFKQogICAgYnRu
ID0gR3RrQnV0dG9uKCctPicpCiAgICBidG4uY29ubmVjdCgnY2xpY2tlZCcsIGxvb2t1cF93b3Jk
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