14,945 Topics

Member Avatar for
Member Avatar for maddog39

Hello all, I've been having a ton of trouble with this custom gtk dialog I am trying to create. The code "runs" however I receive a GtkWarning message saying: [code] /home/maddog39/Projects/mmoalert/actiondialog.py:42: GtkWarning: gtk_box_pack_end: assertion `child->parent == NULL' failed self.message_hbox.pack_end(self.message_entry) [/code] For the life of me, I can't seem to figure …

0
71
Member Avatar for jai.mahadeokar

To get an ascii value of a char we have the ascii(c) function in curses.ascii module... but in the curses module _curses module is imported... which is not there in the library hence exception is being generated... can anyone kindly help.. or suggest any other method for conversion...

Member Avatar for jai.mahadeokar
0
105
Member Avatar for tuxworld

hi , In python (pygtk) , how can I create a popup window and attach a picture to it. I want to hide window's titlebar and borders. Actually, I want to show only the picture and nothing else. thanks. can you introducing sample?

0
49
Member Avatar for jai.mahadeokar

I am trying to use the function cmpfile of the cmp module which returns true or false if filepaths passed are same or not... But the interpreter flashes an error "undefined global name false"... Also it doesnt accept true or false in other functions also.. what might be the problem??? …

Member Avatar for Pierre Maurette
0
133
Member Avatar for jliu66

Hi, my friends, I am new to python. I have a question to ask you a empty class with a set of data memebers. The data members could be array. what is wrong with the following code? Thanks in avvance. # define an empty calss class temp: pass # copy1 …

Member Avatar for BearofNH
0
89
Member Avatar for mathijs

I'm having a problem trying to create a game. the point of the game is to guess a random number. i'm learning python and i tought it would be a good exercise. everything went fine (if you dont count syntax errors :)) until i tried to save the program. i …

Member Avatar for mathijs
0
142
Member Avatar for Agentbob

1+1 is 10 in binary and then you carry over the 1. I was wondering how to do that with Python? I was able to invert the binary and determine the sum of the rightmost bit and if it's 2, the rightmost digit would become 0. This is where I'm …

Member Avatar for Agentbob
0
139
Member Avatar for jliu66

Hi, Ny friends, This is my 2nd week to learn and wite codes in python. I encounter a debug error in the last line of code or SizeDiffE(k) = j . I could not figure out? I am using SPE IDE 0.8.3 to debug. for k in range(1, NoE): for …

Member Avatar for woooee
0
228
Member Avatar for jliu66

Hi, Could u please help me to sort this 3 dimension data in python? How can sort this 5 by 3 array with 1st column or last column? Thanks a lot. marek brutalski 20 zenia markownikowa 10 teresa parufkowa 90 bogumila pierdawa 40 genowefa tempawa 50 John

Member Avatar for Lardmeister
0
164
Member Avatar for jliu66

Hi, I am newie to python. How I combine 2 multi-dimension array into one by column? here is an exmaple: a = 1 2 3 2 3 4 3 4 5 b = 4 5 6 6 7 8 8 9 1 the combined array should be c = 1 …

Member Avatar for jliu66
0
738
Member Avatar for jobs

Why can't you do this? [code=python] a = [] a.append('1').append('2') [/code] You can only do this: [code=python] a.append('1') a.append('2') [/code]

Member Avatar for tharippala
0
70
Member Avatar for nitriles

