15,190 Topics

Member Avatar for
Member Avatar for blackrobe

I've been reading an article but the code is written in C language which I don't get at all... The code is: [CODE]void traverse(Tptr p) { if (!p) return; traverse(p->lokid); if (p->splitchar) traverse(p->eqkid); else printf("%s/n", (char *) p->eqkid); traverse(p->hikid); [/CODE] Someone please translate it to python...

Member Avatar for tyincali
0
154
Member Avatar for laspal

Hi, I am trying to create xl file using pyExcelerator in django. response = HttpResponse( mimetype='application/vnd.ms-excel') response['Content-Disposition'] = 'attachment; filename=output.xls' workbook = Workbook() worksheet = workbook.add_sheet('My Test Sheet') worksheet.write(0,0, 'Company', font_style('left', 1, 'red')) worksheet.write(1,1, 'Hello World!', font_style('left', 1, 'black')) workbook.save() return response The problem here is I am not able …

Member Avatar for laspal
0
105
Member Avatar for Clipper34

Hey guys, well my question is i've seen examples of classes being to create like a function. But for example i saw someone made for a socket it was something along the lines of this: pySocket <host> <port> but i'm confused on how to create something like that. To get …

Member Avatar for Gribouillis
0
131
Member Avatar for Lardmeister

I was looking at some statistical evaluations of a dice roll and stumbled onto this strange result: [code=python]import random # faces of a dice dice = [1, 2, 3, 4, 5, 6] rolls = [] for k in range(3): random.shuffle(dice) #test print dice rolls.append(dice) # test print rolls """ my …

Member Avatar for Gribouillis
0
140
Member Avatar for pyth0n

Hi I am created a word guessing game. I have pretty much completed the game, but I cannot get it to do one thing. That is showing the users previous guess along with the new guess. For example, I want it to be like this Guesses Correct apple no blue …

Member Avatar for woooee
0
79
Member Avatar for mathijs

hey i'm currently working on a simple rpg in python. First i was gonna make it text-based but now i've read the wxpython tutorial and i want to try an create a GUI for it. My sister is gonna make some artwork for me (i'm not good at that kind …

Member Avatar for mathijs
0
599
Member Avatar for vmars

Greetings: I am having trouble with reading the code in thread "Tutorial: GUI programming with wxPython" ([url]http://www.daniweb.com/forums/post623598-3.html[/url]) Where tut shows code: [code] import wx """Example with sizers for dynamic resizing.""" app = wx.App(redirect=False) window = wx.Frame(None, title = 'Sample GUI App', pos = (100,100), size = (400,500)) background = wx.Panel(window) …

Member Avatar for vegaseat
0
191
Member Avatar for iamoldest

python 2.4 how do I say... [ICODE] if x is divisible by (random number) then: [/ICODE] in python coding?!? Thanks!!!

Member Avatar for jlm699
0
101
Member Avatar for dinilkarun

Hi All, I have created a two frames(Frame-1 and Frame-2) using BOA Constructor. Frame-1 has a button on it. On click of this button frame-2 is popped up to the user. I want the focus to be set only on Frame-2. What I mean is that: The application should not …

Member Avatar for dinilkarun
0
162
Member Avatar for dinilkarun

Hi all, I have used a status bar on my frame developed in BOA Constructor. I want to split my status bar into two parts in proportion of .75 and .25 i.e., First part should be 75% and 2nd part should be 25% of the total. And then at various …

Member Avatar for dinilkarun
0
169
Member Avatar for pyth0n

Hi, I am creating a game the asks the user if they want to play again at the end. If the user answers yes, I want python to execute the program again starting from the beginning. I have tried searching, but could not find anything. Is there anything in Python …

Member Avatar for pyth0n
0
105
Member Avatar for imcrackinup3

I have a project for which I need to use turtle. I'm very new to python, and our teacher didn't really explain how to use turtle. What's the basic format I need to use to draw a polygon? I have to define a function, polygon(), and run it with two …

Member Avatar for vegaseat
0
76
Member Avatar for MaxManus

When I am trying to install Python on my computer I get the error "administrative rights are required". It is only one account on my computer so I do not understand the message.

Member Avatar for Stefano Mtangoo
0
121
Member Avatar for suresh_iyengar

Hello, I want to fetch a web page and parse links in that. I am using the foll. code [code=python] file =urllib.urlopen("file:///home/suresh/html_parser/Category:Sports.html") content = file.read() # Process the page. [/code] But since the page contains UTF-8 content, its not able to parse it properly. But, if I save the page …

Member Avatar for tyincali
0
100
Member Avatar for massivefermion

Hi Excuse me but i came again Can someone learn me how to work with py2exe? thanks

Member Avatar for lllllIllIlllI
0
100
Member Avatar for dem10

I have been given a project in my Python class that reads in a file, and in the file, 32 attributes are given to determine if a lump is either a benign or a malignant tumor. In my trainClassifier function, I have to find each attributes total for both malin. …

Member Avatar for tyincali
0
200
Member Avatar for Astudent

So I am getting into the swing of python in my class, and am currently trying to take a program from an example, and making it much more condensed. The issue I am having, is there are many classes for a tkinter guessing game. [ICODE]def question5(): if entry5.get() in ["Samus", …

Member Avatar for tyincali
0
125
Member Avatar for Azurea

Hey Daniweb Python forumers, I'm guessing that this is a Vista thing, but when I run my wxPython programs in Vista by double-clicking the file, I get errors from the computer saying that "python.exe has stopped working". I also use the IDLE IDE, so when I run the program from …

Member Avatar for shadwickman
0
136
Member Avatar for dem10
Member Avatar for vmars

What's wrong with this code in Boa: [def OnMenuHelpAboutMenu(self, event) works fine if I use it to open file etc.., but won't work for Dialog2] Thanks! [code=python] #Boa:Frame:Frame2 import wx #import Dialog2 def create(parent): return Frame2(parent) . class Frame2(wx.Frame): . def OnMenuHelpAboutMenu(self, event): # if hasattr(sys, 'debugger_control'): # sys.debugger_control.set_traceable() dlg …

Member Avatar for sneekula
0
537
Member Avatar for oldSoftDev

Hi guys I am back sorry for too late just due to business in class I was unable to visit this site. But for long time I was planning to ask this question but was too busy. I am working on graphic creation in python and I created a basic …

Member Avatar for jlm699
0
93
Member Avatar for hobbz86

write a program that graphically plots a regression line, that is, the line with the best fit through a collection of points.First ask the user to specify the data points by clicking on them in a graphics window. To find the end of input place a small rectangle labeled done …

Member Avatar for jlm699
0
92
Member Avatar for leegeorg07

hi again i have been learning about algorithm solving and designing from the website [URL="http://www.ece.uci.edu/~chou/py02/python.html"]here[/URL] i sort of understood the first code but before i went on any further i wanted to understand it the code is [ICODE]def InsertionSort(A): for j in range(1, len(A)): key = A[j] i = j …

Member Avatar for ZZucker
0
293
Member Avatar for bugmenot

I have tried several things, but I just can't get this to work. What I need is a snippet which scans a program for value X, and then simply assigns a varible within the python script to the X value. I'm new to Python, but not to programming. Please be …

Member Avatar for BearofNH
0
877
Member Avatar for pyth0n

Hi, I am trying to get Python to pick random letters from a given list. However I don't want any repetitions, I just can't seem to figure out how to skip on letters already chose. Any help would be greatly appreciated. Here is what I have so far [code] let …

Member Avatar for pyth0n
0
5K
Member Avatar for ganil123

hi, is there any buitin function like ismethod, to check whether the method exists in the class. for example, Class sample: def fun(): def meth() object = sample(). passing this object(class instance) and fun(function name of class) as inputs i need to find out, whether this function is a member …

Member Avatar for lllllIllIlllI
0
223
Member Avatar for doeman

Could someone help me with this. How do i make a recursive program that returns sum of 1**3 + 2**3 + ... + n**3?

Member Avatar for ZZucker
0
98
Member Avatar for todd8670

looking for a Python/Django Developer in Jersey City NJ. Beloqw is the job description Job Summary: This is a programming position in the technical department of Advance Internet, working on application development, application integration, automated testing and deployment of applications, publishing structure and unit testing in various development environments. Job …

0
55
Member Avatar for johnyboy82

Hi I am new to python programming and I am trying to embed some python calls into my C++ program. I made a simple module called 'test.py' which has the following lines : [code] //---------test.py------------------ message = 'The meaning of life...' def transform (input): input = input.replace ('life', 'Python..'); return …

Member Avatar for Gribouillis
0
2K
Member Avatar for Kezoor

Hello all, Beginning my preparation for python 3.0, I just installed python 2.6 and the adapted wxpython. The problem is I can not run the IDLE neither the Module doc of 2.6. I can run the python command line, and that works. But I want to use the IDLE. After …

Member Avatar for Kezoor
0
139

The End.