Re: Question of speed - Flat file DBMS

2005-03-06 Thread Ian Parker
In message <[EMAIL PROTECTED]>, I.V. 
Aprameya Rao <[EMAIL PROTECTED]> writes
OK, i forgot to mention this.
The speed is a critical issue because there will be a competition and
whosever solution is faster wins the prize.
Hence will a python solution be as fast as a C++ solution??
aprameya
On 4 Mar 2005, John Machin wrote:
I.V. Aprameya Rao wrote:
> Hi
>
> I have to implement a flat file dbms. The basic condition is that
> relations will be given in files and i will have to run certain
select
> project join queries on those relations.
>
> Can someone tell me as to which language will be faster, python or
C++??
Faster to get a working app released: Python
Faster to drive you nuts: C++
Faster processing the files: My hunch is C++, but not by much. After
you've shipped your working app (in Python), you'll still have lots of
spare time to tweak up the speed -- IF it's slow, if anybody notices,
and if anybody cares -- and this newsgroup usually provides a lively
response to "how do I make this faster" questions.


The key to speed is disk caching.  Unless you're doing a profound amount 
of computation on your data, I doubt there'll be any significant 
difference between using Python or C++, except due to how much disk i/o 
is done by the different programs and language environments.

So cache as much as you can- read your entire database into memory if it 
will fit.  If not then try to ensure you can read your entire indices in 
memory.   Create an index for any field you'll be querying on to avoid 
having to read the entire record.  If you're dealing with massive data, 
think about indices of indices. Work on the data, or at least the 
indices. in memory.

Well, that's everything I ever learned about database design.
Regards
Ian
--
Ian Parker
--
http://mail.python.org/mailman/listinfo/python-list


Re: show in GUI stdout of a command

2005-12-25 Thread Ian Parker
In message <[EMAIL PROTECTED]>, twigster 
<[EMAIL PROTECTED]> writes
>Hi,
>
>I need to display in real time the output of a command line tool in a 
>GUI written so far with Tkinter and Pmw. I've got a command line tool 
>that I want to integrate to a GUI. The parameters are set using the GUI 
>and a button executes the command. The calc is long so I need to see 
>how fast it goes. This is given by the stdout...
>
>any idea how to do this?
>
>thanks
>Alexandre

Full of Christmas spirit, I'll suggest a look at
 http://lfw.org/python/Console.py
I find it a few days ago when I was hunting for a way to "print" to the 
tkinter window rather than stdout.

Regards
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python proficiency test

2006-07-23 Thread Ian Parker
In message <[EMAIL PROTECTED]>, Richard 
Jones <[EMAIL PROTECTED]> writes
>Kent Johnson wrote:
>> I recently helped create an on-line Python proficiency test. The
>> publisher of the test is looking for beta testers to try the test and
>> give feedback. If you are interested, here is an announcement from the
>> publisher:
>
>Had a look. In between my browser blocking a popup on every page and the
>registration asking far more details that I felt necessary, I stopped
>before looking at the actual test.
>
>
>Richard
>

Likewise, I wanted to see a sample test (for any subject) but couldn't 
do that without a long-winded registration procedure.

Regards

Ian
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: User defined functions through Automation in Excel 2003

2006-09-17 Thread Ian Parker
In message <[EMAIL PROTECTED]>, 
jpgreenwald <[EMAIL PROTECTED]> writes
>Ive been looking more into this subject and now have a few things to
>add.  Im using some c# code that works in doing what I want (adds the
>function into excel):
>
>using System;
>using System.Runtime.InteropServices;
>
>namespace jtest {
>[ClassInterface(ClassInterfaceType.AutoDual)]
>public class test{
>public test(){
>}
>public double Add2(double x, double y) {
>return v1 + v2;
>}
>}
>}
>
>I messed arround with it and without
>"[ClassInterface(ClassInterfaceType.AutoDual)]" the same thing happens
>that happened in python;  the dll would load but the function is not
>usuable.  So reading some more I was *thinking* that it was the early
>bound calls allowed by the AutoDual Interface that I cant seem to easy
>replicate in python.  Now I was *thinking* again that the only way to
>replicate that would be to use a typelib but I do not know how to
>generate that using a idl file I dont know how to create.  Again I was
>*thinking* that if I had a typelib I could use makepy and then gencache
>so when I use py2exe the typelib would be used and early bound calls
>would be used.
>
>Am I completely Insane and following a completely wrong thought process
>here?  If not, how do I make a idl file (then use midl.exe ?), and then
>make a tbl?  Thanks again for your thought.
>
>-Jesse
>

Darn, I was interested in seeing an answer for this, although dismally 
unable to contribute myself.  Did I miss the responses?

Regards

Ian
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Graphviz Python Binding for Python 2.5 on Windows?

2007-03-06 Thread Ian Parker
In message <[EMAIL PROTECTED]>, Alex 
Li <[EMAIL PROTECTED]> writes
>Thanks Michel, I will give it a try.
>
>Alex
>
>
>

You could simply generate the .dot files from python and do os.startfile 
on the dot file (which is what I do because it is remarkably easy!)

Regards
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How I learned Tkinter

