Re: [Tutor] repeat

2007-11-17 Thread Scott SA
On 11/17/07, Michael ([EMAIL PROTECTED]) wrote: >This has probably been asked before but can I get some clarification on >why Python does not have a repeat...until statement, and does that mean >repeat...until is bad practice? I was trying to get Python on the >standard langauge list for my sta

Re: [Tutor] repeat

2007-11-17 Thread Alan Gauld
"Michael" <[EMAIL PROTECTED]> wrote > This has probably been asked before but can I get some clarification > on > why Python does not have a repeat...until statement, Because Guido didn't put one in repeat/until is never needed it is only ever a nice to have. Indeed some languages don't even ha

[Tutor] More logging probs ...

2007-11-17 Thread dave selby
Im having a bad day. The logging module refused to send anything to syslog no matter what I did, so discovering the syslog module & thought, for what I need I will write a simple class to do the job. class kmotion_logger: def __init__(self, ident, min_priority): # min_priority must b

Re: [Tutor] repeat

2007-11-17 Thread bob gailer
Michael wrote: > Hi All > > This has probably been asked before but can I get some clarification on > why Python does not have a repeat...until statement, and does that mean > repeat...until is bad practice? I was trying to get Python on the > standard langauge list for my state secondary school

Re: [Tutor] More logging probs ...

2007-11-17 Thread Kent Johnson
dave selby wrote: > Im having a bad day. The logging module refused to send anything to > syslog no matter what I did, so discovering the syslog module & > thought, for what I need I will write a simple class to do the job. > > class kmotion_logger: > > def __init__(self, ident, min_priority

Re: [Tutor] More logging probs ...

2007-11-17 Thread dave selby
OK so to condense the problem the following works at LOG_INFO default priority ... def log(self, msg, priority): syslog.openlog(self.ident , syslog.LOG_PID) syslog.syslog('testing message') syslog.closelog() But as soon as I try to set a priority API syslog docs, it fa

[Tutor] repeat

2007-11-17 Thread Michael H. Goldwasser
On Saturday November 17, 2007, Michael wrote: >Hi All > >This has probably been asked before but can I get some clarification on >why Python does not have a repeat...until statement, and does that mean >repeat...until is bad practice? I was trying to get Python on the >

[Tutor] Web programming

2007-11-17 Thread Dinesh B Vadhia
Hi! I want to create (for testing purposes) a straightforward web application consisting of a client that makes simple queries to a backend which returns data from a database (initially pysqlite3). That's it - really! I don't need a professional web server (eg. Apache) per se. Are the Pytho

Re: [Tutor] repeat

2007-11-17 Thread Scott Sandeman-Allen
On 11/17/07, bob gailer ([EMAIL PROTECTED]) wrote: >Michael wrote: >> Hi All >> >> This has probably been asked before but can I get some clarification on >> why Python does not have a repeat...until statement, and does that mean >> repeat...until is bad practice? I was trying to get Python on t

[Tutor] [wxPython-users] How to save file name of file opened from wx.FileDialog ?

2007-11-17 Thread Varsha Purohit
Hello Everyone, In my application i need to select a file using open dialog box. And then i dont need to open the file. I just need to display the name of the selected file in a text control. And then open the file in later part of the program. But i am not able to get the file name and di

Re: [Tutor] Web programming

2007-11-17 Thread Alan Gauld
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote > web application consisting of a client that makes simple queries > to a backend which returns data from a database (initially > pysqlite3). When you say a client do you mean a robotic browser? Or do you mean the web application will be a client/serve

Re: [Tutor] [wxPython-users] How to save file name of file opened fromwx.FileDialog ?

2007-11-17 Thread Alan Gauld
"Varsha Purohit" <[EMAIL PROTECTED]> wrote > later part of the program. But i am not able to get the file name > and > display it in the text control. Here is the sample code. > > Fname = '' #Global variable to hold the file name. You don't need this since its stored in self.filename. > class

Re: [Tutor] Web programming

2007-11-17 Thread Kent Johnson
Dinesh B Vadhia wrote: > Hi! I want to create (for testing purposes) a straightforward web > application consisting of a client that makes simple queries to a > backend which returns data from a database (initially pysqlite3). > That's it - really! I don't need a professional web server (eg.

Re: [Tutor] Web programming

2007-11-17 Thread Michael Langford
While CherryPy is suited to what you're doing, I personally think Mod_Python and Apache are easier to use for this sort of thing. Here is an article showing how to set it up: http://modpython.org/live/current/doc-html/installation.html And a good first quick program that clearly explains what erro

Re: [Tutor] [wxPython-users] How to save file name of file opened fromwx.FileDialog ?

2007-11-17 Thread Varsha Purohit
Hi Alan, I am actually calling the binding function and then writing it into the text value... i tried using simple print in the openfile function and it shows the filename. I am trying to return the file name value but even that is not responding... class ScrolledWindow(wx.Frame): def __i

Re: [Tutor] [wxPython-users] How to save file name of file opened from wx.FileDialog ?

2007-11-17 Thread Varsha Purohit
HI Alan, Thanks for suggestion its working now import wx import os class ScrolledWindow(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(350, 300)) panel = wx.Panel(self, -1) self.txt1 = wx.TextCtrl(panel, -1, p

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Marc Tompkins
Alan Gauld wrote: "Marc Tompkins" <[EMAIL PROTECTED]> wrote > realized I can implement this myself, using 'read(bigsize)' - > currently I'm using 'read(recordsize)'; I just need to add an extra > loop around my record reads. Please disregard... If you just want to navigate to a specific record th

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Kent Johnson
Marc Tompkins wrote: > My question is this: does anybody know of an equivalent to > "readlines(sizehint)" for non-delimited, binary files? I've Googled > and Googled until I'm groggy, but I don't seem to find what I want. Have you tried specifying a buffer size in the open() call? Kent _

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Kent Johnson
I would wrap the record buffering into a generator function and probably use plain slicing to return the individual records instead of StringIO. I have a writeup on generators here: http://personalpages.tds.net/~kent37/kk/4.html Kent Marc Tompkins wrote: > Alan Gauld wrote: > > "Marc

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Marc Tompkins
On Nov 17, 2007 8:14 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Marc Tompkins wrote: > > My question is this: does anybody know of an equivalent to > > "readlines(sizehint)" for non-delimited, binary files? I've Googled > > and Googled until I'm groggy, but I don't seem to find what I want. >

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Marc Tompkins
L'esprit d'escalier - once again I notice something only after hitting Send. How do you reconcile these phrases: > If passed, means file operations are unbuffered and > the system default (which you get if no third argument is passed, and > generally means buffering is enabled) > I think my he

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Marc Tompkins
On Nov 17, 2007 8:20 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > I would wrap the record buffering into a generator function and probably > use plain slicing to return the individual records instead of StringIO. > I have a writeup on generators here: > > http://personalpages.tds.net/~kent37/kk/0