Re: Most "pythonic" syntax to use for an API client library

2019-05-14 Thread Dotan Cohen
pretty" to me, but I did not find any "official" > recommendation online. > > Thanks. > > -- > Jonathan. > -- > https://mail.python.org/mailman/listinfo/python-list -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- https://mail.python.org/mailman/listinfo/python-list

Re: CURSES WINDOWS

2018-09-05 Thread Dotan Cohen
on.org/mailman/listinfo/python-list -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- https://mail.python.org/mailman/listinfo/python-list

Re: WANT: bad code in python (for refactoring example)

2017-02-19 Thread Dotan Cohen
participants! On Fri, Feb 17, 2017 at 3:47 PM, Makoto Kuwata wrote: > On Thu, Feb 16, 2017 at 6:34 AM, Dotan Cohen wrote: > >> I think that we can help each other! This is my own code, back when I >> was writing Python like PHP: >> https://github.com/dotancohen/burton &g

Re: WANT: bad code in python (for refactoring example)

2017-02-15 Thread Dotan Cohen
t; * not good code > * not too large (for novice programmer) > * not too complex (for novice programmer) > * released under open source license > > If you know good material in github or bitbucket to refactor, > let me know it. > > -- > regards, > kwatch > -

Re: PiCxx

2015-03-29 Thread Dotan Cohen
;t even evaluate the code for technical merits with an unestablished, unclear, and unfamiliar license like that. The "donate anything" concept is a cute idea, but put the idea in either an informal request if you BSD license the code, or as a condition for a commercial license if you G

Re: To whoever hacked into my Database

2013-11-12 Thread Dotan Cohen
;t understand my question, possibly due to my own failure to properly articulate. -or- 2) Those who understand my predicament better than I do, and show my how to get the results that I need despite my own failure to understand what exactly I need. With Python specifically, the latter far outnumber

Re: ANN: psutil 1.0.0 released

2013-07-11 Thread Dotan Cohen
Thanks, this looks really nice. I was duplicating some of this for my CLI-based webserver control panel: https://github.com/dotancohen/burton As soon as I integrate psutil into Burton I'll add it to the README and such. How would you like me to mention attribution exactly? -- Dotan Cohen

Re: looking for a new router

2013-07-08 Thread Dotan Cohen
ling list that's about Python. :) > > ChrisA Chris, the account that you replied to is just a spam account for his link at the bottom. Helpfully, it appears that Nabble has removed the link and left only the text. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http:/

Re: Must we include urllib just to decode a URL-encoded string, when using Requests?

2013-06-13 Thread Dotan Cohen
On Thu, Jun 13, 2013 at 4:44 PM, Burak Arslan wrote: > On 06/13/13 16:25, Dotan Cohen wrote: > paste this to your python console, it'll show you what modules requests > imports: > > import sys > p = set(sys.modules) > import requests > for m in sorted(set(sys.modules

Re: Must we include urllib just to decode a URL-encoded string, when using Requests?

2013-06-13 Thread Dotan Cohen
y#L86 > Great, thank you Robert. I see that Requests is calling both urllib and urllib2. For some reason I thought that is rather wasteful and should be avoided. I was probably wrong! -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Must we include urllib just to decode a URL-encoded string, when using Requests?

2013-06-13 Thread Dotan Cohen
than import the other. Can I tell which library Requests is currently using and use that? -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Must we include urllib just to decode a URL-encoded string, when using Requests?

2013-06-13 Thread Dotan Cohen
I characters such as some esoteric symbols or Korean/Chinese/Japanese characters. [1] http://stackoverflow.com/a/15627281/343302 -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Monty Python in Syria

2012-08-16 Thread Dotan Cohen
n incidence is not a phenomenon. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Monty Python in Syria

2012-08-15 Thread Dotan Cohen
On Wed, Aug 15, 2012 at 5:41 PM, Dotan Cohen wrote: > And now for something completely different. > > Not programming related, but at 1:20 I was expecting a different question: > http://www.aljazeera.com/news/middleeast/2012/08/2012813103922872697.html > > I figured if anybod

OT: Monty Python in Syria