2006-04-23 Thread Ian Parker
In message <[EMAIL PROTECTED]>, 
peter <[EMAIL PROTECTED]> writes
>I've been trying to teach myself Tkinter programming over the last few
>months
>(in a strictly amateur way), and have made a number of requests for
>help in this
>newsgroup and elsewhere.
>
>I've now (sort of) got there - in that I have used Tkinter for some
>programs for
>personal use - and I've written up my experiences at
>
>http://www.aqzj33.dsl.pipex.com/how_i_learned_tkinter/contents.htm
>
>
>In general I found that while Frederik Lundh's tutorial is
>comprehensive and
>well written, there is little else around to help the newcomer working
>without
>the benefit of more experienced colleagues, and that in places the
>documentation
>is too sparse to be of much help.
>
>Any thoughts? Is my experience typical?
>
>Peter
>

Recently I decided to use tkinter because it was included with Python 
and like you I suffered through a few weeks of puzzling out tkinter.  I 
wish I'd read your notes before I started!

Regards

Ian
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: os listdir access denied when run as a service

2006-05-26 Thread Ian Parker
In message <[EMAIL PROTECTED]>, 
Thomas Thomas <[EMAIL PROTECTED]> writes
>Hi All,
>
>I am trying to access a mapped network drive folder. everything works fine
>normally. But when i run the application as service I am getting the error
>
>Traceback (most recent call last):
>  File "docBoxApp.py", line 129, in ?
>  File "core\PollFiles.pyc", line 332, in doPoll
>  File "core\PollFiles.pyc", line 47, in createFileList
>  File "core\PollFiles.pyc", line 25, in addFolderFiles
>WindowsError: [Errno 5] Access is denied: 'G:\\DT Hot Folder test/*.*'
>
>
>below is my code
>
>
>def addFolderFiles(folder,filelist=[]):
>logger=ServerInterface.getErrorLogger()
>folder = folder.encode('ascii') #convert path to ascii for  File Method
>for filename in os.listdir(folder):#line 25
>file=os.path.join(folder,filename)
>logger.error("loop file :"+file);
>if os.path.isfile(file):
>logger.error("is file :"+file);
>if ((not (file.find(".tmp")>=0)) and (not
>(file.find("~")>=0))):
>filelist.append(file)
>elif os.path.isdir(file):
>logger.error("file is a directory :"+file);
>addFolderFiles(file,filelist)
>
>def createFileList(files,folders,filelist=[]):
>logger=ServerInterface.getErrorLogger()
>for file in files:
>file = file.encode('ascii') #convert path to ascii for  File Method
>if os.path.isfile(file):
>   if ((not (file.find(".tmp")>=0)) and (not (file.find("~")>=0))):
>filelist.append(file)
>
>for folder in  folders:
>logger.error("got a folder :"+folder);
>logger.error("it was in the list :"+folders.__str__());
>addFolderFiles(folder,filelist)
>return (1,filelist)
>
>anything I can do about this..
>
>
>-
>Thomas Thomas
>
This may be relevant.   IIRC, when you run a service under the system 
account it doesn't have network access.  You need to run it under an 
account that does have access to the drive.

Regards

Ian
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New python.org website

2006-03-06 Thread Ian Parker
In message <[EMAIL PROTECTED]>, 
Phoe6 <[EMAIL PROTECTED]> writes
>beta.python.org evolved  very nice and noticed today the new python.org
>website going live. There is a change in the look n feel, wherein it
>looks "more official" and maximum possible information about python is
>now directly accessible from the home page itself.  Kudoes to the
>design team.
>
>
>Senthil
>http://phoe6.livejournal.com
>

I like the look of it generally, however two points:
1) There is no way to return to the Home page from the LHS menu.  You 
can click on Python In the logo but that's perhaps not obvious
2) I think the logo is a little faint, washed-out.  I'd prefer something 
more dynamic, or at least brighter.

(I suppose this shows how superficial my checking was!)

Regards

Ian
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What's The Best Editor for python

2006-03-24 Thread Ian Parker
In message <[EMAIL PROTECTED]>, 
flamesrock <[EMAIL PROTECTED]> writes
>I agree, Kate is a great linux editor!
>
>On windows, I'd have to say notepad2- kate for windows
>
Well, Notepad might be a bare-bones.  I enjoy using UltraEdit, though 
not UEStudio (the IDE version).  You can include a "wordfile" to get 
Python syntax recognition.  Tools are user configurable globally or by 
project - my first three global tools are Check (with pychecker), Test 
and Run

Regards

Ian
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python interpreter widget for Tkinter?

2006-04-10 Thread Ian Parker
In message <[EMAIL PROTECTED]>, 
Alexandre Guimond <[EMAIL PROTECTED]> writes
>Hi i was wondering if there already existed a simple python interpreter
>widget for tkinter? Basically, i would like to be able to lauch a
>python interpreter in a seperate window from my tkinter app for
>debugging purposes. I would assume that this would be possible using
>idlelib, but i can't figure out how. Does anyone know how to do this?
>
>thx for any help
>alex
>

Google for  "tkinter console.py" - that did the job for me

Regards

Ian
-- 
Ian Parker
-- 
http://mail.python.org/mailman/listinfo/python-list