Re: Tkinter (OOP?) help

2005-01-03 Thread 3c273
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Every time you call newwindow, you rebind self.new to the window just > created. So any close button that works will close the last window opened. > > You need to create a separate class for new windows, each with it's > o

Tkinter (OOP?) help

2004-12-30 Thread 3c273
Hello, I am trying to expand on a tutorial I am working through and I am not understanding something. In the following example if you click on the "New window" button, a new window appears with a "Close me" button in it and if you click on it's "Close me" button, it works. But, if you click the ori

Insert database rows from CSV file

2005-04-04 Thread 3c273
Hello, I have a really simple Access database table with a format similar to this: CustomerName - ProductOrdered - QtyOrdered I have a CSV file with the appropriate values as follows: Customer1, Widget1, 1000 Customer2, Widget2, 3000 etc I have figured out how to insert the data manually from the

Re: Insert database rows from CSV file

2005-04-04 Thread 3c273
niu.edu/its/CSupport/tipoftheweek/tip_080502.shtml > > If you still want to do it programmatically, you will need to > look at csv module to parse the lines. > > Larry Bates > > > > 3c273 wrote: > > Hello, > > I have a really simple Access database table with

Re: Insert database rows from CSV file

2005-04-05 Thread 3c273
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Mon, 4 Apr 2005 15:54:37 -0700, "3c273" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > Thanks for the link, but this is the step I am tryin

Re: Insert database rows from CSV file

2005-04-05 Thread 3c273
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dennis Lee Bieber wrote: > > On Mon, 4 Apr 2005 15:54:37 -0700, "3c273" <[EMAIL PROTECTED]> declaimed > > the following in comp.lang.python: > > > > > >&g

Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread 3c273
Hello, I'm just curious as to why the default rounding in the decimal module is ROUND_HALF_EVEN instead of ROUND_HALF_UP. All of the decimal arithmetic I do is rounded half up and I can't think of why one might use round half even. I googled a bit and didn't really find a good answer. Any insight

Re: Decimal ROUND_HALF_EVEN Default

2006-01-17 Thread 3c273
Thanks to all! Interesting reading. Louis -- http://mail.python.org/mailman/listinfo/python-list

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread 3c273
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > $ python -m timeit -s "import pyConfig" "pyConfig.pyConfig()" > $ python -m timeit -s "import pyConparse" "pyConparse.pyConParse()" > > note that timeit runs the benchmarked function multiple times, so you may want > to

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread 3c273
"John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You appear to know what a switch is. I'm therefore surprised that you > appear not to > know that the convention is that any program that uses > command-line switches should do something informative when run with a -h > sw

WMI Help

2006-07-13 Thread 3c273
Hello, When I run the following at an interactive interpreter on Windows XP, I get the expected results. But if I save it to a file and run it, it generates the following error. (And it generates the same error either way on Windows 2000) import wmi c=wmi.WMI() for item in c.win32_PhysicalMedia():

Re: WMI Help

2006-07-13 Thread 3c273
"Michel Claveau" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Re! > > This script run on my XP : > > > import win32com.client > WMIS = win32com.client.GetObject(r"winmgmts:root\cimv2") > objs = WMIS.ExecQuery("select * from Win32_PhysicalMedia") > for obj in objs: > print obj.S

Re: WMI Help

2006-07-13 Thread 3c273
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 3c273 wrote: > > Hello, > > When I run the following at an interactive interpreter on Windows XP, I get > > the expected results. But if I save it to a file and run it, it gener

Re: Instead of saving text files i need as html

2006-06-08 Thread 3c273
"Shani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have the following code which takes a list of urls > "http://google.com";, without the quotes ofcourse, and then saves there > source code as a text file. I wan to alter the code so that for the > list of URLs an html file is s

Re: Instead of saving text files i need as html

2006-06-08 Thread 3c273
"Shani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have the following code which takes a list of urls > "http://google.com";, without the quotes ofcourse, and then saves there > source code as a text file. I wan to alter the code so that for the > list of URLs an html file is s

Re: Instead of saving text files i need as html

