15,181 Topics

Member Avatar for
Member Avatar for guvengunes

Write a function that fills in a given matrix with the given numbers so that the sum of all columns and all rows should be equal to the same number. The prototype for the function should be void fillMatrix(int mat[][MAXSIZE], int numbers[], int rowSize, int colSize, int sum); For example, …

Member Avatar for jrcagle
0
97
Member Avatar for blade321

from livewires import * x= read_number() y= 1234 while x <> y: print read_number() Why wont the loop stop when i enter 1234 ? any help greatly appreciated!

Member Avatar for jrcagle
0
104
Member Avatar for metalx1000

I'm new to Python and even new it GUI with Python. I'm using Glade to create my GUI. My problem is that when I click a button in My GUI inter face the GUI freezes until the process is complete. I'm been told that I need to use "threading" to …

Member Avatar for metalx1000
0
204
Member Avatar for hudson5cp

Hi all! I have a problem with a cycle while and a value list. How to dynamicize them without knowing what are the values in a list? And how do I recall a function ( call in my ex.) with the appropriate value? Thanks Hud [CODE] import tkHyperlinkManager #external lib …

Member Avatar for hudson5cp
0
149
Member Avatar for crackers

Im writing a game and want to know how to write the formula for the winner. So for paper scissors rock, ive written it so the two players enter their choice but i dont know how to write the parameters which show who the winner is. so paper beats rock, …

Member Avatar for a1eio
0
104
Member Avatar for billabong2388

Hi guys, Quick question. Im having some problems with advanced sorting. Say i have the following list: [number] + [text] 3 text_red 7 text_yellow 9 text_blue 1 text_pink 3 text_black 6 text_orange 7 text_white Firstly the list needs to be ordered via the number at the front of the list …

Member Avatar for vegaseat
0
151
Member Avatar for krishnasaradhi
Member Avatar for BearofNH
0
186
Member Avatar for blade321

from livewires import * rn = random_between(1,15) rn1 = random_between(1,15) print 'what is', rn , 'times', rn1 , read_number (': answer =') , ' answer is', ( rn * rn1 ) if (read_number (': answer =')) == ( rn * rn1 ): print 'well done' else: print 'wrong' Does anyone …

Member Avatar for sneekula
0
78
Member Avatar for StepIre

Hi Guys, Sorry if this is so stupid but i just cant get it to work!! Basically if the user enters in a number of words: ------------------------------------ input: my name is i want output to be: mynameis ------------------------------------ or ------------------------------------ input: word one word two i want output: wordonewordtwo ------------------------------------ …

Member Avatar for sneekula
0
257
Member Avatar for cam9856

Hi guys, Im new here and new to python but I'm starting to get the hang of it, i began writing an text rpg to test my skills and to have some fun. I was wondering though how to do something. This is what I am trying to do. You …

Member Avatar for jrcagle
0
105
Member Avatar for donnerCobra

Hi everybody :) I have a big problem with embedded Python. I develop a plugin for a C++ application and want to "teach" this app Python Scripting, that users are able to script their own functions. the App = The C++ Application plugin = my plugin I develop for the …

Member Avatar for donnerCobra
0
199
Member Avatar for Acidburn

Hey guys, I've been playing around all morning trying to get this list to be done programmatically, ie work for any number. I've tried the following but it doesn't give the correct result: [ICODE] a = [ "is", "cool"] b = ["Peter", "James", "John"] c = [] for k in …

Member Avatar for woooee
0
79
Member Avatar for Kythas

I'm trying to parse through a large file (544,000+ rows). I'm pulling information from each row and creating a SQL statement with that information, and trying to remove duplicates. Here is my current code: [code=Python] try: fdata = open(vhdat).readlines() except IOError, detail: print "Error opening file. ", detail # Define …

Member Avatar for jice
0
131
Member Avatar for marceta

Hey guys, I'm working on a basic search engine and am really close to completion. I currently have a function that takes a string and compares each word and its synonyms to a webpage. My output at the moment is [("closeness" percentage of terms to webpage, webpage contents,(x,y),(x,y)...(x,y)] I am …

Member Avatar for jrcagle
0
160
Member Avatar for knish

