[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

websearch) script ?

Stef Mientki

2/4/2008 10:18:00 PM

hello,

Being very satisfied with Python as a general program language,
and having troubles with a number of PHP scripts, moving to another
provider,
I wanted to replace the PHP scripts with Python Scripts.

The most important one is a PHP script that searches text in all
documents on my website.
Does someone has such a script ?

Now in more general,
If I need such a script in PHP or Perl, I can find dozens on the web,
for Python I can not find None ???

Am I mistaken that these kind of tasks can be equally well performed by
Python as PHP or Perl ?
If so, why can't I find all kinds of standard scripts on the web ?
Just curious.

thanks,
Stef Mientki
5 Answers

Bernard

2/5/2008 4:05:00 AM

0

On 4 fév, 17:17, Stef Mientki <stef.mien...@gmail.com> wrote:
> hello,
>
> Being very satisfied with Python as a general program language,
> and having troubles with a number of PHP scripts, moving to another
> provider,
> I wanted to replace the PHP scripts with Python Scripts.
>
> The most important one is a PHP script that searches text in all
> documents on my website.
> Does someone has such a script ?

Text File Searcher : http://aspn.activestate.com/ASPN/Cookbook/Python/Rec...

you'll need to adapt it a bit but you'll get the main idea on how to
do it for your situation


Bruno Desthuilliers

2/5/2008 8:24:00 AM

0

Stef Mientki a écrit :
(snip)
> The most important one is a PHP script that searches text in all
> documents on my website.
> Does someone has such a script ?

There's some good stuff in Zope for plain-text indexing. I think you
could build from this (IIRC, looking for TextIndexNG should take you at
the right place).

(snip)
> Now in more general,
> If I need such a script in PHP or Perl, I can find dozens on the web,
> for Python I can not find None ???

Usually, with Python, you'll find either whole packages - the Python
might be a good start:
packages index http://pypi.pytho...

or receipes in the cookbook http://aspn.activestate.com/ASPN/Cookb...


> Am I mistaken that these kind of tasks can be equally well performed by
> Python as PHP or Perl ?

Perl can be amazing wrt/ text processing - but it has been specifically
designed for this kind of tasks. But yes, Python is a good fit too for
this kind of tasks - far better than PHP. You may want to read David
Mertz's book on this topic:
http://gnosi...

> If so, why can't I find all kinds of standard scripts on the web ?

What do you call "standard scripts" ? Plain text search is not a simple
task - at least if you want something usable and efficient.

Else, I can't tell for Perl, but the vast majority of PHP scripts you'll
find on the web is just crap.

Alan Ferris

1/18/2013 11:09:00 PM

0

On Fri, 18 Jan 2013 14:14:50 -0800, Jason@nospam.com (Jason) wrote:

>In article <lopif81ems57tmsrmakib8r9tlbtr8fpn6@4ax.com>, Alan Ferris
><hairy.ferrit@yahoo.co.uk> wrote:
>
>> On Thu, 17 Jan 2013 15:41:51 -0800, Jason@nospam.com (Jason) wrote:
>>
>> >> Suddenly the hawk moved to a mile away. Amazing speed that bird must
>have had
>> >> to have been shot by your dad at both 1/2 mile and a mile without a
>> >scope. What
>> >> rifle was he using?
>> >>
>> >> (Do try and make this better than the book, at least a rifle manufactured
>> >> before last year)
>>
>> >
>> >It was at least a half mile away and may have been a mile away. We did not
>> >have an easy way to measure the distance.
>>
>> Now you have just shown anybody who can shoot that you are a liar. You
>have to
>> have a good estimate of the range to hit the target. You have to account for
>> the drop in the bullet as well as coping with drift from wind. If your range
>> is 1/2 mile then the drift will be twice for a 1m shot in steady wind
>> conditions. The reality is wind is less than steady.
>
>That is correct. My father could easily do it since he was trained to do
>it when he was a soldier. Most guns issued to soldiers in those days did
>not have scopes.
>
So he was a fully trained sniper and failed to teach you how to adjust a
scope....your stories just get worse for honesty.

--
Ferrit

()'.'.'()
( (T) )
( ) . ( )
(")_(")
Atheist #1211
EAC(UK)#252 Ironic Torture Div.

SERV:
http://www.youtube.com/watch?v=W...
https://www.youtube.com/watch?v=D...
https://www.youtube.com/watch?v=6...



Jason

1/19/2013 12:07:00 AM

0

In article <9eljf81nge6liimi6uan53ct3eo9lrnl26@4ax.com>, Alan Ferris
<hairy.ferrit@yahoo.co.uk> wrote:

