15,181 Topics

Member Avatar for
Member Avatar for applebiz89

I'm not really to sure with using python and its object oriented features as Im better with java. Im not sure whether to put the functions inside the classes as i can't really seeing this making a difference. I will apply my code and any changes or guidence would be …

Member Avatar for jlm699
0
238
Member Avatar for mr.g.at.lot33

Hello to whom ever can help me out there. I have created a game where the player selects on a suit to bet. this suit will be shared among three dice. if the player gets his symbol shown up on all the dice he wins three times the bet amount, …

Member Avatar for woooee
0
463
Member Avatar for clR3vv

Well I decided to work on a GUI for this because I need the practice. However I ran into this weird problem. If I change line 67 from 1000 to 100 my program prints two of the last letter... [url]http://pastebin.com/d656cfd09[/url] (with 1000) [url]http://www.grabup.com/uploads/195f84b4dab3...f199.png?direct[/url] with (100) [url]http://www.grabup.com/uploads/8fd5d3d988ec...b568.png?direct[/url] That just makes no …

Member Avatar for clR3vv
0
326
Member Avatar for ning2009

Hi, there I have been confused about format control of List. My problem is that I get strange format when exchanging List[-1] with List[-2] using a middle variable. My code is to handle a text file. Old code in a For loop is: [QUOTE]sinf.write('*element,type=s4r,elset=WSLAB\n') path4b2_value[0]=str(int(path4b2_value[0])+100000) path4b3=','.join(path4b2_value) sinf.write(path4b3)[/QUOTE] which produces a …

Member Avatar for ning2009
0
128
Member Avatar for scheda

I'm having a little trouble running wxPython. I did a little Googling and didn't find a whole lot though. Here is a sample of what I'm trying to run... [ICODE]import wx app = wx.PySimpleApp() frame = wx.Frame(None, wx.ID_ANY, "Hello World") frame.Show(True) app.MainLoop()[/ICODE] This code is straight from the tutorial provided …

Member Avatar for vegaseat
0
135
Member Avatar for chardson

hi there, i'm using the PyArg_ParseTuple() function in my python bindings for some C code. the code i'm wrapping has two functions, one that returns a default value instead of an error if an error would have occurred, and one that returns an error. i simply want to use one …

Member Avatar for scru
0
177
Member Avatar for jbskaggs

How does one do the equivalent in Python of GridView in VB? I have a project with hundreds of different info cards with about several individual pieces of data to be tracked on each card. example of card: card 1 name: Zeus image: img1.png level:5 heirarchy:0 type: diety now imagine …

Member Avatar for leegeorg07
0
69
Member Avatar for chardson

hey everyone, does anyone know the python command that forces the interpreter to go interactive? the situation i'm talking about goes like this: [LIST] [*] run script from command line [*] let all kinds of complicated nonsense execute [*] script runs the "go interactive" command [*] python dumps you in …

Member Avatar for chardson
0
176
Member Avatar for d-bug87
Member Avatar for jlm699
0
68
Member Avatar for quietasamouse

How do I take randomly generated numbers and print the average of the numbers? And how do should I go about printing how many even and odd numbers that were generated? Thanks

Member Avatar for lllllIllIlllI
0
75
Member Avatar for sumithar

I created a little script using the datetime functions in python and am trying to convert this to a .exe using py2exe. When I try running this from someone else's machine I get an error message about calendare module not found This is the python [code]import datetime import calendar no_of_days …

Member Avatar for vegaseat
0
635
Member Avatar for JDCyrus

Hi everyone. I need some help with a subprocess. My Python script uses the os.popen2 function to spawn a non-Python subprocess. Now it needs a way to send a Ctrl-C interrupt or something equivalent to the subprocess. Does anyone know how to do this? Thanks in advance!

Member Avatar for woooee
0
5K
Member Avatar for evilsage4

hey all, I'm trying to integrate sqlalchemy into my project build rather than install it separate. so in my project i have "<project_dir>/lib/sqlalchemy/*" i put a the __init__.py in "lib" but when i try to do [icode] from lib.sqlalchemy import * [/icode] i get: [quote] --------------------------------------------------------------------------- ImportError Traceback (most recent …

Member Avatar for woooee
0
90
Member Avatar for Whelk

First of all, forgive my naivete - I'm new to programming and trying to teach myself Python with the aid of the Internet and a book or two. My current problem that I can't find a solution to is hard for me to explain. First, I'll give the code I …

Member Avatar for Whelk
0
1K
Member Avatar for vmars

Greetings; Please, is there a 'python tool' of sorts (ide or whatever) that will convert [U]Python code to 'C' code[/U] . Thanks!

Member Avatar for Nine Tails
0
12K
Member Avatar for DisembodiedLoaf

I'm having trouble with my programs for class. Program 1 Write a function that receives a list as its parameter and returns a list with the length of each element. In the main function print the returned list. [CODE]def elementLength(list): list = raw_input("enter list") return len(list) print elementLength(list)[/CODE] What it …

Member Avatar for sneekula
0
73
Member Avatar for MaxVK

