15,406 Topics

Member Avatar for
Member Avatar for python_user

Hi Everyone, I have a problem displaying a dicom image properly on PIL(Python Image Library) I have used the code in the following link [URL="http://code.google.com/p/pydicom/wiki/ViewingImages"]http://code.google.com/p/pydicom/wiki/ViewingImages[/URL] but it shows some blur thing and not shows the correct image when i open the same image in dicombrowser it displays clear image but …

Member Avatar for python_user
0
2K
Member Avatar for ihatehippies

How do you keep a wx frame from not responding while the code is running in the background? ie a search or other demanding function.

Member Avatar for ihatehippies
0
913
Member Avatar for nutrion

All, First, thanks for reading! I'm very new to python, and I'm trying to do something that seemingly feels impossible. I'm using Python 3.x to write a script. This script, so far, only runs Windows "net use" command and gets back drive mapping info. The problem is that I need …

Member Avatar for ckoy
0
296
Member Avatar for MUFC4life

Hi i was just wondering if anybody could help me with this code. #! /usr/bin/env python # -*- coding: UTF-8 -*- [CODE]import turtle def initialize ( color = "blue" , smallest = 1.0 ) : turtle.clear ( ) turtle.up ( ) turtle.goto ( -100.0 , 100.0 ) turtle.setheading ( 0 …

Member Avatar for TrustyTony
0
292
Member Avatar for kiddo39

I'm having trouble getting my python scripts to insert into a mysql database. I'm able to do other commands successfully such as adding or dropping tables, selecting items from tables but inserting into tables isn't working. I can manually insert but the script won't do it. I have an entry …

Member Avatar for richieking
0
127
Member Avatar for justaguy101

This is not necessarily a Python or wxPython related question. Let's say i have GUI made with wxPython. How does one implement changing language of the GUI(menu names, help strings etc.) in a correct way. Thanks.

Member Avatar for richieking
0
267
Member Avatar for Thisisnotanid

Hi everyone, I'm new to Daniweb and programming in general. I wrote a program to implement Euler's sieve, and it seems to work for small primes. But, it incorrectly lists certain numbers as primes for larger ranges. For example, for n = 400, it lists 391 as prime. I've gone …

Member Avatar for Thisisnotanid
0
142
Member Avatar for Tcll

KK so I have 2 py files... 1 being the main, and the other, the plugin I have a list var in the main, that I'd like to append data to from the plugin how do I do it?? the data to append: (from plugin) ' ('template', '*.tmp') ' the …

Member Avatar for Tcll
0
617
Member Avatar for Mouche

Zonr and I have been working on a fun text game containing different rooms, monsters (with a D&D-esque battle system), and save/load functions. Here are the files. You need to have all of them for it to work correctly: [URL="http://www.glenwinters.com/RPG/RPG_jan20.py"]www.glenwinters.com/RPG/RPG_jan20.py[/URL] [URL="http://www.glenwinters.com/RPG/data.txt"]www.glenwinters.com/RPG/data.txt[/URL] [URL="http://www.glenwinters.com/RPG/Glen.txt"]www.glenwinters.com/RPG/Glen.txt[/URL] [URL="http://www.glenwinters.com/RPG/George.txt"]www.glenwinters.com/RPG/George.txt[/URL] Here's the main code: [code] import random …

Member Avatar for richieking
0
512
Member Avatar for ChaosKnight11

Hi, I normally only use Linux (Ubuntu) for software development, but I want to test an app on Windows with IE before I make it live. I have Windows 7 Ultimate installed, as well as Python 2.7 and Django 1.2.3 I appended C:\Python27\Scripts to my PATH, and .py to PATHEXT. …

Member Avatar for richieking
0
164
Member Avatar for newbieha

Hello,everyone.Im doing the same project as Slash12 source:[url]http://www.daniweb.com/forums/thread331507.html[/url] I thought the data structure I constructed is correct but I don't know how to test it until my search function works. The errors i have now are: TypeError:__init__() takes exactly 3 arguements(1 given) for i in range(len(board)) has no len() TypeError:object …

Member Avatar for richieking
0
252
Member Avatar for bomko

