Re: How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread David Smith
On 2012-09-21 08:57, BobAalsma wrote: This text can be behind a username/password, but for several reasons, I don't want to know those. So I would like to set up a situation where the user logs in (if/when appropriate), points out the URL to my programme and my programme would then be able

Re: Re: 'indent'ing Python in windows bat

2012-09-19 Thread David Smith
On 2012-09-19 05:22, Thomas Rachel wrote: Am 18.09.2012 15:03 schrieb David Smith: I COULD break down each batch file and write dozens of mini python scripts to be called. I already have a few, too. Efficiency? Speed is bad, but these are bat files, after all. The cost of trying to work

Re: Re: 'indent'ing Python in windows bat

2012-09-19 Thread David Smith
On 2012-09-19 14:18, Terry Reedy wrote: stating correctly that it works for exec(). My mistake. I fancied you were talking shell, not python. I now see that Python 3 has exec() as a built-in. python -c exec('print(\hi\)\nif 0:\n print(\hi\)\nelif 1:\n print(\hi2\)') worked right off the

Re: 'indent'ing Python in windows bat

2012-09-18 Thread David Smith
Thank you all. Roy Smith gets the most thanks, though he didn't answer my general question -- he showed me how to look at that specific structure differently. Terry Reedy might get thanks for her idea if I can ever figure the correct escape sequences that will make both windows and the Python

'indent'ing Python in windows bat

2012-09-17 Thread David Smith
Hello, I'm essentially a newbie in Python. My problem in searching the archives is not knowing what words to use to ask. I'm converting windows bat files little by little to Python 3 as I find time and learn Python. The most efficient method for some lines is to call Python like: python -c

Re: SAX: Short tag's ...

2009-10-07 Thread David Smith
Thomas Lehmann wrote: Hi! Is there a way to recognize short tags in a XML? I'm implementing a SAX handler... Problem: storing the XML code I would need this information in the startElement ... How can I handle this? element id=abc / element id=xyz any text/element So ... are you

Re: IDE for python similar to visual basic

2009-09-11 Thread David Smith
r wrote: On Sep 11, 7:08 am, Nobody nob...@nowhere.com wrote: (snip) I'm saying that the user understands their workflow and environment better than the application's programmers. The user should be able to decide which menu items are shown and where, which buttons are shown and where, etc.

Re: Running Sum script

2009-09-04 Thread David Smith
Jul wrote: hello, I have a .txt file that is in this format -- 12625 17000 12000 14500 17000 12000 17000 14500 14500 12000 ...and so on... i need to create a python script that will open this file and have a running sum until the end of file. it sounds really simple its

Re: Running Sum script

2009-09-04 Thread David Smith
Jul wrote: On Sep 4, 2:21 pm, Stephen Fairchild someb...@somewhere.com wrote: Jul wrote: hello, I have a .txt file that is in this format -- 12625 17000 12000 14500 17000 12000 17000 14500 14500 12000 ...and so on... i need to create a python script that will open this file and

Re: obscure problem using elementtree to make xhtml website

2009-09-03 Thread David Smith
Lee wrote: Elementtree (python xml parser) will transform markup like tag boo=baa/tag into tag boo=baa / which is a reasonable thing to do for xml (called minimization, I think). But this caused an obscure problem when I used it to create the xhtml parts of my website, causing

Re: python daemon - compress data and load data into MySQL by pyodbc

2009-09-03 Thread David Smith
MacRules wrote: Sean DiZazzo wrote: On Sep 2, 8:36 pm, MacRules macru...@nome.com wrote: Hi, I installed Python daemon, pyodbc module to access the back-end DB server. My setup is like this load data job - Python Daemon A, port 6000 - Python Daemon B, port 7000 - MySQL Daemon A will

Re: Question on the csv library

2009-08-28 Thread David Smith
vsoler wrote: Thank you very much for all your comments. After reading them I can conclude that: 1- the CSV format is not standardized; each piece of software uses it differently True, but there are commonalities. See http://en.wikipedia.org/wiki/Comma-separated_values 2- the C in

Re: Questions on XML

2009-08-21 Thread David Smith
joy99 wrote: Dear Group, I like to convert some simple strings of natural language to XML. May I use Python to do this? If any one can help me, on this. I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I use Python to help me in this regard? How can I learn good XML

Re: If Scheme is so good why MIT drops it?

2009-07-27 Thread David Smith
Aahz wrote: In article mailman.3765.1248685391.8015.python-l...@python.org, Hendrik van Rooyen hend...@microcorp.co.za wrote: On Sunday 26 July 2009 21:26:46 David Robinow wrote: I'm a mediocre programmer. Does this mean I should switch to PHP? I have searched, but I can find nothing about

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread David Smith
Piet van Oostrum wrote: Hendrik van Rooyen hend...@microcorp.co.za (HvR) wrote: HvR On Monday 20 July 2009 21:26:07 Phillip B Oldham wrote: On Jul 20, 6:08 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: The main reason why you need both lists and tuples is that because a tuple of

Re: Python code for testing well parenthesized expression

2009-07-14 Thread David Smith
Jeremy Sanders wrote: candide wrote: I'm trying to implement in Python a function testing if an expression is well parenthesized. For instance the expression zx4er(1(er(Yy)ol)ol)ik is correctly parenthesized but this one zx(4er(1(er(Yy)ol)ol)ik is not. My code follows at the end. If you

Re: tkinter problem

2009-07-09 Thread David Smith
Paul Simon wrote: Peter Otten __pete...@web.de wrote in message news:h3481q$d95$0...@news.t-online.com... Paul Simon wrote: Chris Rebert c...@rebertia.com wrote in message news:mailman.2863.1247095339.8015.python-l...@python.org... On Wed, Jul 8, 2009 at 4:18 PM, Paul Simonpsi...@sonic.net

