Importing a 3rd Party windows DLL for use within th Python

2008-04-04 Thread lee . walczak
Hi,

I have recently started learing how to code/script in Python which I
am realy enjoying. I am new to this game as my background is RF/HW
design engineer so coding is not my first skillset , so please bare
with me!

 I am a little lost with how to procede on this problem. I need to
write a python script enabling me to comunnicate routines to a pico
ADC212 oscilloscope. I have been provided with a windows DLL & a
header filefrom the manufacturer.
Is it possible for someone to provide the information on the steps
necessary to access this DLL and treat it like any other pyd library?
Maybe there is already a tutorial available for performing this task?
Is this task straight forward?

Look forward to 'a' response!

B.Regards,

Lee

Feel free to request more information if you feel it is necessary.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Importing a 3rd Party windows DLL for use within th Python

2008-04-05 Thread lee . walczak

Thankyou kindly for all the details you have provided. IT is nice to
know that there is a community to help.
I will let you know how I get on!

Many Thanks,

Lee

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


Tkinter and TableList - Registering alternative Cell widgets

2008-08-14 Thread lee . walczak
Hi,

I hope someone can help here. I have made lots of progress
implementing a gui application which at present uses the TableList
python wrapper to interface with Tcl TableList implemention.

http://tkinter.unpythonic.net/wiki/TableListTileWrapper,
http://tkinter.unpythonic.net/wiki/TableListWrapper

I wish to change the default Cell Entry Widget ( for Editing ) to a
Combox Box. According the url below, I  can do this my obtaining the
BWidget Tcl library. I also obtained a python wrapper for this.


http://aspn.activestate.com/ASPN/docs/ActiveTcl/8.4/tablelist/tablelistBWidget.html#ComboBox

My problem is that I have to register the combobox widget with the
Tablelist before I can use it ( to replace the Entry widget). The
specific tcl command "tablelist::addBWidgetComboBox" in tcl syntax has
no real bearing here for me. As a namespace 'addBWidgetComboBox' does
not exist. IS this because I have installed Bwidget related packages
incorrectly?

I am not a software developer by profession so this may seem clear to
you guys. There is a real lack of python supporting documentation in
this area and I am really struggling. Is it possible that someone can
help explain the following:

1) Provide any help on the the installation locations of the python
wrappers , bwidget & tablelisttile. For the moment I have just placed
these in the lib/lib-tk folder for convenience.
2) Any help on the the placement of the Tcl package  (
http://tkinter.unpythonic.net/bwidget/) for Bwidget? The Tablelist is
working fine. Does it go in the same folder i.e. \tcl ? The py wrapper
filename is __init__ , can I rename this?
3) Provide any help on how to register the combobox into the Tablelist
so I can use it as an entry widget
4) Any links to this type of information that may help me resolve this
myself.

I appreciate any useful feedback in helping me resolve this "hurdle".
Please feel free to ask more questions if you require more
information.

Best Regards,

Lee Walczak
--
http://mail.python.org/mailman/listinfo/python-list


configuring temporary entry widget of TableList Cell using Python

2008-08-18 Thread lee . walczak
Hi,

I am using Tkinter & the Kevin Walzer's TableList Wrapper for python
implemented GUI:

http://tkinter.unpythonic.net/wiki/TableListWrapper

The TableList has been extremely useful in allowing me to create my
GUI for my engineering requirements, but I have hit a brick wall and
need some assistance.

"I am unable to configure the Temporary Embedded ComboBox List when
the specific TableList cell is selected for editing"

I have a registered the Bwidget Combobox widget so I can use this as
an alternative temporary Entry Widget ( depending on the specific cell
usage) thanks to some assistance from Kevin Walzer ( Many thanks ). I
configure the particular cell's edit window (-editwindow ) for
ComboBox which is working successfully.
The problem I have is I wish to change the "-values" of the Temporary
Combobox Widget i.e. a List that I can specify.
When my "-editstartcommand" is called I firstly get the pathname of
the Temporary Embedded Widget using,
 TEW = editwinpath()
