15,175 Topics
| |
Hi i'm having trouble adding a if statement to my code i have these two files in the same folder mud.world effect and simmind, in effect i have this class EffectIllusion, and i use the portion illusionRace, i ive been trying to add a condition that when illusionRace is active … | |
I'm to have the user input what classes they have taken and tell them what they have left to do. I have my for loop done but I feel like I need an array or something because they should have entered requirement for 6 different class types. Here is my … | |
lets say i have 2 lists: lista = [1,2,3,5,6,7] listb = [4,5,6,7,8,9,10] The lists can be different lengths, and may not allways be unequal lengths. The higher average will allways be in listb, so that is the 1 constant we can rely on. This works for even teams: [code] average … | |
Hi, I'm stumped at this problem set and was wondering if anyone could guide me in the right direction or give me some hints on where to begin. I'm not looking for a full answer. Q: Write a program that computes and prints the 1000th prime number. Any help is … | |
Hi all, I am using scipy.io for switching from python to matlab. here is my list of list in python code = [[[1, 2], [3,4], [5, 6]], [[7, 8], [9, 10]]]. I want to convert this to matlab format. For that I used a code scipy.io.savemat('/tmp/out.mat', mdict={'Num': (code[0], code[1])}) but … | |
Hi, I was wondering how to debug python script without adding pdb module to the script file. Say, I have a script test.py without adding "import pdb" and "pdb.set_trace()". Can I debug it in Python running in terminal by importing pdb there? How to set up breakpoints and start the … | |
Hi, I am fairly new at the whole programming racket and I am having trouble with an assignment for my computer science class. I know homework help is discouraged, I read that sticky, but I'm curious if I am missing a fairly simple mistake. The assignment is to make a … | |
Hi - I'm fairly new to python. I 've been trying to write some python code to read data from a serial port and convert it to be able to display as incrementing or decrementing numbers with a voltmeter image in the background. Any ideas on how i can flush … | |
[CODE]#Program to count number of specific vowels msg = input("Enter a message:") msg_lower = msg.lower() VOWELS = list(aeiou) msg_list = list(msg_lower) x = () for letter in VOWELS: x[letter] = msg_list.count(letter) for letter in x: print(a, x(letter)) print(e, x(letter)) print(i, x(letter)) print(o, x(letter)) print(u, x(letter)) [/CODE] I get an error … | |
i setup a cronjob to execute a script (following instructions here [url]http://moinmo.in/WikiBackup[/url]) basically their script just opens a browser to a page with a backup button. after digging, i found i could add &do=backup and it would click the backup button for me, but now it just stops at the … | |
Hi, I'm trying to use swig to generate python wrappers to a custom binary package that my research group uses. I'm new to swig, but I must say I'm very impressed. The only hang-up I have left is that I have trouble directly accessing the global array data. I've currently … | |
| I'm just wondering how I would fix this [code]app = first[0:8] and second[0:8][/code] That doesn't work but if I remove "and..." it does but I need both. |
I'm compiling an extremely large list of usernames, and I want to know which is a faster method of checking what is already in the list. If anyone can give some insight as to how Python deals with each that would be much appreciated! | |
Hi, the program is this: Discount problem: Available deals: 10% off the total price when you buy $200 or more 15% off the total price when you buy $500 or more 20% off the total price when you buy $1000 or more Write a program that outputs the value, price … | |
Hi I am continuing on with one of my first projects in python. This module for my larger project will be to download files(legal freely published by sporting assosciations). I am not sure if my concepts are right in how best to execute this, I have read the urllib docs … | |
In the code below, the only part I'M having trouble with is word[position]. I know this is something really simple but I've always had trouble understanding these kinds of statements. I know that it prints a random letter (position) from (word). What I don't know is why or how it … | |
In the program be below, I'M having trouble with these few lines, remember, I'M new. What's going on here? I'M just a little confused because there is (word) wraped in len(). [CODE]position = random.randrange(len(word))[/CODE] And what's going on with these two lines? Thanks. [CODE] jumble += word[position] word = word[:position] … | |
Hey everyone, im doing a application, with some graphics in it and stuff nice in there, and to be honest is almost done. But when i run my program, a black window appears, just behind my program, its like a command prompt and what i would like to do is … | |
Hello All, Don't know if this is the right place to put this doubt. Help if possible. I have a python file that extracts data from a file and adds the required part to the database. Now MySQL has certain reserved characters, whenever my update query comes across a reserved … | |
Folks, I was trying to learn Python, I finished the basics,- Conditional Statements , loops, Functions, Classes. I want to try some GUI designing. I have downloaded Django. I use Python 2..6.2.. Where should i head next.. | |
Hi im trying to write a game. Its very early stage but i hit to an error so need your help. Here the code: [CODE]def gexp(): connection = sqlite.connect('test.db') memoryConnection = sqlite.connect(':memory:') cursor = connection.cursor() cursor.execute('SELECT * FROM gain') expget = cursor.fetchone() exp = expget[1] texp = expget[1] + mexp … | |
Hi, I'm writing a little learning game for young kids, mostly to help my own girl learn a few things. I've chosen colours first, but hope to adapt it for more complex ideas later. I'll be releasing it GPL3, if I ever get it done, so feel free to reuse … | |
I am trying to display a gif file on pyqt.It shows but doesnt animate.It is static.How can make it animate? This is the code i used: [CODE]pic=QtGui.QPixmap("./IRREGULAR/"+ui.lineEdit.text()+".gif") ui.label_9.setPixmap(pic)[/CODE] | |
hey, ima first time programmer and i no clue whats going on someone please help!! i have to write a function called number_of_2s that includes one parameter, N, where N is a positive integer that is no more than 10 digits long. the function should return the number of times … | |
What is the consensus on the best way reference module level variables? I have a wx app that has grown too large, so I started to do some housekeeping. I'm trying to move several functions outside of the main module while still being able to reference the main variables.. The … | |
Here is my code but getting a error Learning Python Code needed ask user number miles driven, gallons of gas used caluculate car mpg display result? miles_driven=raw_input("How many miles have you driven?\n") gallons_of_gas_used=raw_input("Now how much gas have you used?\n") print int(miles_driven) / int(gallons_of_gas_used) | |
hi i am developing web services on MAC SYSTEM by using python-SOAP-ZSI tool. but i am getting this error when i am trying to install. so it is not working . so can u tell me how to overcome this error. "SyntaxError: from __future__ imports must occur at the beginning … | |
I want to loop from 0 radians through 6.2 radians in increment of 0.1 radian something like this in C for(r=0.0; r<6.4;r=r+0.1) this is the best I can do in Python: for i in range(63): z = float(i)/10 print z Is there a better way? | |
An example of a range generator that handles floating point numbers, appropriately called frange(). The function range() or the generator xrange() can only be used for integers. Note that xrange() now is range() in Python3. | |
Hi Everyone, So i have been trying to figure this out for ages. Im just not able to to get the algorithm straight. Say I am given a string containing markup tags ex. <html> </html> in a string like this: <html> <head> <title> Example </title> </head> <body> quiet <CAPSLOCK> LOUD … |
The End.