15,185 Topics

Member Avatar for
Member Avatar for 15uck

Hi Guys, I've been doing python programming for a few months and I have some code that needs a GUI. All the code does is various print outs to the screen, now in my head this sounds simple enough to convert to a GUI but I can't figure out where …

Member Avatar for 15uck
0
360
Member Avatar for furret

So I have a function called find_positions which gives off values like [101,207] [99, 87] [34, 56] etc. I then have a centre of mass function called CoM which when any region is put in, can find the centre of mass of that region. Herein lies the problem. I need …

Member Avatar for woooee
0
133
Member Avatar for ccandillo

Can someone please tell me why my menubar does not show up? [CODE] #!/usr/bin/env python from Tkinter import * class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.master.rowconfigure(0, weight=1) self.master.columnconfigure(0, weight=1) self.master.title('Test Menu') self.createMenu(master) #self.createShell() def createMenu(self, master): menubar = Menu(master) master.config(menu=menubar) loadmenu = Menu(menubar) loadmenu.add_command(label='Load', command=self.load) loadmenu.add_command(label='Save', command=self.save) loadmenu.add_separator() loadmenu.add_command(label='Quit', …

Member Avatar for woooee
0
348
Member Avatar for kpxny2sk

Hi. I was wondering if theres a way to take a specific item from a list to another list. Here's what I thought would work...: [CODE]def __init__(self, indata): self.data = indata self.total = len(self.data) def getTtestFactorA(self, factorA): ListFactorA = [] for factorA in self.data: ListFactorA.append() return ListFactorA def getTtestFactorB(self, factorB): …

Member Avatar for richieking
0
193
Member Avatar for Blackberryy

This code should draw the concentric circle in a patch design and alternate its colours between, Red, Blue, Green(or whatever the user enters from the validColours list) but it wont work. Somebody fix this please. [CODE]from graphics import * def main(): x = 0 y = 0 while not(3<=x<=9): x …

Member Avatar for Blackberryy
0
120
Member Avatar for barthooper

Hello all, I'm in an intro to Python class and I had to pick a project to do. It involves moving a bucket to collect balls. I tried this with pygame already, might I add, and I decided to do it with just tkinter. My question is as follows. I …

Member Avatar for richieking
0
89
Member Avatar for Xeex

Hi, I got a server with several of IP's at. Those IP's I want to create sockets through and afterwards from a client, and afterwards send a socket to a webpage. The problem is that I want to use the IP that the client is calling to create the socket …

Member Avatar for richieking
0
197
Member Avatar for ChaosKnight11

Hi, I have started a new app in my current Django project and I want to make the new app use its own database. I have found this solution on the web: [URL="http://www.eflorenzano.com/blog/post/easy-multi-database-support-django/"]Django Multi-Database support[/URL] but it seems more like a hack than a supported solution. Do you think this …

0
87
Member Avatar for jludeman

This is not a real program but a feasibility test. The purpose is to: 1. create a bunch of bitmapbuttons on a scrolling window from the contents of an image directory. 2. When the user clicks on their favorite button something should happen. The nice part is that 1 is …

Member Avatar for jludeman
0
269
Member Avatar for SgtMe

Hi there. I have made a program in Python with PyGame and PyOpenGL to test out vertex and pixel (fragment) shaders. I would like to be able to right click on the shader file (just a text file with a custom extension) and choose Open With... and then open with …

Member Avatar for SgtMe
0
232
Member Avatar for MaC-CK

Could use some advice, as always it's greatly appreciated. I know I could have ripped this code off from anywhere but I'm really trying to learn this the right way. Not sure what I am doing wrong here to make my If Elif part of function not work correctly. It …

Member Avatar for SgtMe
0
78
Member Avatar for halien

Hi, I have data which begins with TEXT which is exactly 13 lines (variable number of characters) followed by BINARY DATA (exactly 262144 chars). It looks like: [QUOTE] BASELINE NUM: 258 MJD: 54270 SECONDS: 28321 CONFIG INDEX: 0 SOURCE INDEX: 2 FREQ INDEX: 0 POLARISATION PAIR: RR PULSAR BIN: 0 …

Member Avatar for woooee
0
115
Member Avatar for efregoso

Hi, Im trying to make a brick game, im only allowed to use vpython, not pygame. I am having trouble getting the ball to change direction and to bounce off the bricks, could you look over my code, and lemme me know? if you could email me at <EMAIL SNIPPED> …

Member Avatar for TrustyTony
0
150
Member Avatar for novice20

I need to install python 2.4 on a fedora 3 system. I followed the instructions in [B][url]http://www.python.org/download/releases/2.4/rpms/[/url][/B] i have the following contents in [B]/etc/yum.repos.d/python24.repo[/B] [B][python24] name=Fedora Core 3 - $basearch - Python 2.4 baseurl=http://www.python.org/ftp/python/2.4/rpms/fedora-3/ enabled=1 gpgcheck=1[/B] further following the instructions, [B]rpm --import [url]http://www.python.org/ftp/python/2.4/rpms/KRUD-GPG-KEY[/url][/B] gave me: [B]error: [url]http://www.python.org/ftp/python/2.4/rpms/KRUD-GPG-KEY:[/url] import read failed.[/B] …

