15,181 Topics

Member Avatar for
Member Avatar for MrKnowNothing

Again I have tried to move on to another program and I am running into another snag. I am trying to write a program that determines if a number is prime. I know the basic format of what I have is pretty close (we talked about it in class), so …

Member Avatar for woooee
0
73
Member Avatar for CoolFool

Hello EVeryone... I really need some help with this problem... A certain CS professor gives 100 - point quiz graded on scale 90 - 100:A 80 - 89:B 70- 79: C , 60 - 60:D <60 :F I need to write a program that eccepts an exam score as input …

Member Avatar for woooee
0
164
Member Avatar for Fox5

Hey all, I'm trying to write a python networking program that is capable of recieving arbitrary files, as well as sending them. However, I can't really get it working, though occasionally a string seems to get through in tact. If someone could look through my code and maybe run it …

Member Avatar for Fox5
0
78
Member Avatar for jliu66

Hi, my friends, I try to use csv module to input data in csv format but split does not work. Could you please help? The input data is 2 column data separated in comma as csv format. The code is following: reader = csv.reader(open('Indices.csv', 'r'), delimiter = ',') line = …

Member Avatar for BearofNH
0
256
Member Avatar for sreejithps

Hi, I created a python script and trying to run it as a windows service. In my script I am reading some data from a configuration file . My problem is , if I run the script in python editor it will work fine and when running the same as …

Member Avatar for BearofNH
0
1K
Member Avatar for 136456

Hi every bod I am new in programming and I like to start with pyqt but I can not find anything for learning in internet please help me how how can I write program with gt designer & when I make a form in qt how can it work(my English …

0
62
Member Avatar for axn

excuse my ignorance, cant find it here in the forum. how do i strip the "|" or the pipe character from a line. i tried this. it splits but doesnt remove the "|" character. output = string.strip (line, '|') # strip the pipe character print output.split() # split output and …

Member Avatar for jrcagle
0
80
Member Avatar for jliu66

Hi, I have a question ask you or expert. Can python's function return a class at the end of function definition. The class have only a set of data members like struct in C. Please help and thanks in advance. Any good reference on this topic? John

Member Avatar for jliu66
0
13K
Member Avatar for manishdhelia

[COLOR=red]if(ikmo.getObjectType() == 'Folder'): [/COLOR] sReturnURL = 'Present?object=1.11.1234' else: sReturnURL = 'Present?object=%s' % (oid) The above code when executed doesn't go inside the "if" condition despite the condition being true. Can anyone tell me where is the problem??? Editor for Python on Daniweb: Please use the [b][noparse][code=python][/noparse][/b] and [b][noparse][/code][/noparse][/b] tag pair …

Member Avatar for vegaseat
0
96
Member Avatar for sreejithps

Hi, I am tryiing to open a file from my python project. The path to the file is given as .\Templates\html\temlate1.html. I used the file Alerter.py to open the above said file. Actually this source file and the Templates directory are existing in the same folder and on execution of …

Member Avatar for vegaseat
0
112
Member Avatar for arkad

Hi I’m trying to use the function os.execv to execute a batch script within my Python script. Second argument for os.execv shall be a tuple or a list and I test to send tuple or a list as second argument, but nothing works, I get different type of error message. …

Member Avatar for arkad
0
1K
Member Avatar for Panarchy

Hello! I was wondering if anyone has a forum backend, in python? I know a bit of python myself, but I want the backend (working backend for a forum) I am going to make the frontend myself (in html, not php, has to be html) Please provide it! Thanks in …

Member Avatar for Panarchy
0
115
Member Avatar for Haze

when i change the state of a entry widget to disabled it greys out automaticly and this doesn't happen with text widgets. I was wondering if there is a specific value i can change for text widgets to make it work the same way as a entry widget. this is …

Member Avatar for jrcagle
0
83
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
72
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
50
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
134
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
143
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
140
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
230
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
165
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
739
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
73
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
120
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
169
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
591
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
116
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
87

The End.