2012-08-15 Thread Dotan Cohen
And now for something completely different. Not programming related, but at 1:20 I was expecting a different question: http://www.aljazeera.com/news/middleeast/2012/08/2012813103922872697.html I figured if anybody could appreciate that, it would be the folks here. Enjoy! -- Dotan Cohen http

Re: open office in another language?

2012-01-14 Thread Dotan Cohen
Enjoy this relevant article: http://developers.slashdot.org/story/12/01/14/008236/code-cleanup-culls-libreoffice-cruft Dotan Cohen http://what-is-what.com/what_is/open_office.html -- http://mail.python.org/mailman/listinfo/python-list

Re: open office in another language?

2012-01-13 Thread Dotan Cohen
of pain. > Sorry, you are correct. Apache did refactor OOo in order to integrate it with Apache coding practices. LO is, however, heavily refactored from what I understand. Note that this may all be heresy, I've not looked at the code of either! -- Dotan Cohen http://gibberish.co.i

Re: open office in another language?

2012-01-13 Thread Dotan Cohen
, in fact that was a design goal. http://calligra-suite.org/ -- Dotan Cohen http://what-is-what.com/what_is/python.html -- http://mail.python.org/mailman/listinfo/python-list

Re: staticmethod makes my brain hurt

2011-11-17 Thread Dotan Cohen
On Thu, Nov 17, 2011 at 09:37, Ian Kelly wrote: > On Wed, Nov 16, 2011 at 11:44 PM, Dotan Cohen wrote: >> Try this (untested): >> >> class C: >>   @staticmethod >>   def foo(): >>       pass >> >>   print "inside", C.foo, callable(C.f

Re: staticmethod makes my brain hurt

2011-11-16 Thread Dotan Cohen
ll is made, _get_next_id is not callable, and eventually I > end up with: > > ValidationError: could not be > converted to int Try this (untested): class C: @staticmethod def foo(): pass print "inside", C.foo, callable(C.foo) -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Regex to match all trailing whitespace _and_ newlines.

2011-10-10 Thread Dotan Cohen
On Thu, Sep 1, 2011 at 13:30, Peter Otten <__pete...@web.de> wrote: > Dotan Cohen wrote: > >> In the terrific Anki [1] application I am trying to remove trailing >> whitespace from form fields. This is my regex: >> [\n+\s+]$ > > My attempt: > >>&g

Regex to match all trailing whitespace _and_ newlines.

2011-09-01 Thread Dotan Cohen
entering it in a regex-supporting Find/Replace dialogue in Anki. Anki is written in Python. Thanks. [1] ankisrs.net -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Dotan Cohen
because there exists a possibility that someone might want (not need) to edit code on a telephone to make a quick edit to code being interpreted on that machine, _all_ Python code should limit itself to a line width that may or may not wrap on a telephone screen? Is that the argument in favor of an 8

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
Also I/1 and l/1 are easy to distinguish, but I agree that I/l are not. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
is the number thou shalt indent, and the number of the indenting shall be four. Six thou shalt not indent, neither indent thou two, excepting that thou then proceed to four. Eight is right out. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
oose to follow it or die of exceptions; your > choice. > Do you know that Python 4000 is the only language in the world whose vocabulary gets smaller every year?' -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
y mailing list on the internet old man?!? I have also come to the conclusion that the perfect woman, the perfect physics theory, and the perfect programming font are all illusions that men will stride their entire lives in search for but will never find. -- Dotan Cohen http://gibb

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
key was hit in place of the other (they are close by) then either the IDE or compiler would catch it, or it would result in a minor bug in a text string. It simply isn't an issue. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sun, Jul 17, 2011 at 14:51, Thorsten Kampe wrote: > * Dotan Cohen (Sun, 17 Jul 2011 14:11:40 +0300) >> So long as the indentation lines up (which it does, with tabs or >> spaces) then I do not see any problem with variable-width. > >> What are the counter-arguments? &g

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
s? Very nice, and easy to distinguish 0 from o or O. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
rograming in a non-fixed width font is a real pleasure, but the spaces are too narrow. Tabs alleviate that. I'm still looking for the perfect programming font. Suggestions welcomed. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-18 Thread Dotan Cohen
ou a few questions down the > road? (maybe we can add each other on google talk or some social > network) > Sure, I'll email you from my personal email account soon. But after a few more hours, I won't be available until late July. -- Dotan Cohen http://gibberish.co.il http:/

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-18 Thread Dotan Cohen
pressing more than one key at a time. But in the general sense that is good to know, if other people use the layout they will need to be aware of that. Thanks! > maybe some of these are useful info, but maybe you are quite beyond > that. Thanks for your info too. Good luck. > >  just X

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-17 Thread Dotan Cohen
some advice, I'll post the problem here or in private mail. Thanks, Lee. (or should that be Thanks, Xah?) -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-15 Thread Dotan Cohen
r of magnitude heavier. > > So its not exactly clear how much the experience of one carries over > to the other > Thanks. From testing small movements with my fingers I see that the fourth finger is in fact a bit weaker than the last finger, but more importantly, it is much less dex

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-15 Thread Dotan Cohen
ed fact - designed the way is was because the inventor's mother in law's initials were AS and his father is law was DF. The letter combinations JK and L; were his childrens' initials. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Dotan Cohen
ogling turns up nothing. My intention is to improved the Noah ergonomic keyboard layout. Thanks! -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Dotan Cohen
oad off the pinkies and onto the index fingers: http://dotancohen.com/eng/noah_ergonomic_keyboard_layout.html There is a Colemak version in the works as well. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner needs advice

2011-05-31 Thread Dotan Cohen
On Tue, May 31, 2011 at 21:29, Ian Kelly wrote: > On Tue, May 31, 2011 at 11:56 AM, Dotan Cohen wrote: >>>  If you disagree, then I invite you to list one example of two >>> different things that are compatible. >>> >> >> Men and women. > >

Re: Beginner needs advice

2011-05-31 Thread Dotan Cohen
>  If you disagree, then I invite you to list one example of two > different things that are compatible. > Men and women. MS Office and Open Office. IE6 and HTML. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner needs advice

2011-05-28 Thread Dotan Cohen
kely that they do not). Therefore Python 3 is a non-starter in any case. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's super() considered super!