0
47
Member Avatar for Kagome

I am writing a chutes and ladders game for a class, and it's mostly working but I can't figure out how to make the chutes and ladders work. Can I please have some hints? [CODE] board = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, …

Member Avatar for SgtMe
0
426
Member Avatar for convoluted

Here's my situation. Let's say I would like to create a thread that continually prints the number 1. When a button is clicked the value should then change to 2. My issue is that I'm unsure how I change a variable in an already running thread. Here's my code: [CODE] …

Member Avatar for Gribouillis
0
256
Member Avatar for Sykee

hello there I'm trying to chroma key an image and i don't really know where to start. I am using python coding with quickdraw as my image displayer. I am trying to: first prompt the user for location of Quickdraw, foreground image and background image. second i want image rasters …

Member Avatar for group256
0
257
Member Avatar for Simplified

Hi All I was hoping for some advice based on the pool of experience here at Daniweb. I've been teaching myself to program in Python and I'm starting to get the hang of it, now I'm able to write small programs to automate administrative tasks as well as some complex …

Member Avatar for Simplified
0
105
Member Avatar for r3bol

[CODE]import ConfigParser replace_name = "Bob" replace_comment = "Bob was here" parser = ConfigParser.RawConfigParser() parser.optionxform = str # make option names case sensitive parser.read("/home/asdf/Dev/python/info_icons/test.desktop") parser.set("Desktop Entry", "Name", replace_name) parser.set("Desktop Entry", "Comment", replace_comment) parser.write(open("modified.desktop", "w"))[/CODE] The code above reads and writes changes to a configuration style file in Linux (actually the one …

0
53
Member Avatar for kaykay07

Okay, so I'm writing this trivia game with graphics and whatnot. I'm not that far along, but every time I try to just have one question come up, all of them do. It's frustrating because I've looked at a ton of examples and can't see where I'm going wrong. Here …

Member Avatar for TrustyTony
0
187
Member Avatar for novice20

[B]hi.... i created a telnet connection to a remote server using telnetlib and excuted few commands using telnet.write. can't a python script residing on the remote host be run using telnet.write? i.e, do something like telnet.write("./script_name.py argument1 arguement2........") after the connection is established?[/B]

Member Avatar for novice20
0
59
Member Avatar for bwbyron

Okay. So I'm writing this snakes and ladders game, and I want to be able to save the scores, but the try/except method seems to be giving me trouble. I feel like it has something to do with the fact that I'm not writing, just reading. But I'm not sure …

Member Avatar for bwbyron
0
198
Member Avatar for patches2835

I am using an Hp Pavilion a1253w running Xp media edition. It has python preinstalled on an hidden hp bin path. If I try to open it ask me to install in folder python22, or select new folder. Can I use this installation, or will it harm what hp is …

Member Avatar for khakilang
0
98
Member Avatar for joejoe92

Hi, I'm trying to create a piece of code which joins a line that matches a string, and the next succeeding line (no matter what this line contains). I'm getting confused at what Regular Expression (RE) to use. So far I have: [CODE] input1 = open("out.txt","r") output1 = open("outp.txt","w") with …

Member Avatar for joejoe92
0
135
Member Avatar for Gh0st93

So her is my problem I have a Macbook running OS 10.6.5 and i have python 2.x and 3.x installed on it and I can run python in the terminal but if I try to run the idle it just bounces for a few seconds then disappears. can anyone help.

Member Avatar for Gribouillis
0
870
Member Avatar for xcstormerlife

I am making essentialy a jeopardy game. the problem I am having is I can't get my correct guesses to change the dashes thats being displayed to the guesses value. here are parts of my code. [ def guessing(self): tite = self.character_ent.get() tite = tite.lower() if tite in self.getName(): newer …

Member Avatar for TrustyTony
-1
94
Member Avatar for kk12345

Hey, So I need help with fractal project, Pythagoras Tree, and below is the code i need to complete. And I really have no idea how to finish. [CODE]from PIL import Image from movieSolution import * import math class ETree(GO): #---------------------- Begin given functions ---------------------------- def __init__(self, color, initSize, order, …

Member Avatar for TrustyTony
0
366
Member Avatar for Peter_TARAS

Hi, I try to read line by line from a file some data. Each line in that file has the following format: x = 78.36734693877551, z = 11.428571428571429 -> amplitude: 8.62847057093655E-6 | phase -1.5707968246742405\n I am trying to extract those four float numbers using regular expression. I came with the …

Member Avatar for Gribouillis
0
172
Member Avatar for neocortex

Hello ALL! I am trying to get number of hits for a larger list of words (>500), with Pygoogle (from: [url]http://code.google.com/p/pygoogle/):[/url] [CODE] g = pygoogle(<some request>) freq = g.get_result_count() [/CODE] Now, after starting success, probably around 200th request, I start to get only "'NoneType' object is unsubscriptable". Is this Google …

Member Avatar for joehms22
0
133
Member Avatar for liran

( It is only in Python 3 ! ) ( The commands to operate this file are at Linux ! : I want to read a file, but it has to be through stdin ( In linux, with "< filename" ) ! And I want to write the same file …

Member Avatar for Gribouillis
0
2K

The End.