14,946 Topics
|
|
Hey guys, I don't understand the for loop. Could someone explain it to me? for example [code] >>> # Measure some strings: ... a = ['cat', 'window', 'defenestrate'] >>> for x in a: ... print x, len(x) ... cat 3 window 6 defenestrate 12 [/code] what is x? how does … |
|
I read the message from the queen of the daniweb about surrounding the code with code tags, but I did not understand the message at all. I will enclose this code, and resend it, if necessary if some would explain the "[code]" "[/code]" tag dodad. Basically i have a record … |
|
Im very new to SQL in general, let alone coding it into python. I can interact with a MySQL database just fine for the most part, but im running into some problems here... This is the function in my script that keeps raising errors: [CODE=python] def NewChar(): """ NewChar() - … |
|
Afternoon all, I currently have some excellent opportunities for talented Python Developers in Oxford, UK. I have both contract and permanent positions available on this exciting new project. The contracts are for 4 months with extension possibilities. Both roles are seeking people who can start ASAP!! If you are interested … |
|
Anyone know how I can make a custom titlebar such as the one in windows media player 11 in wxpython? thanks, xtr.eme |
|
Hi, my first post here! I have been using python and wxpython for a short time, and have written a few programs, but they all look the same with the standard grey form background... How could I make a really nice interface in python, like the one on Windows Media … |
|
For some reason I cannot get my CGI Script to work with my Dreamweaver file. I feel like it may have something to do with where I'm saying things are located. For example, the company website that I am working on has its files located on another website. I assume … |
|
Hey guys, new poster so if I am in the wrong spot please just let me know. The below code should read the weather off Yahoo, and create a dictionary containing a bunch of variables and their values from the weather (temp = 9 or whatever), it doesn't. How is … |
|
Ok, So i'm attempting to simulate diffusion through a 2-D plate of multiple concentrations of compounds and my program so far looks something like follows [code=python] from scipy import * from pylab import * #============================================================================== #simulation conditions #============================================================================== nx = 64 # The number of x nodes ny = 64 … |
|
I am a little new to extending python with C. I have been successful at creating modules that take integers, etc and return a value but I am a little confused about passing a numpy array to a C function. I am using swig to generate the wrappers, and handle … |
|
hi evrybody, what is my broblem in this code ? [code] #!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk import time import os,sys class Example: def __init__(self): window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect('destroy', lambda w: gtk.main_quit()) vbox=gtk.VBox(True,0) window.add(vbox) vbox.show() label= gtk.Label() vbox.pack_start(label,True,True,0) label.show() for i in xrange(5) : window.move(200+i,600) time.sleep(.1) label.set_label(str(i)) label.show() pass … |
|
Hi guys, I need help. I'm a real beginner in Python and ANTLR as well.:P I want to parse an AST object to String, so I may want the result of print like this: [B]sim.access.*[/B] instead of: [B] ( . ( . sim access ) * )[/B] Thanks and regards, … |
|
I am getting very strange results from the following: def list(self) import shelve db = shelve.open(testfile) list = [] cnt = 0 for id in db.keys(): print db[id].info() the testfile was written with an class defined object; What i am finding, is if I write 50 objects, the above code … |
|
I am working on an IDE for a specific language. One of the features that I want to implement is syntax high-lighting. The way I plan to go about it: When the user presses a key, a function is called with the entire line that the user is editing as … |
|
Hello, I'm trying to use [URL=http://mediainfo.sourceforge.net/]MediaInfo[/URL] library in python via ctypes. I tried this code: [CODE]import ctypes milib = ctypes.cdll.LoadLibrary("mediainfo.dll") handle = milib.MediaInfo_New() milib.MediaInfo_Open(handle, "D:\temp\video.avi") [/CODE] Unfortunately the last line complaints that there are not enough parameters for that function. I based this on a sample Delphi code, which is … |
|
I'm trying to change the font for the turtle graph. [code] def goto(x,y): turtle.up() turtle.goto(x,y) turtle.down import turtle turtle.tracer(False) turtle.width(3) goto(-270,270) turtle.right(90) turtle.forward(540) turtle.left(90) turtle.forward(540) turtle.left(90) turtle.forward(540) turtle.left(90) turtle.forward(540) goto(50,50)[B] turtle.write('testing')[/B] turtle.tracer(True) [/code] That's a box I created and I want to add text to it. I looked around the … |
|
Can anyone point me in the direction of a small app that displays 2 panels on a frame, where one panel is small and at the top taking up about 20% of the frame, and the other panel takes up 80%. I would like it to be possible using wxBoxSizer … |
|
Program terminated with signal 11, Segmentation fault. Environment: FreeBSD 6.2, Python 2.4.4, MySQLdb 1.2.2, SQLObject 0.9.1 I faced with an error in our multithreaded, network oriented application, wich interacts actively with MySQL database. Brief information from core dump is below (more detailed one is in the file attached). Though I … |
|
I have this url (ISO-8859-1 encoded): file://///companyweb/pr%C3%B8ve.doc which I need transformed into this url (UTF-8 encoded): file://///companyweb/pr%F8ve.doc The difference is the character 'ø' which will be encoded as '%C3%B8' in the first case, and as '%F8' in the latter. In Java I would be able to do this conversion very … |
|
Quick question, I'm not sure how to go about asking this, but I am attempting to write a Laplacian of a scalar field (general function f). I want to be able to put this in an array in order to solve it multiple times. I don't really know how to … |
|
Hi. I don't know anything about python but I need to use a script which I have found on the internet. I don't know where to start. I have installed python on my windows xp desktop and I have also downloaded and put in the Lib folder the file BeautifulSoup.py … |
|
Okay, I'm putting the finishing touches on a program I made that would simulate the game of Roulette at a casino, and I've run into a small problem. Once the player runs out of money, I have a "game over" window that appears to notify them that they are now … |
|
Hello everyone, my problem that I'm have is that I have to get the volume and the surface area of a sphere using a class. I believe I was able to do that part of the problem correctly. The issue I'm having is getting that information to print from the … |
|
With my program, I have been trying to simulate the game of Roulette (at a casino) with a GUI, but I have a problem that I can't seem to figure out. For some reason, any kind of accumulator for "current funds" I place in the program doesn't seem to work … |
|
I am trying to collect data from a log file. The data will collected into records based on policy number. I have created an object describing the data below: class fwpolicy: def __init__(self, policy_id, fr_zone, to_zone, src,dest,serv): self.policy_id = policy_id self.fr_zone = fr_zone self.to_zone = to_zone self.src = src self.dest … |
|
Hey, I try of saving my board to a text file and then trying to load my board from the text file but actually does not works. If anyone knows how this can be solve let me know ! Thanks |
|
Hello all, I have wrote this program to determine a student's classification: # This program will print out the class standing of an individual # Uses a four way decision process def main(): credits = input ("Enter the number of credits earned: ") if credits >= 26: class_standing = "Senior" … |
|
i have created an oxo game. wich is a game where you try to get 3 in a row in a 9-square field. i got it running but i have one question. for the computer's moves i predicted what the user would do (2in a row) and then made the … |
|
I have to program a simple calculator, i had all of my functions working seperatly but now that they are all together the add and the average won't compute. The problems started when i tried to get the program to loop back to the menu after you get a total. … |
|
code: def rpn(): list = [] while 1: x = raw_input(" ") if x in ["+","-","*","/","%"]: y=str(eval(list[-2]+x+list[-1])) list[-2:]=[y] elif x == "": break elif x == "=": print y else: list.append(x) How can i modify my rpn calculator in order to: 1)accept random number x = random number e.g x … |
The End.