15,181 Topics

Member Avatar for
Member Avatar for MrAbbas

Hello there, I'm writing a simple code to make a n*4 matrix .. first i filled it with zeroes [ICODE]x0 = input("Please enter x0 = ") h = input("Please define step size h = ") s = input("Please specifiy the point at which you need the solution y(x) >> ") …

0
47
Member Avatar for matthewsamdanny

Hey guys! I have a serious problem. I missed class for computer science because I had two grandparents die in 2 weeks. My teacher has a no exception policy for turning in homework late. Tonight has been my only free night to do homework but I am stuck and not …

Member Avatar for adam1122
0
1K
Member Avatar for starzstar

Hi I am using Option parser for creating a command line application . I am able to parse command line options. I have a command for listing the contents of a folder. which goes like this python main.py --listContents When I give this I get an error error: --listContents option …

Member Avatar for adam1122
0
112
Member Avatar for matthewsamdanny

Hey guys! I have a serious problem. I missed class for computer science because I had two grandparents die in 2 weeks. My teacher has a no exception policy for turning in homework late. Tonight has been my only free night to do homework but I am stuck and not …

Member Avatar for adam1122
0
181
Member Avatar for tondeuse34

Hey guys, i just re-installed python and began writing a script, when i go to run it a syntax error appears. The syntax error allways points to the quotes i use, meaning something like [CODE]print "Hello"[/CODE] a syntax error will appear and point at the end quote ' " ' …

Member Avatar for adam1122
0
63
Member Avatar for alicem

'bitstream' is an array where each element contains 8 bits, i.e. ['01100000', '11110101' .... ] etc. etc. I want to print out this array to a file so it'll be recognised and can be opened as a jpeg. I have tried the following: [code]output = open('outputfile.jpg', 'wb') for i in …

Member Avatar for vegaseat
0
167
Member Avatar for mbirame

Hi friends, This is my first post here. Please forgive me as I am a complete novice with Python. I have experience with HTML and CSS, but my main gig is electronics...So, please excuse me if I am out of line asking this question here! A friend was helping me …

Member Avatar for mbirame
0
1K
Member Avatar for harrykokil

hi guys.. i implemented a stopwatch and as i run my software, the stopwatch starts. what i want is to implement a method to start the stopwatch and another method to stop the stopwatch. can u give me an example of this please? thanks..

Member Avatar for harrykokil
0
1K
Member Avatar for thehivetyrant

I'm struggling on how to do this. For example. [code] for i in range (1 ,100): if i % 3 == 2: print i, " mod ", 3, "= 2"[/code] i think i need to understand what this does more. Firstly what does % mean? [B]if i is the square …

Member Avatar for thehivetyrant
0
3K
Member Avatar for thehivetyrant

wow it's me again! i have: [code] i=0 while i<11: print i, print '' i=i+1[/code] this gives the answer: 0 1 2 3 4 5 6 7 8 9 10 i need to give the answer. * * * * * * * * * * * * * * …

Member Avatar for thehivetyrant
0
101
Member Avatar for strobon