> On Fri, 18 Jan 2013 14:14:50 -0800, Jason@nospam.com (Jason) wrote:
>
> >In article <lopif81ems57tmsrmakib8r9tlbtr8fpn6@4ax.com>, Alan Ferris
> ><hairy.ferrit@yahoo.co.uk> wrote:
> >
> >> On Thu, 17 Jan 2013 15:41:51 -0800, Jason@nospam.com (Jason) wrote:
> >>
> >> >> Suddenly the hawk moved to a mile away. Amazing speed that bird must
> >have had
> >> >> to have been shot by your dad at both 1/2 mile and a mile without a
> >> >scope. What
> >> >> rifle was he using?
> >> >>
> >> >> (Do try and make this better than the book, at least a rifle
manufactured
> >> >> before last year)
> >>
> >> >
> >> >It was at least a half mile away and may have been a mile away. We did not
> >> >have an easy way to measure the distance.
> >>
> >> Now you have just shown anybody who can shoot that you are a liar. You
> >have to
> >> have a good estimate of the range to hit the target. You have to
account for
> >> the drop in the bullet as well as coping with drift from wind. If
your range
> >> is 1/2 mile then the drift will be twice for a 1m shot in steady wind
> >> conditions. The reality is wind is less than steady.
> >
> >That is correct. My father could easily do it since he was trained to do
> >it when he was a soldier. Most guns issued to soldiers in those days did
> >not have scopes.
> >
> So he was a fully trained sniper and failed to teach you how to adjust a
> scope....your stories just get worse for honesty.
>
> --
> Ferrit
>
> ()'.'.'()
> ( (T) )
> ( ) . ( )
> (")_(")
> Atheist #1211
> EAC(UK)#252 Ironic Torture Div.
>
> SERV:
> http://www.youtube.com/watch?v=W...
> https://www.youtube.com/watch?v=D...
> https://www.youtube.com/watch?v=6...
>
>
>

My father NEVER was trained to use a scope while in the military. He was
not a sniper but was issued a standard weapon that did not have a scope.

My brother had a scope on one of his guns. He showed me how to adjust it.


Jason

1/19/2013 12:13:00 AM

0

In article <itkjf8919ilosfg63em44304jv0vnel0bh@4ax.com>, Alan Ferris
<hairy.ferrit@yahoo.co.uk> wrote:

> On Fri, 18 Jan 2013 14:04:43 -0800, Jason@nospam.com (Jason) wrote:
>
> >In article <bn4jf89vob290qngjasbldn5cls9ompch3@4ax.com>, Alan Ferris
> ><hairy.ferrit@yahoo.co.uk> wrote:
> >
> >> On Fri, 18 Jan 2013 08:18:15 -0600, Free Lunch <lunch@nofreelunch.us>
wrote:
> >>
> >> >On Thu, 17 Jan 2013 21:30:09 -0800, Jason@nospam.com (Jason) wrote in
> >> >alt.atheism:
> >> >
> >> >>In article <hlwdjsd2-B4A550.17330417012013@news.giganews.com>, Jeanne
> >> >>Douglas <hlwdjsd2@NOSPAMgmail.com> wrote:
> >> >>
> >> >>> In article
> >> >>> <Jason-1701131541510001@66-53-218-239.lsan.mdsg-pacwest.com>,
> >> >>> Jason@nospam.com (Jason) wrote:
> >> >...
> >> >
> >> >>> > It was at least a half mile away and may have been a mile away. We
> >did not
> >> >>> > have an easy way to measure the distance.
> >> >>>
> >> >>> A hunter or a farmer who is unable to judge distance is a failed
hunter
> >> >>> or farmer.
> >> >>
> >> >>Daddy guessed that it was a mile but my oldest brother said it was
> >> >>probably closer to a half mile. I don't know. I am not good at judging
> >> >>distances.
> >> >
> >> >Tall tales should have humor to them, not just indefensible
> >> >exaggeration.
> >>
> >> Indeed, clearly he is unaware of the humans eye ability to resolve
> >objects over
> >> such distances. Let alone that even expert marksmen would not try to shoot
> >> much over 300yards on open sights.
> >>
> >> Though I have seen a video of a man shooting 1000yrds on open sights but
> >he was
> >> talked into the target by a spotter.
> >>
> >> --
> >> Ferrit
> >>
> >> ()'.'.'()
> >> ( (T) )
> >> ( ) . ( )
> >> (")_(")
> >>
> >> http://www.youtube.com/watch?v=W...
> >>
> >> https://www.youtube.com/watch?v=D...
> >>
> >> https://www.youtube.com/watch?v=6...
> >>
> >>
> >>
> >
> >I once saw a very old mauser rifle. It was used in a world war and was in
> >very bad condition. It had open sights. It had a pop-up special sight for
> >long distance shooting. It was wonderful invention since in those days,
> >most rifles did not have scopes or even mounting systems for scopes. If
> >you visit a gun show, you may be able to see a mauser rifle with a pop-up
> >special sight system. There may be a picture of the pop up peep sight at
> >this sight:
> >
> >http://www.sporterizing.com/index.php?show...
> >
> You really are ignorant of weapons. Most early military weapons were fitted
> with pop up rear sight.
>
> I used to own a Lee Enfield Mark 5 which has the standard battlefield flip up
> sights fitted. Down it was set for about 2-300 yards. Not 100% accurate due
> to the size of the hole but perfect for quick battlefield aiming.
>
> The flip up would set at about 200yrds min to a max of about 1300yrds at 15
> clicks iirc. But you would be lucky to hit what you aimed at.
>
> Tell me, at what distance can you see the numbers on a car clearly.....now
> think about those numbers 500 yards away....then 1,000 yards.
>

You missed the point. My father was trained to use such a pop-up sight. He
had such a sight on the gun that he used to shoot the chicken hawk. He
would not allow any of his children to use his special gun. He shot many
deer with that rifle.