[FAQTS] Python Knowledge Base Update -- August 7th, 2000

Fiona Czuczman fiona at sitegnome.com
Mon Aug 7 19:54:23 EDT 2000


Hi All,

The latest entries into http://python.faqts.com

I tried to send this last night (and again earlier this morning) but it
doesn't seem to have made it to the list, sorry if it comes through in
triplicate.

regards,

Fiona Czuczman


## New Entries #################################################


-------------------------------------------------------------
Is it possible to integrate JPython and Pythonwin??
Is it possible to integrate JPython and Pythonwin?
http://www.faqts.com/knowledge-base/view.phtml/aid/5200
-------------------------------------------------------------
Curlen Phipps, Fiona Czuczman
Mark Hammond

No.

PythonWin takes advantage of too many modules that aren't available in 
JPython.


-------------------------------------------------------------
How can I create a button that remains 'pushed' when pressed and is
released when pressed again?
http://www.faqts.com/knowledge-base/view.phtml/aid/5211
-------------------------------------------------------------
Fiona Czuczman
Richard Chamberlain

There are two ways to do this (well probably more than two ways :) )

from Tkinter import *
root=Tk()
myVar=IntVar()
checkbutton=Checkbutton(root,text="My
Button",indicatoron=0,varible=myVar)
checkbutton.pack()
def printme(event):
        print myVar.get()
button.bind('<Button>',printme)
root.mainloop()

This way uses a Checkbutton (you could also use a Radiobutton) and the
indicatoron option which makes it look like a button essentially.

The other way:

from Tkinter import *
root=Tk()
button=Button(root,text="My Button")
button.pack()
def changeme(event):
        if button.cget('relief')==SUNKEN:
                button.config(relief=RAISED)
        else:
                button.config(relief=SUNKEN)
button.bind('<Button>',changeme)
root.mainloop()

Which just captures a button event and changes the relief of the button
accordingly.


-------------------------------------------------------------
How do I get 2 copies of PythonWin to run at the same time?
http://www.faqts.com/knowledge-base/view.phtml/aid/5212
-------------------------------------------------------------
Fiona Czuczman
Mark Hammond

pythonwin.exe /nodde

Is the command line that will do it.


-------------------------------------------------------------
How can I check for read only files?
http://www.faqts.com/knowledge-base/view.phtml/aid/5227
-------------------------------------------------------------
Fiona Czuczman
Roger Upole, jepler epler

You can use win32file from the win32 extensions.
import win32file
fileatt = win32file.GetFileAttributes(filename)
print fileatt & win32file.FILE_ATTRIBUTE_READONLY

----------

There's an answer already given for using win32 cals.
On unix, you would a construction like
        os.stat("file.txt")[ST_MODE] & ST_IWUSR
to check if the file-owner has write permissions.

This flag may not exist on NT, and it's not exactly the same as asking
the question "can I (whoever I am) write this file?).


-------------------------------------------------------------
How do I create a popup window with text?
http://www.faqts.com/knowledge-base/view.phtml/aid/5228
-------------------------------------------------------------
Fiona Czuczman
Grant Edwards

#!/usr/bin/python

from Tkinter import *
from SimpleDialog import SimpleDialog

# initialize GUI toolkit

root = Tk()

# pop up a dialog window with some text

SimpleDialog(root,
             text="Hi there\nHere is some text",
             buttons=["OK"],
             default=0,
             title="Demo Dialog").go()

# notice the go()


## Edited Entries ##############################################


-------------------------------------------------------------
Is there a Python MySQL module for use under Windows?
http://www.faqts.com/knowledge-base/view.phtml/aid/4188
-------------------------------------------------------------
Fiona Czuczman, Gerhard Haering
Stefan Franke,Steve Cook

You will find a newer version of MySQLdb (version 0.2.1) on
http://ins-networks.de/gerhard/
It works fine for me connecting to MySQL 2.23/Win2k and
MySQL 2.22/Linux.

-------------
Original text
-------------
Check out

  ZMySQLDA-1.2.0.tar.gz

on the Zope site (www.zope.org). It contains MySQLdb-0.1.2 with some 
Windows patches already applied. I run it sucessfully with the lately 
GPLed MySQL-2.23.19 on Win98.

All you need to do is to edit Setup.in, adjust the paths to your local 
MySQL installation, and run compile.py.

----------------

Go here http://www.mysql.com/downloads/mysql-3.23.html

You can download the official Win9x/NT install package.  MySQL 3.23 is 
now under the GPL so you can get it for windows without paying for it, 
like you have to for 3.22



More information about the Python-list mailing list