Hi, scheduler.py has a function weekdaytask. It needs five parameters as stated in the scheduler.py. weekdays and timeonday I figured out. You tell me what is name and action, args=None, kw=None ? BRgds, kNish ===================================================== class WeekdayTask(DayTaskRescheduler, Task): """A task that is called at specific days in a week (1-7), …

Member Avatar for jrcagle
0
163
Member Avatar for CoAstroGeek

Python has some nice features for working with paths: [url]http://docs.python.org/lib/module-os.path.html[/url] Does anybody know of any C/C++ functions, techniques or libraries to do something similar? For example, if I'm passed a path on the commandline as such: x = "~/mystuff/../myfile.txt" In python I could get the absolute path as such: os.path.abspath( …

Member Avatar for vijayan121
0
179
Member Avatar for berserker

Hi! I'm new to python and having some troubles comming off java's very strict and formal OO approach. why does the following code snippet below throw this error, when I'm trying to call GenerateMoves() on an object? NameError: global name 'CheckIfRegularMove' is not defined i am trying to call the …

Member Avatar for Ene Uran
0
158
Member Avatar for Stipsoff

I just wanted to ask something. I have this tool that takes some input and gives some output. Nothing new there. But I have some difficulties with doing it from python. Could you please help out? [icode]1. import subprocess 2. if __name__ == "__main__": 3. subprocess.Popen([r"g_gyrate","-f", "trajktorija.trr", "-s", "cpeptide_md.tpr", "-o", …

0
41
Member Avatar for DumbBlonde89

So I took the instructors example. His is to print a report for Tree, Quantity, Unity Cost, Total cost. I need to make a program that has book name, total quantity sold, total sales. I changed the in file names in his example to what my file names are and …

Member Avatar for DumbBlonde89
0
119
Member Avatar for kushyer

I've found that althought my fonts are fine everywhere else, they're blocky when I Tkinter. I have an LCD screen, and I'm using Xubuntu with Gnome. They work fine in WxPython. It seems like Tkinter doesn't allow for sub-pixel rendering or such (at least automatically). Is there some way to …

Member Avatar for kushyer
0
534
Member Avatar for kushyer

I'm using Xubuntu, and I've found that I can't change text control foreground colors in WxPython, on this Linux. They change fine in Windows. They won't change in Xubuntu—it doesn't matter if I use Xfce, Gnome, or KDE; it's the same. It's always black (very problematic when you have a …

Member Avatar for kushyer
0
292
Member Avatar for a1eio

Hi all! Just wondering if it was possible to be able to create a Tkinter window that can handle files being 'dropped' on it. What i want is to be able to drag a file from an explorer window to a widget on my program (probably an Entry widget) and …

Member Avatar for bumsfeld
0
103
Member Avatar for jayverene

HI I am new to .py and I am having a bit of trouble making the rooms and items do what I want any help will be much appreciated. : ) [code=python] print """ TIBBYS LITTLE ADVENTURE EPISODE ONE Tibby the cat wakes up and is hungry, he decides to …

Member Avatar for jayverene
0
84
Member Avatar for Blujacker

Hello I am trying to create my own email client. I have one problem. I cant parse data from email. I am using poplib -> received email looks like this: [code] ('+OK Message follows (1562 bytes).', ['Reply-To: =?iso-8859-2?Q?Jakub=20Voj=E1=E8ek?= <jakohv@seznam.cz>', 'Received: from kubuvpocitac (r3ai164.net.upc.cz [213.220.226.164])', '\tby email-relay2.go.seznam.cz (Seznam SMTPD 1.0.36@12969) with …

0
58
Member Avatar for i_saw_some

Hi, Does anyone know how to perform web queries programmatically from Python with GET and Post requests? I have been trying out my code on this site - [url]http://www.comp.leeds.ac.uk/Perl/Cgi/textareas.html[/url] [code] import urllib, urllib2 link = 'http://www.comp.leeds.ac.uk/Perl/Cgi/textareas.html' urldata = {'review':"test",'method':'GET'} data = urllib.urlencode(urldata) req = urllib2.Request(link, data) response = urllib2.urlopen(req) the_page …

0
62
Member Avatar for Prachu

Hi.. I am totally new to Python and I have no idea as to where to start from in this issue...I want to write a Python script which should automatically create a new website in the IIS manager...how do I get to start with that???It would be great if somebody …

0
67
Member Avatar for G-Do

Hi all, I add a pygame implementation of the Game of Life to the Code Snippets section. I was actually kind of surprised that we didn't already have one in there! The program only has about 60 lines of code, but I buttressed that with a lot of comments and …

Member Avatar for nish88
0
112
Member Avatar for Acidburn

Hey guys, I've got a class defined has the following: [code] class TData(object) : #Overriden constructor def __init__(self, oc, via ): self.oc = oc self.via = via [/code] now in a separate file I'm trying it iterate through that using recursion. [code] def search(critia, searchSpace, value) : print "Calling search …

Member Avatar for Acidburn
0
252
Member Avatar for shadwickman

Hi, I'm using wxPython (the latest version) and was wondering how to get rid of the scrollbar on the wx.TextCtrl (multiline) object. I couldn't find anything with Google or the search on the forums. Thanks!

Member Avatar for kushyer
0
136
Member Avatar for Islandstone

I'm having trouble running my compiled program on other computers. The script is a wxPython GUI app that creates a task bar icon. The script works perfectly on my computer both standard, in the pdb and compiled. But on two other computers it gave two different errors. The first one …

Member Avatar for Islandstone
0
309

The End.