Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Member Avatar for HoneyBadger

Guys, I am trying to change the background color of my window in WxPython. Here is what I got: Why doesn't it work? [CODE]import wx class my_window(wx.Frame): def __int__(self, parent, id): wx.Frame.__int__(self,parent,id,'My Window', size=(300,200)) self.Colours() def Colours(self): self.pnl1.SetBackgroundColour(wx.BLACK) if __name__ == "__main__": app=wx.PySimpleApp() frame=my_window(parent=None,id=-1) frame.Show() app.MainLoop()[/CODE]

Member Avatar for Rufus_1
0
11K
Member Avatar for HoneyBadger

Guys how do I install WxPython in Ubuntu? I tried following the directions here: But to no avail.... [URL="http://wiki.wxpython.org/InstallingOnUbuntuOrDebian"]http://wiki.wxpython.org/InstallingOnUbuntuOrDebian[/URL] Is there an easier way to do this?

Member Avatar for vegaseat
0
318
Member Avatar for HoneyBadger

I am trying to clean my hard drive but when I run by DBAN disk I get this message: non-fatal error /dev/sdb (process crash) P.S I have no USB devices connected.

Member Avatar for JoshuaReen
0
1K
Member Avatar for HoneyBadger

Guys I creating a layout with several different pictures. but when I put them on the site they stack on top of each other. They should be in their respective places on the layout. Instead when I load them, they bunch up in the middle one of top of the …

Member Avatar for weekendrockstar
0
148
Member Avatar for HoneyBadger

I set up a MySQL databse following this tutorial: [URL="http://www.saltycrane.com/blog/2008/07/how-set-django-mysql-ubuntu-hardy/"]http://www.saltycrane.com/blog/2008/07/how-set-django-mysql-ubuntu-hardy/[/URL] Here is what I did: [CODE]$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.51a-3ubuntu5.1 (Ubuntu) Type 'help;' or '\h' for help. Type …

Member Avatar for HoneyBadger
0
2K
Member Avatar for HoneyBadger

Guys I installed mySQLdb in Ubuntu with: [CODE]mydeskt@mydeskt-desktop:~$ sudo apt-get install python-mysqldb[/CODE] but when I go to the python interpreter and type: [CODE]>>> import mySQLdb [/CODE]I get: [CODE] Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named mySQLdb [/CODE]It is installed though, because when …

Member Avatar for HoneyBadger
0
178
Member Avatar for HoneyBadger

Guys I just installed Ubuntu 10.04 last night and I have been struggling to get it to work. Here are my current misfortunes: 1.) Ubuntu won't use my built in speakers(I can use headphones just fine though.) 2.) Microphone wont work 3.) Wont detect wireless card.(To get around this I …

Member Avatar for HoneyBadger
0
222
Member Avatar for HoneyBadger

Guys I just installed Ubuntu 10.4 and it wont detect my wireless networks. Here is my progress so far: 1.) I uninstalled Windows 7 2.) I installed Ubuntu 11.10....but didnt' like the new lay-out. 3.) So I installed Ubuntu 10.04 Ubuntu 11.10 recognized all wireless networks...no probelm. I just didn't …

Member Avatar for mike_2000_17
0
166
Member Avatar for HoneyBadger

Guys I have this string: [CODE]mystring = 'blue, pink, red, red, red, white, long, short, blonde, blonde'[/CODE] I want to: 1.) Split it into a list, 2.) Erase all duplicates 3.) Sort it out alphabetically so I did this: [CODE]mystring = list(set(mystring.split(', '))).sort()[/CODE] But why when I go to call …

Member Avatar for HoneyBadger
0
119
Member Avatar for HoneyBadger

Guys I'm looking for a clean way of splitting a string into a list: I have this: [CODE]myString = 'blue, red, pink, purple'[/CODE] and I want this: [CODE]myString = ['blue', 'red', 'pink', 'purple'][/CODE] How do I do that?

Member Avatar for HoneyBadger
0
154
Member Avatar for HoneyBadger