Hello there. I'm new in python thats why i hope for one quick explanation. I'm making this program just for fun tho i dunno how to really use raw_input in loop. [CODE]from random import * ime_f = raw_input("Vnesi ime fanta: "); priimek_f = raw_input("Vnesi priimek fanta: "); ime_z = raw_input("Vnesi …

Member Avatar for seanbp
0
126
Member Avatar for tammy12w

ok so every time i write this f=open('file.html') p=f.read() this come out and i do not understand it help!! p=f.read() File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8171: ordinal not in range(128) i am trying to open a .html …

Member Avatar for richieking
0
8K
Member Avatar for ultimatebuster

This app will execute and exit right after the process is complete. It will log different things using the logging module. For some reason everytime, no matter if the app execution is a success or a failure, it will tell me an error has occred, and see the log file …

Member Avatar for ultimatebuster
0
103
Member Avatar for FAITH2011

Hi all, I was wondering if someone could help me with this bit of coding. I have set two veriables d1 and d2 to pick a random int of 1 to 10: which I need for in loop but when I run it the same number appear How do I …

Member Avatar for FAITH2011
0
153
Member Avatar for pi_lord12

Hey, I'm new to Python and wondering about the following bit of code. It tells me that the module random has no attribute randint. I've looked at the documentation and such and I think I'm doing it correctly, but obviously something's wrong. Any ideas? Thanks! [code] import random int1=random.randint(1, 6) …

Member Avatar for pi_lord12
0
2K
Member Avatar for jjma

Hi. I'm trying to make a function that takes nested tuples and returns a list of each nested tuple. I managed to make a function that returns the values of the tuples (which are strings), but cannot figure out how to retrieve the 'subtuples' in a list. Here's what I …

Member Avatar for jjma
0
813
Member Avatar for LanierWexford

I have Python 2.7 installed, and I need to use matplotlib, but it is only available for Python 2.6. Is there any way to have 2.6 and 2.7 installed at the same time or is this asking for trouble? The reason I need matplotlib is I am trying to run …

Member Avatar for richieking
0
172
Member Avatar for FAITH2011

[B][COLOR="Red"][B]Hi folk, I fairly new to Python 2.7 and Python 3 and like to find out how I would get a print to appear in the middle of the output screen without putting in a load of spaces into a print statement. Please keep it simple for me. Thanks for …

Member Avatar for FAITH2011
0
167
Member Avatar for FAITH2011

[B][COLOR="Red"]Hi all, Clould someone please tell how to use the sorted function or equivalent to this function in Python 3 so that I can sort a dictionary. I cannot find any help on this. Thanks for your time [/COLOR][/B]

Member Avatar for FAITH2011
0
96
Member Avatar for AndersSilva

Hi guys, I'm new to this forum and I have been studying Python for about 2 weeks. I know most of the beginners can solve all their doubts just by looking at the documentation, but even reading about these modules: time, datetime and threading, I wasn't able to solve one …

Member Avatar for richieking
0
155
Member Avatar for -ordi-

[CODE]sis = file("file.sis", "r") val = file("file.val", "wt") n = int(sis.readline().strip()) la = sis.readline().strip() alist = [] for i in xrange(n): line = sis.readline().strip() alist.append(line.split()) for i in xrange(n): print map(int, alist[i][0].split(":")), map(int, alist[i][1].split(":")) [/CODE] In: [CODE] 07:34 08:55 10 20 08:25 09:00 10 20 [/CODE] Out: [CODE] 08:25 09:00 …

Member Avatar for TrustyTony
0
140
Member Avatar for Python_Doofus

Hi, I am trying to create some patterns in python. I am really struggling as to be quite fair, I don't have a clue what I am doing these are the 3 patterns I am trying to create. any help would be greatly appreciated thank you this is some code …

Member Avatar for woooee
0
130
Member Avatar for mqtgirl

I need to open a webbrowser using python watch the email and password populate in the form, programmatically submit the form and keep the cookies while navigating through the web site. Any help would be greatly appreciated.

Member Avatar for woooee
0
155
Member Avatar for bob24bob

So i've been working on this code that i got online and it is a chat server code. This is the code- [CODE]# import needed modules: from socket import * # get sockets, for well, sockets import string # string functions import time # for sleep(1) function # define global …

Member Avatar for bob24bob
0
806
Member Avatar for yellowkaiq

Hey all, So basically I need to change the code so that the phonebook and the inverse phonebook are easily updated and maintained. Also, whenever I add an entry, both phonebooks need to be updated. Lastly, when I write a phonebook to a file, write a backwards phonebook as well. …

Member Avatar for richieking
-1
420
Member Avatar for HoneyBadger

Guys I am trying to add an image to the window I created, but I get an error message when I run my code: [CODE]import wx class my_window(wx.Frame): app=wx.PySimpleApp() def __init__(self, parent, id): window = wx.Frame.__init__(self,parent,id,'Window', size=(600,400)) window.SetIcon(wx.Icon('porcupine.ico', wx.BITMAP_TYPE_ICO)) if __name__ == "__main__": frame=my_window(parent=None,id=-1) frame.Center() frame.Show() app.MainLoop()[/CODE] The message I …

Member Avatar for richieking
0
2K
Member Avatar for dragonstear

Alright, so i got this question that im given a group of scores in the file, and i have to make them into a list, sort the list, and find the median. I got the sorting and the median done.. But I just got one problem that I can't seem …

Member Avatar for dragonstear
0
132
Member Avatar for jrp370

so i know how to add the numbers in a list recursively [CODE] def ListSum(list): if list = []: return 0 else: return list[0] + ListSum(list[1:]) [/CODE] but how would i go about subtracting a list from a list using recursion? does anyone know how/ where i could go to …

Member Avatar for TrustyTony
0
1K
Member Avatar for Hideyshi

I want to create a script that is constantly running in the background, searching for serial inputs. I have the background and serial input parts worked out. All I want to know is an effective way to constantly search for input, that does not bog down my CPU usage, or …

Member Avatar for Hideyshi
0
101
Member Avatar for _Nestor

Hi im doing a basic script to parse a text file I want to look for a particular set of words. When i find the word then record the lines until there is a line that is blank [code=python] for line in logfile: for word in line.split(): if word in …

Member Avatar for pensaf
-1
212
Member Avatar for efregoso

Hi, so I am trying to create a text file, that holds coordinates of bricks for the game brick breaker. I have a the textfile labeled as level1, and the coordinates are -5,9,0 -4,9,0 -3,9,0 now I am having trouble with getting python to open the file, and read the …

Member Avatar for TrustyTony
0
183
Member Avatar for mrodsho

I can't get my game to work, I've been writing it out fo a couple days, worked at some points, but now isn't. I need to add the happyhouse and plane classes into the game, there are hashmarks letting you know what each is supposed to do. In general, kinda …

Member Avatar for TrustyTony
0
246
Member Avatar for Nyaki Makgoba

Okay, i've just started python a few days ago, and i think i'm doing well considering how quickly I"ve been working, but I've reached a dead end!! I keep encountering an error when using the statement "from sys import argv" In the first code were I had this problem, I …

Member Avatar for TrustyTony
0
247
Member Avatar for JJHT7439

I have a project to do and I'm pretty lost on it. The purpose of the project is to make a game like quoridor, but for this part you only need to have your program ready walls from a file (Walls are given in the format of: (startx, starty)(endx, endy) …

Member Avatar for newbieha
0
606
Member Avatar for brundlefly

Hi guys i wonder if someone can help an absolute noob out with some homework. i was given a brief of: ask a user to input up to 3 mobile numbers. for the numbers entered display the list of numbers entered and clearly displays the mobile network each number belongs …

Member Avatar for brundlefly
0
110
Member Avatar for sanjcee

Hi. I'm trying to make a grade forecasting program for python 2.7. My problem is that I'm having difficulty trying to correlate the first "grade element" input with the first "grade element percentage" input. Here's what I have so far. ## Grade Forecast ## Chandiramani Grade Forecast [CODE]import random print …

Member Avatar for richieking
0
110
Member Avatar for bhysen

Hello, can anyone help me on the fellowing... Write a function that will take two arguments: a word to be searched for and a list of strings containing the grid. The function should search for a horizontal left-to-right or vertical downwards occurrence of the word (e.g. activex and capslock in …

Member Avatar for richieking
0
123
Member Avatar for HoneyBadger

Guys, I just started tinkering with Python in a GUI enviorment. But I have a question. I a using wx-glade, and it says I can't touch the code between: [CODE]# begin wxGlade: extracode # end wxGlade[/CODE] Here is my code: [CODE]#!/usr/bin/env python # -*- coding: utf-8 -*- # generated by …

Member Avatar for richieking
0
239
Member Avatar for TheSassyDragon

Im trying to make a card class that I can use in other programs, the main goal of this is to make a deck of cards that would be valid, only 52 cards - no repeats, 4 suits - 13 cards each. My problem is I don't know how to …

Member Avatar for lrh9
0
686
Member Avatar for efregoso

Hi, I am trying to make a brick breaker game, but I am stuck. i need help moving the panel, and getting the ball to bounce off of bricks upon collision and erase the bricks. Also I wanted to create two lists, one that contains coordinates, the second would be …

Member Avatar for efregoso
0
2K
Member Avatar for dballar1

I am having some trouble verifying the given data for 'user' against what is already in the users.txt file. An example of a line in the text file is... ('Ralph', '1a1dc91c907325c69271ddf0c944bc72') Where 'Ralph' is what I want to compare against the users input for 'user'. Here is my code so …

Member Avatar for TrustyTony
0
332
Member Avatar for FAITH2011

[B][COLOR="Red"]Hi all, I am dyslexic person and find it very hard to read and write without assistance, I was wondering if there are any good Videos or computer based book that teach Pyton 3.1.3 for begginers that could be recommended. The reason for this is that I can see the …

Member Avatar for SgtMe
0
329
Member Avatar for FAITH2011

Hi all, I am new Phython user and started using Python 2.7 just a couple days ago. I have written this code which is working, But when user put in correct code loop is not breaking ?? just wondering if it could be improved and what book would you recommend …

Member Avatar for griswolf
0
216
Member Avatar for FAITH2011

Hello all, I need a little help with Dictionary statement. My question is it possible to display just one thing for a Dictionary ? I know that Dictionary use Keys and Values so if I have this code. How would I display let say the Dog from Dictionary without printing …

Member Avatar for TrustyTony
0
130
Member Avatar for MUFC4life

i = 1 while i < 10000 and i > 0 and 1 : print " still going ..." i = 2 * i Hi i am new to Python and completley useless at it. Can somebody please explain to me why this code prints "Still going" 14 times. I …

Member Avatar for 15uck
0
135
Member Avatar for plum0922

How do you draw a star in Python, I am really confused over it now This is the program I have so far import helper *helper checks if input is valid or not import ecs10graphics07 as gr * ecs10graphics07 is almost the same as the program Tkinter import math starPoints …

Member Avatar for mastaerf
0
1K
Member Avatar for yellowkaiq

I can't get this to generate random shapes, etc. Basically what I need to do is randomly generate similar lists consisting of: combinations of 'square', 'triangle', 'circle' and 'left'. And random numbers from 1 to 10 for physical dimensions and 10 to 90 for angles Have the program use 'split' …

Member Avatar for woooee
0
2K
Member Avatar for newbieha

its a 9x9 squares. im wondering how to find neighbors. for example the neighbors of[i,j] is [i-1,j][i,j+1][i+1,j][i,j-1] how can i code them? [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, …

Member Avatar for TrustyTony
0
124
Member Avatar for lagspike

A simple physics graph... [code=python]import pylab a_time = range(0,141,10) a_R = [3.0,2.8,2.56,2.36,2.2,2.0,1.86,1.7,1.6,1.43,1.3,1.2,1.1,1.06,0.96] for i in range(0,15): pylab.plot(a_time[i],a_R[i], 'x') pylab.errorbar(a_time[i], a_R[i], 0.5, 0.05) pylab.show() [/code] I'm guessing the [icode]pylab.plot[/icode] line isn't needed, but even with this there is nothing connecting the plots together. I'm pretty sure there wasn't anything extra needed …

Member Avatar for lagspike
0
270

The End.