2011-05-26 Thread Dotan Cohen
On Thu, May 26, 2011 at 21:38, Ian Kelly wrote: > It's a link to ycombinator: > > http://news.ycombinator.com/item?id=2588262 > Thanks. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's super() considered super!

2011-05-26 Thread Dotan Cohen
on blind links, so if it isn't then please post a direct link. Thanks. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Why did Quora choose Python for its development?

2011-05-20 Thread Dotan Cohen
er, these give us confidence that the language and ecosystem > is moving in a good direction. > > [1] What are the horrors of PHP? and Do Facebook engineers enjoy > programming in PHP? and Why hasn't Facebook migrated away from PHP? > and What are some of the advantages of PHP

Re: obviscating python code for distribution

2011-05-18 Thread Dotan Cohen
emember, never do in code what Linux will do for you. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: obviscating python code for distribution

2011-05-18 Thread Dotan Cohen
On Wed, May 18, 2011 at 20:24, Chris Angelico wrote: > But you CAN make a system 100% secure against network-based > attacks. > Only by unplugging the network cable. This is called an air gap, and is common in military installations. Anything with a cable plugged in is hackable.

Re: obviscating python code for distribution

2011-05-18 Thread Dotan Cohen
know about weaknesses until much later in the development, when making changes to the underlying code organization may be difficult or impossible. In this early phase of development, he should actually encourage the script kiddies to "report the bugs". -- Dotan Cohen http://gibberish.c

Re: obviscating python code for distribution

2011-05-16 Thread Dotan Cohen
bly, any problem that I've ever had someone has had first. So while you might have been one of the first have a need to interface FooWidget with PlasmoidBar, someone after you will in fact need just the code to do that. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: learnpython.org - an online interactive Python tutorial

2011-04-23 Thread Dotan Cohen
d the result should be the string '11'. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: learnpython.org - an online interactive Python tutorial

2011-04-23 Thread Dotan Cohen
ials. > > Read more on the website. > > Thanks for your help, and I would appreciate if you help me spread the word, > and give me feedback on the website. > -- > http://mail.python.org/mailman/listinfo/python-list > Nice work! I notice that the "Next Chapter" link

Re: Another location of the PyGTK tutorial

2011-04-03 Thread Dotan Cohen
> -- > http://mail.python.org/mailman/listinfo/python-list > -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Another location of the PyGTK tutorial