hello everybody...have trouble with pygtk and glade. iam working on a simple form with purpose to explain simple ubuntu command like (gnome-terminal,nautilus,gedit) to newbie user. Might be easier if i attached the form... [ATTACH]9758[/ATTACH] the cellrenderertext is working properly (when i click every row it should explain the description in …

0
60
Member Avatar for harrykokil

how can i create 50 apples at different positions on screen without having to each time call the constructor 50 times? [icode] import Tkinter as tk from Tkinter import * import time class Apple(object): def __init__(self, a,b,c,d): self.rect = canvas.create_oval(a,b,c,d) root=tk.Tk() canvas = tk.Canvas(root, width=300, height=300, bg="#FFFFFF") canvas.pack() for x …

Member Avatar for lllllIllIlllI
0
148
Member Avatar for demeryjo

Hey, so for a project of mine we are asked to draw a face using instances of classes. I'm not very familiar with classes and I was wondering if anyone could explain to me why my code wont even open the turtle window. I'm also slightly confused as to how …

Member Avatar for lllllIllIlllI
0
87
Member Avatar for rampalli.sarma

Dear friends, Greetings I am copying the code which is giving only one error. Please help. I have attached the file also.. cross.py [code] import subprocess, sys, socket, time, struct, random from traciControl import initTraCI, simStep, close, getVehNoOfIndLoop, setPhase PORT = 8813 NSGREEN = ["0101", "0101", "0000"] NSYELLOW = ["0000", …

0
45
Member Avatar for artemis_f

Hi I am beginning to learn wxPython a little with the "wxPython in Action" book but I haven't managed to figure out this one thing I really want to do and am hoping someone can help me. I want to do something like create an Ellipse to which I can …

Member Avatar for artemis_f
0
349
Member Avatar for skhan23

All questions involve this portion of a program: [CODE] if (y>x and y<z)or(y<x and y>z): print("You have entered Condition 1") elif not(x!=y and y!=z): print ("You have entered Condition 2") else: print ("You have entered Condition 3")[/CODE] 1. If x = 10 and y = 10, what is the value …

Member Avatar for adam1122
0
99
Member Avatar for leegeorg07

this relates to _nestors problem but im trying to expand it on my own i have this code: [code=python] logfile = open("logfile.txt", "r").readlines() KEYWORDS = ['test', 'text'] counterline = [] counter = 0 for line in logfile: for word in line.split(): counter+=1 if word in KEYWORDS: counterline.append(counter) print word print …

Member Avatar for woooee
0
111
Member Avatar for lowbot

Is there a way to script a broadcast packet send? Im doing some network traffic and would love to be able to see if my broadcasts are getting through. Or alternatives if python isnt the best/easiest way to do this. XPSP2 if it matters. Thanks.

0
39
Member Avatar for mafarooqi

Hi everyone, I have been working with Matlab but now I have to develop a couple of programs in Python. So I am new to Python. Could anyone tell me the python equivalent of [B]eval [/B]command of Matlab. Actually I have to open a set of say 100 files to …

Member Avatar for mafarooqi
0
457
Member Avatar for MartinIT2type

Hello again! I've started a game project for fun, and I used the knowledge I gained a few days ago from a thread I posted. Now I've taken that tried to take that (taking a text Entry out of a GUI and using it outside the class) and apply it …

Member Avatar for MartinIT2type
0
2K
Member Avatar for tech12

This is a project I'm working on for a class. I'm pretty new to CS and python...and I found that I am totally lost. I'm suppose to write a program to convert Roman numerals to arabic numbers. It is also suppose to handle invalid input. Here is what I have …

Member Avatar for woooee
0
173
Member Avatar for thehivetyrant

I am trying to: [B]Implement an iterative Python function which returns the sum of the first n integers[/B] so far i have this: [code] i = 0 total = 0 def sum(n): while i <> n: total = total + 1; i = i + 1; return total [/code] then …

Member Avatar for scru
0
89
Member Avatar for gotm

[code=python]#!/usr/local/bin/python #Scott Landau #CS 380 #Assignment 1 Programming Portion in Python #Created - 4/6/09 #Last Edited - 4/7/09 #n is going to be equal to 4 for this queens problem. n = 4 #Assigning the empty list to initialState. initialState = [] #Making an allDirections list. allDirections = [[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[-1,1],[1,-1],[1,1]] #declare …

Member Avatar for woooee
0
117
Member Avatar for Rick3414

I am pulling a name, address, phone number from a text file. The items are delimited with a comma. I pull them into a variable. How can I pull them in or parse them out? I'm not sure if this is a tuple or a list or what, but when …

Member Avatar for vegaseat
0
114
Member Avatar for mangotango

I am constructing some sort of a status bar which allows the user to update their status while in a social network. It consists of an entry field and a 'update' button beside it. What I hope to do is upon activation of the button 'update' the contents in status …

Member Avatar for sneekula
0
851
Member Avatar for aegis042404

Hi, I'm writing a small app in wxpython, on a linux box. I just want to display a graphic and play a short ogg when a gui button is clicked. Started out as a memory card game, now I just want to display the graphic and play a sound when …

Member Avatar for lllllIllIlllI
0
359
Member Avatar for amitattri1987

I'm making a small web application in python. Transferring control from one python page to another can be done by form submit or onclick button.This happens at an event. But I'm searching for a functionality in python similar to 'server.transfer' in asp which is not event dependent. Please Help.

Member Avatar for adam1122
0
118
Member Avatar for thehivetyrant

Hello there, I've a homework assignment from a while ago that asks [B]"Implement a recursive Python function which returns the sum of the first n integers"[/B] Now i just dont know exactly what it's asking and how to get started. Recursive functions, right (my thoughts so far is it'll look …

Member Avatar for thehivetyrant
0
122
Member Avatar for srk619

need help on this question: Write a lexer to read in decimal numbers. If your input is the following string: “12345.9876” what do you have to do to each character in the string to generate your float? How are the numbers before the decimal point different to the numbers after …

Member Avatar for srk619
0
159
Member Avatar for gotm

[code=python]#!/usr/local/bin/python #Scott Landau #CS 380 #Assignment 1 Programming Portion in Python #Created - 4/6/09 #Last Edited - 4/7/09 #n is going to be equal to 4 for this queens problem. n = 4 #Assigning the empty list to initialState. initialState = [] #Making an allDirections list. allDirections = [[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[-1,1],[1,-1],[1,1]] #declare …

Member Avatar for woooee
0
94

The End.