Re: Clarity vs. code reuse/generality

2009-07-05 Thread David Smith
kj wrote: In 7x4otsux7f@ruckus.brouhaha.com Paul Rubin http://phr...@nospam.invalid writes: kj no.em...@please.post writes: sense = cmp(func(hi), func(lo)) assert sense != 0, func is not strictly monotonic in [lo, hi] bisection search usually just requires the function to be

Re: logging of strings with broken encoding

2009-07-02 Thread David Smith
Thomas Guettler wrote: Hi, I have bug in my code, which results in the same error has this one: https://bugs.launchpad.net/bzr/+bug/295653 {{{ Traceback (most recent call last): File /usr/lib/python2.6/logging/__init__.py, line 765, in emit self.stream.write(fs %

Re: What text editor is everyone using for Python

2009-05-26 Thread David Smith
Lacrima wrote: I am new to python. And now I am using trial version of Wing IDE. But nobody mentioned it as a favourite editor. So should I buy it when trial is expired or there are better choices? I use Wing IDE and like it. It very nicely enforces consistent space indentations and other

Re: How to walk up parent directories?

2009-05-04 Thread David Smith
Matthew Wilson wrote: Is there already a tool in the standard library to let me walk up from a subdirectory to the top of my file system? In other words, I'm looking for something like: for x in walkup('/home/matt/projects'): ... print(x) /home/matt/projects

Re: Python Noob - a couple questions involving a web app

2009-04-29 Thread David Smith
Kyle T. Jones wrote: Bruno Desthuilliers, my dear, dear friend, there was this time, oh, 4/29/2009 3:02 AM or thereabouts, when you let the following craziness loose on Usenet: Kyle T. Jones a écrit : Been programming for a long time, but just starting out with Python. Not a professional

Re: How to locate the bit in bits string?

2009-04-28 Thread David Smith
Li Wang wrote: 2009/4/29 Tim Chase python.l...@tim.thechases.com: Li Wang wrote: Hi: If I use an integer to represent bits: e.g. 99 represents '1100011' How can I locate, say the second bit of 99(i.e. '1')? Although bin(99)[4] could be used to locate it, this transform cost too much

Re: Modifying the value of a float-like object

2009-04-14 Thread David Smith
eric.le.bi...@spectro.jussieu.fr wrote: It looks like what is needed here are a kind of mutable float. Is there a simple way of creating such a type? I don't mind changing the value through x.value = 1.23 instead of x = 1.23... :) On Apr 14, 3:03 pm, eric.le.bi...@spectro.jussieu.fr wrote:

Re: Floor value in math operators

2009-04-09 Thread David Smith
AggieDan04 wrote: On Apr 8, 12:08 pm, David Smith d...@cornell.edu wrote: Avi wrote: Hi, This will be a very simple question to ask all the awesome programmers here: How can I get answer in in decimals for such a math operator: 3/2 I get 1. I want to get 1.5 Thanks in advance, Avi I'm

Re: Floor value in math operators

2009-04-08 Thread David Smith
Avi wrote: Hi, This will be a very simple question to ask all the awesome programmers here: How can I get answer in in decimals for such a math operator: 3/2 I get 1. I want to get 1.5 Thanks in advance, Avi I'm going to assume your operands are variables instead of numeric

Re: Python Goes Mercurial

2009-04-02 Thread David Smith
Kay Schluehr wrote: On 1 Apr., 07:56, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 35d429fa-5d13-4703- a443-6a95c740c...@o6g2000yql.googlegroups.com, John Yeung wrote: Here's one that clearly expresses strong antipathy:

Re: cross platform accessing paths (windows, linux ...)

2009-03-13 Thread David Smith
Vlastimil Brom wrote: 2009/3/13 hendra kusuma penguinr...@gmail.com: you may want to use os.sep to replace manually written / \ : for each os I heard that unix/linux use / as directory separator while windows use \ and mac os use : Thanks for the notice about the : path separator on mac;

Re: Keeping the Console Open with IDLE

2009-02-20 Thread David Smith
W. eWatson wrote: Matimus wrote: On Feb 19, 8:06 pm, W. eWatson notval...@sbcglobal.net wrote: I'm using IDLE for editing, but execute programs directly. If there are execution or compile errors, the console closes before I can see what it contains. How do I prevent that? --

Re: Keeping the Console Open with IDLE

2009-02-20 Thread David Smith
W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change Directory) in the command prompt window (w/o the

Re: Newbie question: Explain this behavior - a followup

2005-07-20 Thread David Smith
max wrote: David Smith [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: range statements, the example doesn't work. Given that the beginning and ending values for the inner range statement are the same, the inner range statement will never be Is your question about the semantics

Re: Newbie question: Explain this behavior - a followup

2005-07-15 Thread David Smith
First, thanks to those who offered answers. They didn't really answer my question, only because I had not worked through the example sufficiently well. Doing this, I believe I understand what is happening, and, if my understanding is correct, have discovered that for other beginning and ending

Newbie question: Explain this behavior

2005-07-14 Thread David Smith
Why does code snippet one work correctly, but not two. The only difference is the placement of the else. I know that indentation affects execution, but how does it change behavior in the following examples? Thank you. 1. for n in range(2, 10): for x in range(2, n): if n % x ==

Installing new version, erasing previous versions of Python

2004-12-21 Thread David Smith
2.4 without deleting 2.2.2. If I wish to delete 2.3.4, I have to rm -r the appropriate directories. Any caveats? Is there any crosstalk between 2.2.2 and 2.4 modules? Thank you. -- David Smith 1845 Purdue Ave #3 Los Angeles Calif 90025-5592 (310) 478-8050 -- http://mail.python.org/mailman