I have a tkinter app that has 2 frames. The frame on the left has a bunch of buttons and the frame on the right has a text widget. I use the create_buttons function below to make the buttons. Is there a way to have the button stay sunken when clicked. Then when I click the next button that one stays sunken? I want to be able to see the last button clicked. def create_buttons(self): ''' Loop that creates a button for each file in lterrors.txt. The buttons uses the client/server name as its title text and a custom action …

Member Avatar
Member Avatar
+0 forum 2

I am not a big time developer but just a guy to likes to tinker with python. Most of the python scripts I write are for myself. And lately, I started reading up on virtualenv. So I get the wroking on various projects inside a virtualenv is a good thing. Namely code and package isolation. Installing a module in one virtualenv has no affect on another virtualenv. What I don't get is that after a while you have a whole bunch of projects on the go, but, the only way to run them in in a virtual environment. Dosen't that …

Member Avatar
+0 forum 0

I am new to flask and new to git so hopefully someone can help me. This is my git repo: https://github.com/ccandillo/ma-inventory.git I am trying to create a web based spreadsheet. I am storing my data in a sqlite3 database. On my edit page, I would like to be able to edit existing entries and save them back to the database. But I don't know how to get the form data. I also, don't know how to interactively introspect/debug that edit page to see what exists in that namespace. I know you can use request.form.getitems('asset_tag') but it is not working for …

Member Avatar
+0 forum 0

Can someone please tell me why my menubar does not show up? [CODE] #!/usr/bin/env python from Tkinter import * class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.master.rowconfigure(0, weight=1) self.master.columnconfigure(0, weight=1) self.master.title('Test Menu') self.createMenu(master) #self.createShell() def createMenu(self, master): menubar = Menu(master) master.config(menu=menubar) loadmenu = Menu(menubar) loadmenu.add_command(label='Load', command=self.load) loadmenu.add_command(label='Save', command=self.save) loadmenu.add_separator() loadmenu.add_command(label='Quit', command=self.quit) #master.grid() def createShell(self): frame = Frame(width=400, height=300) frame.grid() def load(self): pass def save(self): pass def quit(self): pass root = Tk() app = Application(master=root) app.mainloop() [/CODE]

Member Avatar
Member Avatar
+0 forum 1

I am doing the O'reilly School of Technology course and the current topic deals with Tkinter. It gave me the idea to write this application. The idea is to transfer files to various ftp sites. If I set a default master password, then the password should be used for all sites. If I click the add/remove button it should add/remove a line for the next sites details. Ideaily the remove button should remove the current site from the list, right now it removes the last site(or trys to anyway). Not sure how to keep track of that. I am having …

Member Avatar
Member Avatar
+0 forum 3

I am a programming and python beginner and thought this would be a fun exercise. I wrote this script to mine web pages. First it finds all of the hrefs on the page. Then it takes those urls and searches those pages for content. This is by no means perfect. For one, it searches hrefs only. And two, when I search the page for content I have to give it an offset to find 'text' content. It's not always ideal. I know the code is long and few will read it but I was wondering if anyone had any better …

Member Avatar
+1 forum 0

I cannot seem to figure this out. This part of a larger script that I am writing. I have a list that looks like this. The fields are servername, port and program. How do I sort it to get a tally of what servers are listening on what ports. This is my list: [['server1', '1045', 'winlogon.exe'], ['server1', '8001', 'ctxsgsvc.exe'], ['server1', '3704', 'winlogon.exe'], ['server1', '1043', 'snmp.exe'], ['server2', '1041', 'snmp.exe'], ['server2', '1040', 'bpjava-msvc.exe'], ['server3', '2226', 'winlogon.exe'], ['server4', '1045', 'winlogon.exe'], ['server4', '1049', 'svchost.exe'], ['server5', '1048', 'clussvc.exe'], ['server5', '4660', 'winlogon.exe'], ['server5', '4911', 'winlogon.exe'], ['server6', '2226', 'winlogon.exe'], ['server6', '1045', 'winlogon.exe'], ['server6', '4998', 'unsecapp.exe'], ['server7', '4001', …

Member Avatar
Member Avatar
+0 forum 1

I am connecting to Active Directory using python-ldap to query some information. I am also using getpass to get my password used to bind via ldap. This works just fine. What I am trying to do is to use my currently logged on username/password to bind to active directory so I don's have to type in my password all the time. Does anyone know how to do this?

Member Avatar
+0 forum 0

OK, this may be a dumb question but I'll ask anyway. I am starting to see the benefits of using classes. Most notably code reuse, inheritance and overloading. Shoud I still be writing fuctions in my scripts or do classes make them obsolete? Is there a rule of thumb that if your script has say 20 lines or more you should write a class?

Member Avatar
Member Avatar
+0 forum 4

I have written a script that scrapes a particular website and returns the date of an article, description and url. I want to display this information on the console with clickable text so that when I click on text/link called "site" it will open the url of the article in my default browser. I have been searching google for the best way to do this but I have not found too much. Should I use curses, if so, I am not sure which curses module I should use. Or is there a better/easier way? Any ideas?

Member Avatar
Member Avatar
+0 forum 5

I am trying to run the following screen scraping script but it's not displaying any output. Can someone tell me what I'm doing wrong? [CODE=python] from BeautifulSoup import BeautifulSoup import urllib url = 'http://toronto.en.craigslist.ca/search/cta?query=civic&minAsk=min&maxAsk=max' doc = urllib.urlopen(url).read() soup = BeautifulSoup(doc) tags = soup.findAll('p') for tag in tags: addate = tag.contents[0] path = tag.contents[1].attrs[0][1] desc = tag.next.next.string print addate, path, desc [/CODE]

Member Avatar
Member Avatar
+0 forum 2

I am still reading the learing python o'reilly book and not sure the best way to approch my problem. Given c:\dir1\dir2\dir3. I want to zip all files in dir3 if those files are older than 30 days using 1 zip file (ie. dir_3_files.zip). If all files in dir3 are older 30 days, I want to zip the directory (ie. dir3.zip). I want to recursively keep doing this until I reach the top. This is what I have so far, but I don't know where to interrupt os.walk to work with files in a directory. I hope this makes sense. [CODE] …

Member Avatar
Member Avatar
+0 forum 3

The End.