Hallo all, Ive got 10 strings of data that i plot into 1 big window, but somehow matplotlib gives me a very strange set-up. I am rather new to matplotlib and python so im kinda stuck now! heres an image of what i get and part of my code: [URL=http://img208.imageshack.us/my.php?image=bildschirmphoto1wh9.png][IMG]http://img208.imageshack.us/img208/8711/bildschirmphoto1wh9.th.png[/IMG][/URL] …

Member Avatar for nitriles
0
117
Member Avatar for Agentbob

I'm trying to convert decimal to binary and I'm having a lot of trouble (new to python). I was wondering why that won't work. Thanks. EDIT: Argh, I'm so sorry but I got it fixed. It turns out that the assigned variables are on the wrong side.

Member Avatar for vegaseat
0
168
Member Avatar for jobs

I am looking at this recipe: [url]http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440509[/url] When I tried to do it, doesn't work. why? [CODE]>>> from sets import Set >>> new_list = [2,34,5,5,6,6,7,2] >>> print new_list [2, 34, 5, 5, 6, 6, 7, 2] >>> new_list = Set(new_list).elems Traceback (most recent call last): File "<interactive input>", line 1, …

Member Avatar for vegaseat
0
550
Member Avatar for MrShoot

I've always wondered how can I work with this. Suppose I want to create a for loop that prints "Hello!" from 0 to 50 for example. I know I can use a while loop for it, but that's not how I want it to work. Say k = 0, total …

Member Avatar for MrShoot
0
50
Member Avatar for jliu66

Hi, My friends, I am new to python. I try to figure out how python knows the end of loop or the end of a block of codes in while... else code Here is the example: while E: Bt else: Bf here if Bf have 20 lines of code. How …

Member Avatar for Lardmeister
0
114
Member Avatar for jobs

what is %r mean? [code=python] "%r tag requires exactly two arguments" % token.contents.split()[0] [/code]

Member Avatar for vegaseat
0
86
Member Avatar for bumsfeld

Is there a way to limit size of a list in Python, so it does not use all memory?

Member Avatar for vegaseat
0
13K
Member Avatar for jliu66

Hi, my friends, I am new to python. I am trying to user csv module to read and write the data in csv. Here is data format. # of columns in each row are the same. 1st row is a header. how I can pass the data into 2-D array? …

Member Avatar for paddy3118
0
99
Member Avatar for jobs

Can someone tell me what is the different between default_age and self.default_age? Only one default_age variable is created for all instance of class Student and self.default_age means very instances of class Student gets a variable default_age? How do you specify a static class(singleton class) in python? [code=python] class Student: default_age …

Member Avatar for BearofNH
0
174
Member Avatar for Robbydude629

hello i'm new here but i have made a little python calculator and was wondering, if i wanted to give a copy to my friend how would i change it from a python file to a umm .zip(just an example) file where my friend can just unzip it and use …

Member Avatar for Robbydude629
0
94
Member Avatar for jobs

Why can't I have two different link objects? I create _link and _link2 as empty objects. When I do this: _link2 = _link, it just creates alias _link2 to link object. Same object have 2 aliases _link2 and _link. Is there a way to copy the content of _link to …

Member Avatar for jrcagle
0
107
Member Avatar for animatinator

I'm having problems with storing a wxDateTime object from a wxDatePickerCtrl in a file and then reading it again when the program starts (so I can set the date picker's value to what it was the last time the program was run). When I get the value from the date …

0
49
Member Avatar for MakingMoney

I created a function that creates smiley faces. I want to print more than 1 (with different size and location) on 1 window. How do I do it? Here is the code: [code=Python] from graphics import * def main(): print drawface(Point(40, 40), 20, GraphWin) print drawface(Point(90, 90), 30, GraphWin) print …

Member Avatar for jrcagle
0
84
Member Avatar for jrcagle

Hi all, I see a lot of books teaching beginning Python students to code like this: [code="Python"] def func1(): ... def func2(): ... class Blah(object): ... def main(): ... main() [/code] It strikes me that having people "def main():" and then call main() is a bit silly. In fact, it …

Member Avatar for jrcagle
0
112
Member Avatar for plum0922

Hi, i am having trouble with the While Loop for my homework, I am suppose to write a program that says you owe someone money and then with the beginning balance, interest rate and monthly payment entered, I am suppose to use the While Loop to make sure that the …

Member Avatar for Ene Uran
0
78
Member Avatar for sreejithps

Hello, I am new to python. I have been trying to connect to telnet and feed some data from a server. Its working properly. I used the connectionObj.read_until() method to read the data from the server and made the connection as [code] self.conn = telnetlib.Telnet(so.telnetHost, so.telnetPort)[/code] thats too fine. But …

Member Avatar for jice
0
1K
Member Avatar for raja.geek

hi all, i would like to know the all possible command line options of GGCOV tool... ex:1. ggcov program name 2.ggcov -o dir if anyone of you know this,plz send me the details... Thanks in advance..... RajasekharReddy.B

0
62
Member Avatar for mjsinpl

Hey. any help wud be greatly appreciated. I have just tranferred into the second year of a multimedia course in which they have been doing python programmes. Problem is i have never programmed anything before and have been asked to complete this assignment.:( i dont even know what it is …

Member Avatar for paddy3118
0
77
Member Avatar for MakingMoney

I'm trying to give python a list of numbers like this (5 6 7) and I want it to square each number (or as many numbers as I input). I'm trying out a list comprehension on this. I'm not sure where I'm going wrong. Any help would be great. [code="Python"] …

Member Avatar for jrcagle
0
324

The End.