2006-06-08 Thread 3c273
"3c273" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Or is this what you mean? > -begin- > import urllib > urlfile = open('c:\\temp\\url.txt', 'r') > newurlfile = open('c:\\temp\\newurls.html', '

Re: Customized Boot Manager in Python

2006-06-13 Thread 3c273
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now, I have to create a visual interface for such kind of small > program. > > I have 2 questions > (i) How can we use operating system specific commands like ssh within > the python program (ii) Which grphics library (wxPython or any ot

Re: OS specific command in Python

2006-06-21 Thread 3c273
"Avell Diroll" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ##Python Script : > from subprocess import Popen > p1 = Popen(["dmesg"], stdout=PIPE) > p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE) > output = p2.communicate()[0] I was just trying to learn how to use .commu

Re: OS specific command in Python

2006-06-21 Thread 3c273
"Avell Diroll" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 3c273 wrote: > > I was just trying to learn how to use .communicate() and all of the examples > > I see have [0] after .communicate(). What is the significance of the [0]? > > > F

Re: subprocess.Popen on Windows

2006-06-23 Thread 3c273
"madpython" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > playing with subprocess.Popen on Windows I stumbled into the following > problem: > Python 2.4.3 (#69, Mar 29 2006, 17:35:34) > > IDLE 1.1.3 > > >>> import subprocess > >>> p1=subprocess.Popen("c:\\asd.bat") #works OK > >>> p

Re: How to upload a file

2006-12-12 Thread 3c273
"Lad" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Users needs to upload big files upto 100MB.So I think that FTP protocol > would be a solution, but how can I allow users to select the right file > ,on their local disk, via a file dialog ? > > Thank you for your ideas > L. > impo

winsound.MessageBeep

2006-01-30 Thread 3c273
Hello, I was trying to use the MessageBeep fuction to play different system sounds, but using the syntax in the docs, all I can get is the default sound.. While I finally got my sounds to play using PlaySound, I am curious as to what I was doing wrong with MessageBeep. (Win2000 & XP) >From the doc

Re: winsound.MessageBeep

2006-01-30 Thread 3c273
"Larry Bates" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You need to call winsound.MessageBeep(winsound.MB_OK) > > (e.g. MB_OK isn't automatically bound to anything). > Thanks so much Louis -- http://mail.python.org/mailman/listinfo/python-list

Re: installing python on a server?

2006-02-10 Thread 3c273
"Renato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] -snip- > On systems with package management (pretty much all of them, except > Slack) install is a matter of a few commands. And you can automate it, > obviously. Slackware has package management, (pkgtool, installpkg, removepkg,

Simple System Tray Icon

2006-03-02 Thread 3c273
Hello, I have a short looping script that runs in the background (Windows 2000) and I want to have a tray icon so I know that it is running. I have looked at wxTaskBarIcon and the examples on the web and in the demo, but it seems pretty complex and I haven't had any success even getting one to show

Re: Simple System Tray Icon

2006-03-02 Thread 3c273
"Michele Petrazzo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > wxTaskBarIcon is very, very simple! > Into the demo, inside 80 line, you can find all the taskbar work, the > menu connected with the rclick and its image change... > Where do you find this complex? I guess since it

Re: Simple System Tray Icon

2006-03-02 Thread 3c273
"Thomas Heller" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 3c273 wrote: > > Can someone point me to a simple example that just shows an icon? I don't > > need it to anything but show up. Any help is appreciated. > > Louis > > &g

Re: Simple System Tray Icon

2006-03-02 Thread 3c273
"Simon Brunning" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] This is untested, 'cos I'm on a Mac these days, but what you want should look something like: from SysTrayIcon import SysTrayIcon icon = SysTrayIcon('parh/to/icon.ico', "Hover text", {}) How simple do you want? That'

Re: Simple System Tray Icon

2006-03-02 Thread 3c273
quoted This is untested, 'cos I'm on a Mac these days, but what you want should look something like: from SysTrayIcon import SysTrayIcon icon = SysTrayIcon('parh/to/icon.ico', "Hover text", {}) How simple do you want? /quoted I guess I still don't get it. The code you supplied c

Re: Opening files without closing them

2006-03-06 Thread 3c273
"Erik Max Francis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Note quite. The assignment of the resources to its variable needs to be > done before the try: > > f = open(file) > try: > contents = f.read() > finally: > f.close() > Pardon the newbie question, but could you

Re: Comparing bitmap images for differences?

2007-05-01 Thread 3c273
> Those are my ideas so far but I thought it would be worth asking here > first in case there are some known-good algorithms for doing this kind > of thing rather than me trying to re-invent a wheel that ends up > triangular... > > Thanks! > Matthew. > This might get you started. http://tinyurl.c

Why does the _winreg module start with an underscore

2006-05-19 Thread 3c273
Does it signify something? Just curious. Louis -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does the _winreg module start with an underscore

2006-05-19 Thread 3c273
"Erik Max Francis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 3c273 wrote: > > > Does it signify something? Just curious. > > Dear quasar, > > Typically an identifier starting with an underscore signifies something > that is not int

Re: Removing the Close, Min, Maximize and frame with ANY gui toolkit

2008-02-05 Thread 3c273
Google for overrideredirect(). Louis "Daniel Folkes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I was wondering if anyone knew how to remove the Minimize, Maximize > and Close from the frame around a gui. > Removing everything would work even better. > > I would prefer instructi

Re: Looking for Advanced Python Tutorials

2008-04-04 Thread 3c273
Thanks for this. Louis "Ravi Kotecha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Apr 4, 12:58 pm, [EMAIL PROTECTED] wrote: > > I was wondering if anyone knew of some online (free if possible) > > advanced tutorials, especially ones that provides tasks and ideas for > > small

Re: Opening files without closing them

2006-03-07 Thread 3c273
"Robert Kern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul Rubin wrote: > > Say that the open is inside the try block. If the file can't be > > opened, then 'open' raises an exception, 'f' doesn't get set, and then > > the 'finally' clause tries to close f. f might have been

Re: Opening files without closing them

2006-03-08 Thread 3c273
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > So this is better, though probably excessive in small scripts: > > try: > f = open('file') > except IOError: > # do something else > else: > try: > content = f.read() > finally: > f.

Re: Opening files without closing them

2006-03-08 Thread 3c273
"Bryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > if i really want to handle the exception, then i handle it at a conceptually > "higher" level by wrapping it in an exception which is basically what some > higher-level routine would do anyways. > > > try: > f = open('file)

timeit.py examples in docs generate error

2006-03-09 Thread 3c273
Hello, I was reading the thread on try/except overhead and decided to try Alex's examples but they kept generating exceptions. So I went to the docs and tried the examples there (copied and pasted) with the same results (Win2k, Python 2.4). Any help is appreciated. The output follows: #1 C:\Python2

Re: timeit.py examples in docs generate error

2006-03-09 Thread 3c273
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Window's command processor doesn't recognise single quote marks as > meaning anything special, so your command is passing 4 separate arguments > to timeit.py instead of the 1 argument that a unix shell would be passing. >