2011-04-03 Thread Dotan Cohen
> -- > http://mail.python.org/mailman/listinfo/python-list > -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems of Symbol Congestion in Computer Languages

2011-03-01 Thread Dotan Cohen
s, or > just write a os wide config file yourself. You can see tutorials and > sample files for all these here > http://xahlee.org/Periodic_dosage_dir/keyboarding.html > > i'd be interested to know what Dotan Cohen use too. > You can see what I started working on yesterday, bu

Re: Problems of Symbol Congestion in Computer Languages

2011-03-01 Thread Dotan Cohen
> typists not programmers. Yes, I'm trying to solve that! Ideally in the end all the brackets including {} won't need modifier keys. Give me some feedback, please, on that layout. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems of Symbol Congestion in Computer Languages

2011-02-28 Thread Dotan Cohen
mming. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and unicode

2010-09-20 Thread Dotan Cohen
On Mon, Sep 20, 2010 at 12:20, Peter Otten <__pete...@web.de> wrote: > It may work by accident, if you declare it as UTF-8, because that is also > the default in Python 3. > That does seem to be the case. Thank you for the enlightenment and information. -- Dotan Cohen http://

Re: Python and unicode

2010-09-20 Thread Dotan Cohen
t I've read the PEP document regarding Unicode / UTF-8. I see that it mentions that the declaration must be on the second or first line of the file. Is this still true in Python 3? I have been putting it further down (still before all python code, but after some comments) in code that I w

Re: Trying to set a cookie within a python script

2010-08-04 Thread Dotan Cohen
On Wed, Aug 4, 2010 at 18:30, Dave Angel wrote: > Depends on how sure you are that your program will never need characters > outside your greek character set. Remember Y2K? > Don't forget that the Euro symbol is outside the Greek character set. -- Dotan Cohen http://gibber

Re: Trying to set a cookie within a python script

2010-08-04 Thread Dotan Cohen
> ascii = the standard english character set only, right? > Pretty much, plus the numbers, some symbols, and a few nonprinting characters. Read here: http://en.wikipedia.org/wiki/Ascii -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set a cookie within a python script

2010-08-03 Thread Dotan Cohen
gt; think the question has meaning. > ׁHTML is just plain text. So the answer to the question is that ideally, the plain text that is sent to stdout would already be HTML. print ( "My Greek Page\n" ) -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Ignorance and Google Groups (again)

2010-07-02 Thread Dotan Cohen
On 2 July 2010 05:10, D'Arcy J.M. Cain wrote: > On Thu, 1 Jul 2010 21:34:15 +0300 > Dotan Cohen wrote: >> I'm one of them. Gmail is great for mailing lists, though I would >> never use it as a personal email client. But I'm more of a lurker than >> a poste

Re: Ignorance and Google Groups (again)

2010-07-01 Thread Dotan Cohen
though I would never use it as a personal email client. But I'm more of a lurker than a poster on this list, so D'Arcy won't miss me anyway. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert .doc to .pdf

2010-06-14 Thread Dotan Cohen
terested in this gem from a prominent Wine dev: http://dag.wieers.com/home-made/unoconv/ Any answer to the question will depend on why the OP cannot run OOo, and most likely the answer will be a fix for how to in fact run it anyway (or MSO). -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: (a==b) ? 'Yes' : 'No'

2010-04-19 Thread Dotan Cohen
ore elegant/common python expression for this? > I'm a little late to the party, but I just saw this in Dive Into Python: multiple = 1024 if a_kilobyte_is_1024_bytes else 1000 It's kind of sloppy as the condition is between the possible values, but it works. -- Dotan Cohen http://b

Re: The Regex Story

2010-04-10 Thread Dotan Cohen
> Unreasonable phobia to regex is just as much harmful as overuse of it. > Agreed. I did not mean to sound as if I am against the use of regular expressions. -- Dotan Cohen http://bido.com http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: The Regex Story

2010-04-08 Thread Dotan Cohen
> Regexes do have their uses. It's a case of knowing when they are the > best approach and when they aren't. > Agreed. The problems begin when the "when they aren't" is not recognised. -- Dotan Cohen http://bido.com http://what-is-what.com -- http://mail.

Re: The Regex Story