Hi. I have an xml file like this: [CODE=xml]<tree> <category title="Item 1">item 1 text <subitem title="subitem1">subitem1 text</fileitem> <subitem title="subitem2">subitem2 text</fileitem> </category> <category title="Item 2">item 2 text <subitem title="subitem21">subitem21 text</fileitem> <subitem title="subitem22">subitem22 text</fileitem> </category> </tree>[/CODE] I use ElementTree to parse this file and this works okay, however, I now need to …

Member Avatar for MaxVK
0
9K
Member Avatar for hunterm

So, for my assignment I have to make an image look like part of it was a green screen or blue screen or whatever you want to call it (what they use for things like weather forecasts on tv). So that means turning certain pixels blue/green/whatever. I can that much. …

0
67
Member Avatar for marcux

Hi all! I have an drawing area inside a scrolled window. I use the following to redraw my drawing area: [CODE] myDrawingArea.connect("expose-event", self.view_expose) [/CODE] In function view_expose the redrawing is carried out. When I open my window the view_expose function is called all the time and my processor goes crazy! …

0
41
Member Avatar for ning2009

Hi, there I have resource lines and target lines here below resource lines: 1 J=2,7183 SEC=CON450X450 NSEG=2 ANG=0 56 J=7224,164 SEC=CON450X450 NSEG=2 ANG=0 Target lines: *element,type=b31,elset=CON450X4501 *element,type=b31,elset=CON450X45056 "elset=CON450X4501" in the target lines come from a combination of "1" and "SEC=CON450X450". Similarly, "elset=CON450X45056" in the target lines come from a combination …

Member Avatar for ning2009
0
175
Member Avatar for ning2009

Hi, there Thank you so much for reading my question. I have apart of a text file with a structure as following: LOAD NAME=LIVE TYPE=UNIFORM ADD=110 UZ=-4500 ADD=113 UZ=-4500 ADD=114 UZ=-4500 ADD=120 UZ=-4500 ADD=121 UZ=-4500 NAME=SIDL TYPE=UNIFORM ADD=110 UZ=-850 ADD=113 UZ=-850 NAME=CLADDING TYPE=DISTRIBUTED SPAN ADD=15470 RD=0,1 UZ=-4500,-4500 ADD=15471 RD=0,1 UZ=-4500,-4500 …

Member Avatar for ning2009
0
210
Member Avatar for kiddo39

I can't seem to figure out what's wrong with this simple code. I have a user input and if it matches prints out 'That's good', if not prints out 'Too bad' but how can I get the input to ignore being case sensitive? [code] ans=raw_input("Are you feeling well today? ") …

Member Avatar for kiddo39
0
103
Member Avatar for bhanu1225

[B][/B]Hello to all. I am getting more hurdles while trying for the validation for the login from. I did a small project , but i am unable to set the validation for the main login form. I am using some simple logics. [COLOR="Green"][B]try: import os import MySQLdb,md5 import bz2 import …

0
57
Member Avatar for StarZ

the topic is writing/reading text files, but i got this simple question. how do i make this program so it will look like this: [url]http://i39.tinypic.com/5554wi.jpg[/url] i can't figure it out. - to make it keep looping and asking "enter your name or break to exit" continue the question until the …

Member Avatar for vegaseat
0
195
Member Avatar for leegeorg07

hi again! at school we were learning about perfect numbers and i thought it would be useful to write a program to find them i currently have this code: [ICODE]b= 1 h= 1 factors = [1,] n = float(raw_input("what is the number?")) while h < n: if h*b == n: …

Member Avatar for jlm699
0
257
Member Avatar for faniryharijaona

Hi all, Is it possible to copy an object (instance) and manipulate the copy without affecting the original one. I mean, Suppose: D.node = 'Node' and D.child = {0:'child1',1:'child2'}. Now, copy D to D_c and put D_c.child={}. So, D should be kept as it is originaly, which means D.node = …

Member Avatar for scru
0
90
Member Avatar for clareypants

hi everyone, I am having issues with an assignment for university. I know that you are not here to do my work for me but I could really use a little help. My assignment involves a parse file that the uni tutors have written for us and we have to …

Member Avatar for jlm699
0
73
Member Avatar for sneekula

I just bought an inexpensive used Dell notebook that has Ubuntu/Linux as an operating system. Compared to Vista this is sweet. It came with Python25 installed, but it was easy to use the Add/Remove application feature to get open source software from the Ubuntu site. I downloaded/installed Stani's Python Editor …

Member Avatar for MaxVK
0
325
Member Avatar for kiddo39

I am printing out the R,G,B values of an image and get results like this: (30, 0, 0) (29, 0, 0) (28, 0, 0) (27, 0, 0) (26, 0, 0) (25, 0, 0) (24, 0, 6) (23, 0, 0) (22, 0, 0) (21, 0, 0) That is just a partial …

Member Avatar for kiddo39
0
112
Member Avatar for jeffj

Hi, Don't hate me cuz I am a NUB. This may be very basic but I am more basic when it comes to python I simply need to add some variables together some come from a database and some are calculated. but I am getting a very frustrating error [code]TypeError: …

Member Avatar for woooee
0
240

The End.