Re: web facing static text db

2016-04-30 Thread Gordon Levi
"Fetchinson ."  wrote:

>Hi folks,
>
>I have a very specific set of requirements for a task and was
>wondering if anyone had good suggestions for the best set of tools:
>
>* store text documents (about 10 pages)
>* the data set is static (i.e. only lookups are performed, no delete,
>no edit, no addition)
>* only one operation required: lookup of pages by matching words in them
>* very simple web frontend for querying the words to be matched
>* no authentication or authorization, frontend completely public
>* deployment at webfaction
>* deadline: yesterday :)
>
>Which web framework and db engine would you recommend?
>
>So far I'm familiar with turbogears but would be willing to learn
>anything if sufficiently basic since my needs are pretty basic (I
>think).
>

What do need that storing the documents in HTML format and Google
Custom Search does not provide
?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Just starting to learn Python, and encounter a problem

2016-07-22 Thread Gordon Levi
Zagyen Leo  wrote:

>yeah, it may be quite simple to you experts, but hard to me.
>
>In one of exercises from the Tutorial it said: "Write a program that asks the 
>user their name, if they enter your name say "That is a nice name", if they 
>enter "John Cleese" or "Michael Palin", tell them how you feel about them ;), 
>otherwise tell them "You have a nice name."
>
>And i write so:
>
>name = input("Enter your name here: ")
>if name == "John Cleese" or "Michael Palin":
>print("Sounds like a gentleman.")
>else:
>print("You have a nice name.")
>
>But strangely whatever I type in (e.g. Santa Claus), it always say "Sounds 
>like a gentleman.", not the result I want.

The second line should be 
if name == "John Cleese" or name == "Michael Palin":

As discussed in recent lengthy thread in this group the following
line, and hence your statement, is always true -

If "Michael Palin":
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python text file fetch specific part of line

2016-07-28 Thread Gordon Levi
Arshpreet Singh  wrote:

>I am writing Imdb scrapper, and getting available list of titles from IMDB 
>website which provide txt file in very raw format, Here is the one part of 
>file(http://pastebin.com/fpMgBAjc) as the file provides tags like Distribution 
> Votes,Rank,Title I want to parse title names, I tried with readlines() method 
>but it returns only list which is quite heterogeneous, is it possible that I 
>can parse each value comes under title section?

Beautiful Soup will make your task much easier
.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python text file fetch specific part of line

2016-07-29 Thread Gordon Levi
c...@zip.com.au wrote:

>On 28Jul2016 19:28, Gordon Levi  wrote:
>>Arshpreet Singh  wrote:
>>>I am writing Imdb scrapper, and getting available list of titles from IMDB 
>>>website which provide txt file in very raw format, Here is the one part of 
>>>file(http://pastebin.com/fpMgBAjc) as the file provides tags like 
>>>Distribution  Votes,Rank,Title I want to parse title names, I tried with 
>>>readlines() method but it returns only list which is quite heterogeneous, is 
>>>it possible that I can parse each value comes under title section?
>>
>>Beautiful Soup will make your task much easier
>><https://www.crummy.com/software/BeautifulSoup/>.
>
>Did you look at his sample data?

No. I read he was "writing an IMDB scraper, and getting the available
list of titles from the IMDB web site". It's here
<http://www.imdb.com/>.  
> Plain text, not HTML or XML. Beautiful Soup is 
>not what he needs here.

Fortunately the OP told us his application rather than just telling us
his current problem. His life would be much easier if he ignored the
plain text he has obtained so far and started again using a Beautiful
Soup tutorial. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why not allow empty code blocks?

2016-07-31 Thread Gordon Levi
"D'Arcy J.M. Cain"  wrote:

>On Sat, 30 Jul 2016 16:14:18 +0100
>BartC  wrote:
>> > By the way, the last time I replied to you it went to the list but
>> > your address bounced.  Was that a glitch or are you using an
>> > invalid address in a mailing list?
>> 
>> Do you mean my email address? That was valid once but no longer. (If
>> you want to send an email replace "bc" with "bcas".)
>
>Are you kidding me?  It's not our job to replace things in your email
>address, it's yours.  Fix your client.
>
>> I'm not using a mailing list; I'm posting to usenet.
>
>I don't care if you are using carrier pigeon.  If you send an email
>address, make it a valid one.

I admire those who use a valid email address on Usenet but it is an
open invitation for spammers. I doubt if there is anybody who uses
their primary email address.
>
>Maybe you should just change it to I_Am_a_Troll@nowhere.

To conform to RFC 2606 that should be .
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why not allow empty code blocks?

2016-08-01 Thread Gordon Levi
"D'Arcy J.M. Cain"  wrote:

>On Sun, 31 Jul 2016 11:53:47 -0400
>"D'Arcy J.M. Cain"  wrote:
>> On Mon, 01 Aug 2016 00:25:58 +1000
>> On the other hand I have no throwaway accounts.  Every address I use
>> is a primary one.  I have all sorts of methods to block spam.  None of
>> those methods involves moving my spam problem to someone else.
>
>For example...
>
>: Host or domain name not found. Name service
>error for name=address.invalid type=: Host not found
>
>So I have to examine every address I reply to or deal with the bounce
>message later.  Way to move your spam problem to someone else.

.invalid is specified in RFC 2606 for exactly that purpose. If you
don't notice that the address is invalid a server very close to you,
probably your SMTP server, will tell you. In contrast, your valid
email address will become the target of many spam emails even if you
manage to block them. It will also be used as the source of spam so
somebody at vex.net may be fooled into believing that they are
receiving a proper email.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why not allow empty code blocks?

2016-08-03 Thread Gordon Levi
"D'Arcy J.M. Cain"  wrote:

>On Mon, 01 Aug 2016 00:25:58 +1000
>Gordon Levi  wrote:
>> "D'Arcy J.M. Cain"  wrote:
>> >I don't care if you are using carrier pigeon.  If you send an email
>> >address, make it a valid one.
>> 
>> I admire those who use a valid email address on Usenet but it is an
>> open invitation for spammers. I doubt if there is anybody who uses
>> their primary email address.
>
>I never said that he had to use his primary address, just a valid one.
>
>On the other hand I have no throwaway accounts.  Every address I use is
>a primary one.  I have all sorts of methods to block spam.  None of
>those methods involves moving my spam problem to someone else.

How do you manage to avoid the resources wasted on multiple mail
servers in order for the spam to each you just so that you can block
it?
>
>But what do I know?  I'm just some old fart who grew up being taught
>that society works best when you consider the other guy and take
>responsibility for your own messes.  Old fashioned ideas I know.

Nearly twenty years ago The Internet Engineering Task Force produced
RFC2606 so that I could consider the other guy and use .invalid as a
TLD. It makes a false email address instantly recognisable. If it is
not recognised by a person it will be recognised and bounced by a
nearby mail server using minimum computer resources.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Which Python editor has this feature?

2016-01-11 Thread Gordon Levi
jf...@ms4.hinet.net wrote:

>It lets you jump between the current cursor position and the line the upper 
>level indentation start, something like the bracket matching in C editor. 
>Because of Python use indentation as its code block mark, It might be helpful 
>if we can jump between different level of it:-)

Jetbrains Pycharm has "go to start of block" and "go to end of block"
commands .

Unfortunately the free version of Pycharm does not support remote
debugging and my main use for Python is for programming a Raspberry
Pi. I use Visual Studio instead and its "go to end of block" does not
work in the Python editor
.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Everything good about Python except GUI IDE?

2016-02-27 Thread Gordon Levi
wrong.addres...@gmail.com wrote:

>On Saturday, 27 February 2016 18:08:36 UTC+2, Dietmar Schwertberger  wrote:
>> On 27.02.2016 12:18, wrong.addres...@gmail.com wrote:
>> > Isn't there any good GUI IDE like Visual Basic? I hope there are some less 
>> > well known GUI IDEs which I did not come across. Thanks.
>> 
>> As of today, there's no Python GUI builder comparable to VB 6.
>> 
>
>Thanks for stating this clearly. Everyone here has been trying to show me 
>various ways to do the kind of things I will want to, but nobody clearly 
>admits the limitations I will have to accept if I start with Python.
>
>I am starting to wonder if VB.net would be a better solution for the time 
>being. I have learnt enough VB.net to manage my work but it is bloated and 
>Microsoft dependent.

When I moved from VB "Classic" to new a language I chose Java. The
Netbeans IDE includes a drag and drop WYSIWYG form designer similar
to, but slightly better than, VB6
. Alas, thick
desktop applications are rapidly becoming out of date.

When I chose Java it was the most popular language for commercial
programming apart from .NET. I was subsequently tempted to move to
Python because I have been programming for the Raspberry Pi and Python
is the language of choice for the Pi. In addition I find Python more
readable than Java. I have been deterred because, like VB, there are
two distinct flavours and, unlike VB, there is no IDE with a form
designer.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Everything good about Python except GUI IDE?

2016-02-28 Thread Gordon Levi
Chris Angelico  wrote:

>On Sun, Feb 28, 2016 at 9:25 PM, Rustom Mody  wrote:
>> Code is always the last resort for arbitrary complexity
>> Lets keep it the last resort.
>>
>> If the bottom-line is that python's GUI-builders are so deep into suxland
>> that they are best avoided in place of hand-written code, thats fine (by me).
>>
>> Lets please not make a virtue of a lack
>
>Once someone figures out a way to usefully merge independent changes
>(you know, the way source control tools do every single day for code),
>maybe I'll consider that. Until then, the last resort is also my first
>response.

Why can't whatever is generated by a GUI form designer be stored in
source control along with all the other project files? The only
restriction would be that everyone who wants to change the UI would
have to use the same form designer.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Everything good about Python except GUI IDE?

2016-02-28 Thread Gordon Levi
Rustom Mody  wrote:

>On Sunday, February 28, 2016 at 6:38:40 PM UTC+5:30, Gordon Levi wrote:
>> Chris Angelico  wrote:
>> 
>> >On Sun, Feb 28, 2016 at 9:25 PM, Rustom Mody wrote:
>> >> Code is always the last resort for arbitrary complexity
>> >> Lets keep it the last resort.
>> >>
>> >> If the bottom-line is that python's GUI-builders are so deep into suxland
>> >> that they are best avoided in place of hand-written code, thats fine (by 
>> >> me).
>> >>
>> >> Lets please not make a virtue of a lack
>> >
>> >Once someone figures out a way to usefully merge independent changes
>> >(you know, the way source control tools do every single day for code),
>> >maybe I'll consider that. Until then, the last resort is also my first
>> >response.
>> 
>> Why can't whatever is generated by a GUI form designer be stored in
>> source control along with all the other project files? The only
>> restriction would be that everyone who wants to change the UI would
>> have to use the same form designer.
>
>Glade generates XML (last I saw)
>XML is text... kinda... but not quite
>eg XML is sometimes/somewhere space sensitive, sometimes not
>This can generate messy diffs

That is also true of Python code but does not preclude effective
source control.
>
>Best I can see, these are not exactly trivial nor quite impossible to solve 
>problems
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Everything good about Python except GUI IDE?

2016-02-28 Thread Gordon Levi
Marko Rauhamaa  wrote:

>Rustom Mody :
>
>> On Sunday, February 28, 2016 at 7:22:08 PM UTC+5:30, Marko Rauhamaa wrote:
>>> Rustom Mody :
>>> 
>>> > whereas in fact every significant GUI embeds text (possibly
>>> > recursively)
>>> >
>>> > eg TI inside GUI -- think of text inside gimp GUI inside TI --
>>> > think of Word embedding other doc types including pictures Which
>>> > can be recursive -- WOrd embeds a picture embeds text
>>> 
>>> Sigh, still nobody has mentioned an exemplary GUI application.
>>> 
>>> An anecdote: Some weeks back my son and I were struggling to get the
>>> right kind of graph out of Excel. After four hours of Google,
>>> Youtube, trial and error, we gave up, took out a pad of millimeter
>>> paper and some colored pencils. The whole job took my son an hour and
>>> the end result looked great. He snapped a picture and sent it to the
>>> teacher by email.
>>
>> Point being??
>
>I'm awaiting for an opposite anecdote, a GUI app you absolutely love and
>recommend as a model for GUI developers.
>
>We are talking about GUI tools to produce what? Crap?

Nobody likes filling in forms but how do you suggest converting a form
based app into something loveable. What interface would make you love
adding a new contact to your address book?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Everything good about Python except GUI IDE?

2016-03-02 Thread Gordon Levi
Marko Rauhamaa  wrote:

>Gordon Levi :
>
>> Nobody likes filling in forms but how do you suggest converting a form
>> based app into something loveable.
>
>Straight HTML does forms just fine without CSS or JavaScript, yet few
>can resist.
>
>> What interface would make you love adding a new contact to your
>> address book?
>
>In my case, the address book is a ~/.mailrc file, which I edit using
>emacs.

I find it difficult to believe that you _love_ updating your contacts
using Emacs even if it gives you an excuse to get some therapy from
Eliza. It seems equally unlikely that you can do without phone numbers
and addresses for your contacts.
-- 
https://mail.python.org/mailman/listinfo/python-list