Working with dbase files

2005-02-27 Thread Stan Cook
Does anyone know how I can access and read data 
from a dbase (.dbf) file?

Regards,
Stan
--
http://mail.python.org/mailman/listinfo/python-list


Tkinter focus_set use with grid

2006-07-19 Thread Stan Cook
A newbie to Tkinter here. . . . . .

I'm trying to set the focus on an Entry textbox with 
focus_set.  I am using the grid manager.  I created the same 
interface before using the  pack() method and the focus_set 
worked, but now it says

"AttributeError: 'NoneType' object has no attribute 'focus_set'"

Below is the section of the code:

#   CREATES THE GUI FOR DCN INPUT
def get_dcn():
master = Tk()
_dcn = StringVar()
label1 = Label(text="Enter DCN:",width=10).grid(row=0)
txtbox = Entry(relief=SUNKEN, width=20, takefocus=1, 
textvariable=_dcn).grid(row=0, column=1)
txtbox.focus_set()
btnOK= 
Button(text="OK",command=assign_dcn(_dcn)).grid(row=1, column=0)
btnCancel = Button(text="Cancel", 
command=killer).grid(row=1, column=1)
master.mainloop()
return

Does anyone know where I went wrong?

Regards. . . .

__S Cook
-- 
http://mail.python.org/mailman/listinfo/python-list


create a text file

2006-05-29 Thread Stan Cook
I'm writing a script to list all of my music files' id3 tags 
to a comma delimited file.  The only part I'm missing seems 
like it should be the simplest.  I haven't used Python for 
the last couple of years.  My question is this:

When I use os.open(,"w"), I get an error 
message,TypeError: an integer is required.  Has 
something changed?  Did I miss something???

Thanks,

---> S Cook
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: create a text file

2006-06-04 Thread Stan Cook
Fredrik Lundh wrote:
> Stan Cook wrote:
> 
>> I'm writing a script to list all of my music files' id3 tags to a 
>> comma delimited file.  The only part I'm missing seems like it should 
>> be the simplest.  I haven't used Python for the last couple of years.  
>> My question is this:
>>
>> When I use os.open(,"w"), I get an error 
>> message,TypeError: an integer is required.  Has something 
>> changed?  Did I miss something???
> 
> the function is called "open", not "os.open".
> 
> there's an open function in the os module, but that's doing something 
> slightly different (see the library reference documentation for details 
> if you're curious).
> 
> 
> 
Thanks, I found it.
-- 
http://mail.python.org/mailman/listinfo/python-list


how to get the length of a number

2006-06-11 Thread Stan Cook
Can anyone tell me how to get the length of a number.  I 
know len(string) will get the length of a string, but it 
doesn't like len(int).  I seem to remember something like %s 
string.  I tried to set a variable = to %s int, but that 
doesn't work.  Is there a function I've forgotten about to 
convert an integer to a string?

Regards

Stan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to get the length of a number

2006-06-11 Thread Stan Cook
Saketh wrote:
> Stan Cook wrote:
>> Can anyone tell me how to get the length of a number.  I
>> know len(string) will get the length of a string, but it
>> doesn't like len(int).  I seem to remember something like %s
>> string.  I tried to set a variable = to %s int, but that
>> doesn't work.  Is there a function I've forgotten about to
>> convert an integer to a string?
>>
>> Regards
>>
>> Stan
> 
> Use str(int). Then use len(). For example, len(str(12345)) will give
> you 5.
> 
A! How could I have forgotten that.  Boy is my face red :)

Thanks

I'll try to make my next question a more intelligent one.

Regards,

Stan
-- 
http://mail.python.org/mailman/listinfo/python-list


Database read and write

2006-06-14 Thread Stan Cook
Ok .  I know I'm talking ancient history, but some of us are 
stuck working with them.  Is there anything for python which 
will ope, read, and write to a Dbase 3 or 4 file?  I really 
need your assistance on this one.

Regards,

Stan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Database read and write

2006-06-15 Thread Stan Cook
ftc wrote:
> Stan Cook a écrit :
>> Ok .  I know I'm talking ancient history, but some of us are stuck 
>> working with them.  Is there anything for python which will ope, read, 
>> and write to a Dbase 3 or 4 file?  I really need your assistance on 
>> this one.
> 
> If you work on Windows, there are dbf odbc drivers installed so you can 
> access your dbf files through ODBC driver I think.
I'm working with Linux.
-- 
http://mail.python.org/mailman/listinfo/python-list


Python with Eclipse

2006-06-18 Thread Stan Cook
I've been trying to use Eclipse with Python on Linux for a 
while and have noticed something odd.  After running the 
code or debugging a few times, its responsiveness gets 
really bad.  Upon checking the equivalent of the task 
manager, I find several instances of Python running.  When I 
kill these instances, the responsiveness comes back.  I'm 
not sure if there is a better place to post this, but it is 
Python related.  Is this just an issue with Eclipse or is 
there something else I should inspect?

Any help would be appreciated.

Regards,

S Cook
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python with Eclipse

2006-06-20 Thread Stan Cook
Jason wrote:
> PyDev Eclipse keeps around the python interpreter unless it gets
> removed.  I think part of the point is to keep around failed runs so
> the user can investigate the stack.  Eclipse doesn't keep this around
> if you Run you script, but it will keep the interpreter alive if you
> Debug your script, regardless of how it exits.  (It may dispose of the
> interpreter if your program exits with a normal error code.)
> 
> Anyway, in the Debug View, you can see a list of all the python
> interpreters that PyDev and Eclipse are keeping alive.  There's a set
> of debugging-related buttons just above: step into, step over, step
> return, continue, and others.
> 
> One of the buttons there looks like a couple of "X" symbols.  This
> button officially shuts down a python interpreter.  (Be careful and
> don't actually click the "X" symbol that closes the debug area!)
> 
>   --Jason
> 
> Stan Cook wrote:
>> I've been trying to use Eclipse with Python on Linux for a
>> while and have noticed something odd.  After running the
>> code or debugging a few times, its responsiveness gets
>> really bad.  Upon checking the equivalent of the task
>> manager, I find several instances of Python running.  When I
>> kill these instances, the responsiveness comes back.  I'm
>> not sure if there is a better place to post this, but it is
>> Python related.  Is this just an issue with Eclipse or is
>> there something else I should inspect?
>>
>> Any help would be appreciated.
>>
>> Regards,
>>
>> S Cook
> 
Thanks,  I'll try that and keep an eye on the open sessions.

Regards,

S Cook
-- 
http://mail.python.org/mailman/listinfo/python-list


Another Eclipse Question with Python

2006-06-20 Thread Stan Cook
I followed the help instructions to set a watchpoint for a 
variable, or at lest I tried.  When I hilight the variable 
and go to the run menu, the "toggle watchpoint" is grayed 
out and can't be selected as specified.  Is this Python 
related only?  Just wondering, I want to use the software 
with all of the features it allows if possible.

Thanks

S Cook
-- 
http://mail.python.org/mailman/listinfo/python-list