15,190 Topics

Member Avatar for
Member Avatar for arkane

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 …

0
67
Member Avatar for tuxworld

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 …

Member Avatar for Toba
0
129
Member Avatar for fedry

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, …

0
51
Member Avatar for tomoconnell

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 …

Member Avatar for vegaseat
0
497
Member Avatar for azadder

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 …

Member Avatar for azadder
0
854
Member Avatar for jech

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 …

Member Avatar for jech
0
500
Member Avatar for Agentbob

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 …

Member Avatar for vegaseat
0
1K
Member Avatar for LarZ

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 …

Member Avatar for vegaseat
0
828
Member Avatar for rmashukov

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 …

Member Avatar for rmashukov
0
109
Member Avatar for geirgp

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 …

Member Avatar for OriginalZeroth
0
144
Member Avatar for rjmiller

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 …

Member Avatar for woooee
0
90
Member Avatar for balance

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 …

Member Avatar for G-Do
0
105
Member Avatar for Tetch

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 …

0
57
Member Avatar for Noliving

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 …

Member Avatar for imamyth
0
107
Member Avatar for Tetch

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 …

Member Avatar for Tetch
0
2K
Member Avatar for jonnim

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 …

Member Avatar for vegaseat
0
98
Member Avatar for eleonora

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

Member Avatar for G-Do
0
315
Member Avatar for MrKnowNothing

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" …

0
71
Member Avatar for mathijs

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 …

Member Avatar for mathijs
0
105
Member Avatar for dreddick4

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. …

Member Avatar for vegaseat
0
101
Member Avatar for im_desperate

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 …

Member Avatar for im_desperate
0
125
Member Avatar for An_Evil_Penguin

Hi. I’m quite new to python and I was hoping someone could help me with a solution. What I’m looking to do is use the print function in conjunction with the time.sleep() (or if theres a better alternative) function to print text on one line with slight delays between text …

Member Avatar for An_Evil_Penguin
0
100
Member Avatar for areebb

While "image" and "picture" are synonymous in English, I'm sure most of you are aware that they are not in Python. By "picture" I'm referring to the type used by the Picture.py module. By "image" I am referring to the type used by Image.py and ImageOps.py. There are useful functions …

Member Avatar for sneekula
0
86
Member Avatar for capri19

I've been struggling with this problem for several days without any luck You are my last hope It is probably an easy one (??) If anybody could give me an example on how to manage cookies i would be extremely grateful. What I'm trying to do is to pass a …

0
69
Member Avatar for jliu66

Hi, My friends, I have aquestion to ask you. I want to output a list of class objects to a file in csv format. but last step in writer.writerow does not work. Can you tell me what's wrong and how should I fixed? I want to output each object of …

0
52
Member Avatar for aot

I'd like a program that reads through one or more weather web pages and records information from them on a daily (or even hourly) basis. Is this kind of thing possible at all to create with python? (Alternatively, if anyone knows of a program that already does this, or a …

Member Avatar for aot
0
106
Member Avatar for Azurea

At the moment, I'm looking for formulas for jumping, falling, accellaration, and de-accellaration (pardon my spelling!). Does anyone have any good formulas for them? Thanks alot!

0
63
Member Avatar for capri19

I have built a web server in python for a local intranet. I would like to get the user's userid when they click on a link on my web page. Is this possible??

Member Avatar for jbennet
0
351
Member Avatar for monkhead

hi i am working on a challenging assignment where i have a list of different animals in an ecosystem and i have to show the relation ships the outpu requires to" # List of all species (in alphabetical order) # List of species at the top of the food chain. …

Member Avatar for vegaseat
0
91
Member Avatar for yelpy

i just got the latest version of python today and im finding it very difficult to understand. im only 15 and would greatly appreciate it if someone would help me understand the basics?

Member Avatar for vegaseat
0
168

The End.