2010-04-08 Thread Dotan Cohen
m hard pressed to think of a situation in which a regex is preferable to a built-in function. -- Dotan Cohen http://bido.com http://what-is-what.com Please CC me if you want to be sure that I read your message. I do not read all list mail. -- http://mail.python.org/mailman/listinfo/python-list

Re: Timer

2010-02-17 Thread Dotan Cohen
> What can I > put there to remove the splash page after 5 seconds? > Javascript. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il Please CC me if you want to be sure that I read your message. I do not read all list mail. -- http://mail.python.org/mailman/listinfo/python-list

Re: Generic Python Benchmark suite?

2010-01-18 Thread Dotan Cohen
> What do you suggest? > $ man time -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: HAppy New Year

2010-01-03 Thread Dotan Cohen
> What I want to know is why didn't he just write > > """\ > ... original long string ... > """.replace("6", "_") > Uf! Why didn't I think of that?! > But watch that snarkiness ... I'm a Windows user too! &

Re: HAppy New Year

2010-01-03 Thread Dotan Cohen
‘replace with’ column > > 5.   Click on replace all. > Wow, I just love Windows users. Sending this to the Python list? Paste "on a notepad"?!? The "Replace All" function in "a notepad" is Ctrl-H?!?? What does H stand for?!?!? Explicit instructions how to :%s/6/_/g

Re: Language mavens: Is there a programming with "if then else ENDIF"syntax?

2009-11-18 Thread Dotan Cohen
> The OP explicitly said no block delimiters. Your example uses {..}, and > doesn't have endif. > Just out of habit. I think that PHP, like C, lets you avoid the block deliminators so long as the block all fits on one line. -- Dotan Cohen http://what-is-what.com http://g

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-17 Thread Dotan Cohen
oved to have multiple matches perform multiple functions. > Is there any particular reason why this might be a *bad* language- > design idea? It is about as far from OO as one could get. Whether or not that is "bad" depends on the use case. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyfora, a place for python

2009-11-04 Thread Dotan Cohen
mentation has this feature: user comments right on the same page (no link to a wiki, though). It's great, most of the best usage practices that I have learned in that language came from the user's comments, not from the official documentation itself. -- Dotan Cohen http://what-i

Re: Web development with Python 3.1

2009-10-31 Thread Dotan Cohen
find them too obnoxious, I break > them. I am free because I know that I alone am morally responsible for > everything I do." -- Robert A. Heinlein > Heinlein said that? It's been a long time since I've read Heinlein, and his quotes are as vivid as his books. -- Dotan

Re: Web development with Python 3.1

2009-10-30 Thread Dotan Cohen
Mako tags with <% ...>. > Thanks, Terry, that should save me some time. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-30 Thread Dotan Cohen
string / unicode encoding and decoding is a builtin Python feature. > I know, but I need to play with it a bit before I become comfortable with how it is handled. >> database escaping, > > Already provided by any DB-API compliant connector, at least if correctly > used. > > Now there's *much* more in security (specially when doing web programming) > than this... Of course. But these are the relevant issues for Python. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-30 Thread Dotan Cohen
> proper use of Mako's advanced features. But one thing is clear - if you > persist on applying your favorite antipattern, you'll just waste more of > your time. Your choice, as usual... > The point is that I want to use only _Python_ features, not Django/Mako/whatever features. However I am aware that some things I should not touch for security reasons. That is why I want a framework: to provide the security aspects of things like converting UTF-8, database escaping, etc. > My 2 cents... > A very valuable 2 cents. Thanks. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-29 Thread Dotan Cohen
anguage that will benefit me by knowing it. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Dotan Cohen
ve already moved to Ubuntu or some other Linux distribution. Windows-only tutorials just look outdated, even if their principles apply to other OSs as well. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-29 Thread Dotan Cohen
e one you have. > I am beginning to see how true that is. > I'd personnaly suggest either Mako (possibly one of the best Python > templating systems) or Django's (well documented and beginner-friendly). > I will examine them both this weekend. Thanks! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-29 Thread Dotan Cohen
2009/10/29 Albert Hopkins : > On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote: >> > return HttpResponse(unmaintanable_html % data) >> > >> >> That's fine for single variables, but if I need to output a table of >> unknown rows?  I assume that return