I am then assuming (although I must be wrong!) that I can then do:

 TEW.configure( values=("my","list","of","Strings"))

However, this leads to the exception error ->  TEW does not contain
such an attribute "configure".
My reference for this procedure is (http://objectmix.com/tcl/377931-
communicating-tablelist-embedded-widgets.html but also available from
tcl.tk tablelist coding examples) :

proc editStartCmd {tbl row col text} {
set w [$tbl editwinpath]

switch [$tbl columncget $col -name] {
currency {
#
# Populate the ComboBox and make it non-editable
#
$w configure -values {Dollar Euro Yen ...} -editable no
}

. . .
}

return $text
}

It is this procedure I am trying to replicate in Python. Is it
possible to guide help tell me the right approach here. Of course I
can submit my code to help ( if this is useful ) but the problem I
think clear to see from these summary details.
Please take it easy on me, I am a HW engineer by trade and am slowly
(but surely) gaining more knowledge & experience in the world of
Python (and of course Tkinter)!

B.Regards,

Lee Walczak
--
http://mail.python.org/mailman/listinfo/python-list


Re: configuring temporary entry widget of TableList Cell using Python

2008-08-18 Thread lee . walczak
On Aug 18, 7:01 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > It is this procedure I am trying to replicate in Python. Is it
> > possible to guide help tell me the right approach here. Of course I
> > can submit my code to help ( if this is useful ) but the problem I
> > think clear to see from these summary details.
>
> I'm afraid this is a bit TL;DR for me right now, but you might find more
> patient contributors over at the Tkinter mailing list:
>
>  http://mail.python.org/mailman/listinfo/tkinter-discuss
>
> 

Thanks for the details fredrik, will try here.

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


Tkinter and TableList - Configure the Temporary Embedded Widgets

2008-08-19 Thread lee . walczak
I actually post a topic relating to my problem here:

(http://groups.google.co.uk/group/comp.lang.python/browse_thread/
thread/a073d532c4481bfe?hl=en# )

But I thought it could be useful to place an example of my problem
here aswell. This a small piece of testcode that creates a TableList.
When the cell is selected, a ComboBox Widget is used temporarily
during the editing phase. It is during this ( EditStartCmd call) that
I wish to configure the "values" of the Widget. My question is, ""How
do I do this ?""

The code below returns the error when the cell is selected. :

Traceback (most recent call last):
  File "D:\Python25\lib\lib-tk\Tkinter.py", line 1403, in __call__
return self.func(*args)
  File "D:\PythonWS\TEW Test.py", line 34, in EditStartCmd
TEW.configure(values=("This","Is","A","Test"))  # Here I "try" to
configure the Temporary Widget
AttributeError: '_tkinter.Tcl_Obj' object has no attribute 'configure'

I has also provided a normal bwidget combox box ( which I use for the
Temporary Embedded Widget). It shows the normal method of configuring
the "values" is working, just the method I assume for embedded ones it
not.

Anyone who has experience in Tkinter & Tablelist would really help me
here. It could be something really silly that I do not appreciate and
any clues would really help!

This will also be posted on 
http://mail.python.org/mailman/listinfo/tkinter-discuss

--

import Tkinter
import bwidget
import tktablelist

root = Tkinter.Tk()
TestFr = Tkinter.Frame(root)
TestBox = bwidget.ComboBox(root)
TestBox.configure( values = ("1","two","4rer"))

class TableBuilder:
def __init__(self, Frame, Titles):
self.Table=tktablelist.TableList(Frame,
editstartcommand=self.EditStartCmd,
selecttype="cell",
stretch = "all",
width=20,
)
root.tk.call('tablelist::addBWidgetComboBox')
self.Table.pack()
self.BuildTable(Titles)

def BuildTable(self,Titles):
I = 0
for Title in Titles:
self.Table.insertcolumns("end", 0, Title)
self.Table.columnconfigure("end",editable='yes',
editwindow="ComboBox")
I +=1
for row in range(10):
self.Table.insert("end","")
self.Table.rowconfigure("end", text=(row,row+1,row*row))

def EditStartCmd(self, table, row, col, text):
TEW = self.Table.editwinpath()# Here I
return the Temporary Widget pathname
TEW.configure(values=("This","Is","A","Test"))  # Configure
the Temp Widget - This is wrong! what is right?

Test = TableBuilder(TestFr,['A','B','C'])
TestBox = bwidget.ComboBox(root)
TestBox.configure( text=" This Works!", values = ("1","two","4rer"))
TestFr.pack()
TestBox.pack()
Tkinter.mainloop()
--
http://mail.python.org/mailman/listinfo/python-list


Wx Python - Code Structure & Event Handling

2008-09-09 Thread lee . walczak
Hi,

I have just started writing a GUI using wxpython after finding a
limitation using Tkinter. I have read most tutorials on wxpython and
slowly becoming accustomed considering I started with the latter GUI
tool first!
I must quote first that I am a novice user of python so the issue(s) I
have may seem very obvious but please be patient with me!

I have noticed that all the wxpython references I used for creating my
application(s)  "cram" all the code in the frame subclass. This is
fine when you consider small applications but what about when they
grow into very complex applications? This creates my first question :
Where is it possible to find information on wxpython code practise/
structure when considering complex larger Gui's?

Without any reference I decided to attempt my owm method by breaking
up the top level panels in my frame as individiual class objects. and
then construct the widgets for the panels within the respective
classes. This led to my second problem, how do I use and event in one
Panel to cause an effect in the other Panel ? For example, if I have
button in one Panel and wish to change the text of a label in the
other Panel, what is the best way to do this? Should I break the code
into modules instead?

Of course, you may explain that the way I have approached this is
completely wrong, if so please tell me, I really want to get the basic
structure right before I start making the code more complex.

I look forward to your help

-

I have listed some code below to help explain what concept I wish to
achieve,

import wx

class Frame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None,
title="Application",size=(400,400))
Panel1 = wx.Panel(self, -1,size=(200,200))
Panel2 = wx.Panel(self, -1,size=(200,200))
Sizer = wx.FlexGridSizer(2,2,5,5)
Sizer.Add(Panel1)
Sizer.Add(Panel2)
self.SetSizerAndFit(Sizer)
Util1 = Utils1(Panel1)
Util2 = Utils2(Panel2)

class Utils1():
def __init__(self, Panel):
button = wx.Button(Panel,-1, "Button 1")
Panel.Bind(wx.EVT_BUTTON, self.OnClick, button)
self.Label = wx.StaticText(Panel,-1, "Handler to me",
name="Lab1")
Sizer = wx.BoxSizer(wx.VERTICAL)
Sizer.Add(button)
Sizer.Add(self.Label)
Panel.SetSizerAndFit(Sizer)

def OnClick(self, Evt):
self.Label.SetLabel("you changed me")

class Utils2():
def __init__(self, Panel):
self.button = wx.Button(Panel,-1, "Button 2")
Panel.Bind(wx.EVT_BUTTON, self.OnClick, self.button)

def OnClick(self, Evt):
""" what is the easiest & accepted Method of changing the text
in
a different class instance?"""
pass
#???.SetLabel("you changed me")

app = wx.PySimpleApp()
frame = Frame()
frame.Show()
app.MainLoop()
--
http://mail.python.org/mailman/listinfo/python-list


Re: Wx Python - Code Structure & Event Handling

2008-09-10 Thread lee . walczak

Thanks for the feedback. It is greatly appreciated.
Let me check out your references and see where they take me.
Will post back and let you know how useful this was.

thanks! Lee

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