Guys I am trying to add an image to the window I created, but I get an error message when I run my code: [CODE]import wx class my_window(wx.Frame): app=wx.PySimpleApp() def __init__(self, parent, id): window = wx.Frame.__init__(self,parent,id,'Window', size=(600,400)) window.SetIcon(wx.Icon('porcupine.ico', wx.BITMAP_TYPE_ICO)) if __name__ == "__main__": frame=my_window(parent=None,id=-1) frame.Center() frame.Show() app.MainLoop()[/CODE] The message I …

Member Avatar for richieking
0
2K
Member Avatar for HoneyBadger

Guys, I just started tinkering with Python in a GUI enviorment. But I have a question. I a using wx-glade, and it says I can't touch the code between: [CODE]# begin wxGlade: extracode # end wxGlade[/CODE] Here is my code: [CODE]#!/usr/bin/env python # -*- coding: utf-8 -*- # generated by …

Member Avatar for richieking
0
236
Member Avatar for HoneyBadger

How do I do it? I tried sorting the keys: [CODE]keys = dictionary.keys() keys.sort() return map(dictionary.get, keys) [/CODE] But it didn't work.

Member Avatar for seanbp
0
143
Member Avatar for HoneyBadger

Guys, how do I add an item to a list using a loop? My loop in a nutshell does this: [CODE]for w in book_line.split(" "): word_list = [] if w != "": word_list.append(w.lower()) return word_list[/CODE] While experimenting with this I got mainly two results: 1.) When I use return word_list, …

Member Avatar for HoneyBadger
0
3K
Member Avatar for HoneyBadger

Guys I have a text file, and I am trying to get my program to focus on a specific part of the text. How would I do that? I tried this to no avail: [CODE]f = open("book.txt") f.readlies()[10:3340][/CODE]

Member Avatar for TrustyTony
0
105
Member Avatar for HoneyBadger

It's been a while since I bugged you guys. But I need the council of my wise advisers once more. I am trying to write a program that reads a .txt file, breaks each line into words, strips the whitespace and punctuation from the words and returns them in lowercase. …

Member Avatar for HoneyBadger
0
92
Member Avatar for HoneyBadger

Guys I wrote a program that creates 23 random numbers(birthdays) and the counts how many duplicates are there. How come [B][U]sometimes[/U][/B] when I run this it returns "None"? Here is the code: [CODE]import random #Checks for duplicates. def has_duplicates(userstring): userlist = list(userstring) list_len = len(userlist) len_no_duplicates = len(set(userlist)) if list_len …

Member Avatar for richieking
0
98
Member Avatar for HoneyBadger

Guys I am trying t write this script that finds the age of a daughter through palindromes. Here is the question: Recently I had a visit with my mom and we realized that the two digits that make up my age when reversed resulted in her age. For example, if …

Member Avatar for gwmorris
0
258
Member Avatar for HoneyBadger

Guys I am trying to check the size of a item inside a list. How do I search through a list and return items of a certain size? This is what got: [CODE]#This is meant to search through a .txt file an return the words with 20 characters fin = …

Member Avatar for TrustyTony
0
87
Member Avatar for HoneyBadger

Guys, I am trying to sort a list. But Python does not let me set my new sorted list into a variable. here: [CODE]list1 = ['a', 'z', 'b', 'y'] sorted_list = list1.sort() return sorted_list[/CODE] When I run this on my interpreter, instead of printing my string sorted, it prints "None" …

Member Avatar for ultimatebuster
0
87
Member Avatar for HoneyBadger

Hi, I am trying to split a string and return specific words. I know that using string.split() turns the string into a list of specific words. But how would I go about returning specific words? like the ones that contain certain letters? This is my code so far: [CODE]def e_words(m): …

Member Avatar for TrustyTony
0
183
Member Avatar for HoneyBadger

Hi guys, I am trying to iterate through a list. This is my code: [CODE] #assume this is the list: list1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] def iter_list(a): for s in a: return s #here it is when it runs: print iter_list(list1) a [/CODE] why doesn't it …

Member Avatar for HoneyBadger
0
108
Member Avatar for HoneyBadger

I am trying to add two hexadecimal numbers. [CODE]def addbinary(n1,n2): s = "" carry = '0' for i in range(3,-1,-1): if (n1[i] == '1' and n2[i] == '1' and carry == '0'): s = '0' + s carry = '1' elif (n1[i] == '1' and n2[i] == '1' and carry …

Member Avatar for HoneyBadger
0
331