Re: Web development with Python 3.1

2009-10-29 Thread Dotan Cohen
they typically map URLs to arbitrary code. > I don't think that I like that idea. I will give it a fair chance, though, now that it problem has been identified. Thank you very much for helping me understand this important distinction. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
r the end exists "", all the code from there is generated by end.inc.php. These two files are included in every page of the site. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
are > of course _my_ opinions (most of them based on experience but that's not the > point), and I've never killed anyone for having a different POV - even if > I'm pretty sure they are wrong !-) > Be offensive! I take no offence, I understand that your goal is to help

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
g in the middle of the page. How could I do that with a template? > Now let's say you want torwalds to be not-empty, and a number: > >   @expose("your.template.path") >   @validate(dict(torwalds=Int(not_empty=True)), > error_handler=some_error_handler_controller_action) &

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
ble that is neither the end nor beginning of the code? I ask because the construct "return" makes me believe that this is not good for this purpose. > and here's an exemple using a template: > > # templates/index.html > > > > {{ torvalds }} > > > >

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
hon. > > Sorry, I forgot to setup a database etc for this example !-) > I meant that I would like to see how to output variables, which you have shown. Thanks. I am stubborn, but I am willing to learn. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
> that? > I used to serve WML-specific "decks" to known mobile UA's, but I've stopped. > I don't have the *slightest* doubt about that. In fact, I'm pretty sure you > can make pretty bad webapplications in pretty much everything you touch. > Good luck with that. > I am a mechanical engineering student, not CS. I am doing this for my own use and enjoyment. I don't need luck with that, I don't have any customers. If someone were to come along asking me to code for them, I would send them to you! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
tion code shouldn't have any > knowledge of this implementation detail - it should receive (a suitable > representation of) an HTTP request, and generate (a suitable representation > of) an HTTP response. Can you provide a code example of printing the variable "torvalds" in

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
"by hand" in your view functions (or request handler >>> methods >>> etc, depending on the framework). >> >> How is this done in Django, then? > > def index(request): >    unmaintanable_html = """ > >   >    Index >   >   >    

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
online. >> or the code that >> manages database connections. Functions that escape data to be sent to >> MySQL (to prevent sql injection) would be nice. > > Any DB-API compliant module already provide this - granted you use it > correctly. > I know. This is will use correctly, I promise! >> Other than that, it's >> all on me. > > Your choice... > Hey! Since when am I not under attack? :) -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
gitb) >>>help(Cookie) >>>help(urlparse) >>>help(os.environ) > > GET variables: > - > import os,cgi > if os.environ.has_key('QUERY_STRING'): >        getv = cgi.parse_qs(os.environ['QUERY_STRING']) >        print getv.ke

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
e on PHP to do this, > > Why so ? Almost any programming language can do CGI. And I settled on PHP because it does what I need. However, I would prefer to move it to Python for the benefit of using the same language in the different places that I code for (such as personal applications for t

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
2009/10/28 Bruno Desthuilliers : > Dotan Cohen a écrit : >>> >>> declarative mapping of urls to code >> >> Apache does this, unless I am misunderstanding you. > > Using url rewriting ? Yes, fine. Then tell me how you implement "reverse" > url ge

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
ime. > > And at least pylons/TG2 lets you return whatever you want instead, as a > string. Not via "print" though - which is simply only for CGI, and no other > means (e.g. mod_wsgi) of python-web-programming. > I am trying to follow you here. What is "return whatev

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
> Even 2.6 is too bleeding-edge?  Uh oh, Fedora 12 is shipping it. > Fedora has traditionally been known as a bleeding edge distro. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
nothing between me and the HTML. The HTTP headers I can output to stdout myself as well. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
er frameworks seem to force the user to use templates. I just want the functions, and to print the HTML as stdout to the browser making the request. I had to settle on PHP to do this, which admittedly is what PHP was invented to do. However, for obvious reasons, I would have prefered to code in Pyth

Re: Web development with Python 3.1

2009-10-27 Thread Dotan Cohen
ces > at the same time. Especially given how notoriously difficult it is to > do automated testing for web development, that's essential. > That's what classes are for, no? Reuse code. I fail to see how using a framework would reduce the need to use classes, provided that the need

  1   2   3   >