15,175 Topics

Member Avatar for
Member Avatar for j.rf

No idea how to get my scatter plot to talk to my colorbar. I have taken endless approaches and consulted every forum all to no avail. I am either very close or nowhere near, surly this should only be a one or two liner?? Please help. import matplotlib.colors as cols …

Member Avatar for j.rf
0
413
Member Avatar for dany12

What will be the language of the feature web PHP or Python? What framework will be the future a php one or a python one? I would like to add that Laravel for php is still young and the development is not made by a corporation so I don't think …

Member Avatar for profmuluka
1
457
Member Avatar for bradley1234

We have a list of numbers, for example, [1,1,1,1,2,2,3,4,5,3,3,3,11,12]. Because we have four 1's, two 2's, etc. The new list would be as followed: [1,4,2,2,3,1,4,1,5,1,3,3,11,1,12,1]. I have the following code, but I am stuck. Can anyone give me advice? def rlEncode(data): for i in range(len(data)): n = data[0] if n …

Member Avatar for Schol-R-LEA
0
103
Member Avatar for bradley1234

I want to make two polynomials and then add them. We have two lists, [1,2,0,3] and [2,3,0,0,1]. The polynomials are as followed: 3x^3+2x+1 and x^4+3x+2. I have the following code, but I'm getting stuck. Any advice? I'm new to python. def polyAdd(poly1,poly2): for i in range(len(poly1)): z = poly1[i] return …

Member Avatar for vegaseat
0
198
Member Avatar for Alexander_2

I am creating a basic hangman game using tkinter. The last thing that I need to do is to add a widget that has an image to show the actual hangman. However, I keep getting this error whenever I try anything: File "C:\Program Files (x86)\Python\lib\tkinter\__init__.py", line 3287, in __init__ Image.__init__(self, …

Member Avatar for vegaseat
0
8K
Member Avatar for marethamogale

write a program in python that gets the word from the user and tells them if it is a parindrome or not.your program should not care about capitalization

Member Avatar for vegaseat
-1
130
Member Avatar for ksekwamote

improve the word jumble game so that each word is paired with a **hint** ,then the program should display the corresponding hint.use nested sequence to store the words and hint

Member Avatar for vegaseat
0
951
Member Avatar for Lone Ramoupo

PHow do we improve the word jumble game so that each word is paired with a hint. if the player enters hint then the program should display the corresponding hint using a nested sequence to store the words and hint.

Member Avatar for vegaseat
0
949
Member Avatar for krystosan

if i try to dump from shell like this `python -c 'help("modules")' > ~/Desktop/modules.txt` but if I try to execute from within the python like this `>>os.system("python -c 'help("modules")' > ~/Desktop/modules.txt")` i get error File "<stdin>", line 1 os.system("python -c 'help("modules")' > ~/Desktop/modules.txt") ^ SyntaxError: invalid syntax once i get …

Member Avatar for krystosan
0
202
Member Avatar for krystosan

in the designer when i right click a widget, and i click promote to i get this window? see attached screenshot what is it for ? does that mean i can create a new class in this case inherit QLineEdit and add more methos to it ? how can i …

0
146
Member Avatar for dreking6

i recently took up a project on openvpn when i got the source code of an openvpn application written in python by ivanzoid http://code.google.com/p/pyopenvpnman/ but after laying my hands on many things and reshaping the application i couldnt go any further because of some errors detected 1.writing to a config …

0
145
Member Avatar for dreking6

i am working on a project but this parts seems to stall me i want to be able to write to a text file to change just two lines of d file say line 1 and 3 using wxwidgets i will appreciate helps nd suggestions thanks

Member Avatar for dreking6
0
620
Member Avatar for Phenol

I am a Python (2.75) neophyte and need to reformat a large data file. A sample is below: P1 01 01 1991 100.00 P1 01 01 1992 111.30 P1 01 01 1993 97.58 I1 01 01 1991 0.0 I1 01 01 1992 20.0 I1 01 01 1993 32.4 I need …

Member Avatar for rlvaugh
0
157
Member Avatar for krystosan

why this works `> varhelp = __import__("sys")` and this doesn't`> varhelp = __import__("sys.path")` the second one throws: Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named path then how to achieve the second one?

Member Avatar for woooee
0
184
Member Avatar for krystosan

I am trying to load the help on each method into a QTextEdit in PyQt4 how can I have this variable hold help on a method, example: `data = os.system('python -c "import sys; help(sys.path)"')` but data value contains `0`

Member Avatar for krystosan
0
370
Member Avatar for talat.zaitoun

def matrix(mat, num): for i in mat: for j in i: print(j * num) So I'm trying to make a code that multiplies a matrix by a number, my code above is not working and i think the reason is the for statements could be wrong, so what i tried …

Member Avatar for Schol-R-LEA
0
161
Member Avatar for vegaseat
Member Avatar for HiHe
3
4K
Member Avatar for Subomi

Please, I am trying to build a chat program in python i have built a chat client program and a server program, I want to ask someone told me that I don't need to build a server all i need to do is connect a db server directly and the …

0
163
Member Avatar for Waseemaburakia

I NEED HELP! (please and thank you). I have an assignmet for extra points. I'm lost. Out profesor is not explaining anything and the assignments are NOT what we covered so far (which isn't much). I could use any help I can get. I've been trying to google it and …

Member Avatar for ZZucker
0
280
Member Avatar for Mistyz

I've been assig to do the class rectangle, the class has two instance variables: length and width of the rectangle, and the methods methods setLength(), getLength(), setWidth(), getWidth() and computeArea(). Do you have any idea to do this. Anyway i'm to to python.

Member Avatar for ZZucker
0
539
Member Avatar for John_47

Hey, i'm having trouble with this question i was given. I'm tasked with improving a programme to calculate a differential. Here is the code i am given, which i must improve. def f(y,t): return -y + 1.0 def odestep(f,y,t,dt ): return y+dt*f(y,t) t =0; y=0; dt =0.2 tf =2.0; nsteps …

0
68
Member Avatar for John_47

Hello, i'm currently trying to write some code to find the integral of exp(-x*x). I have been given code for one trapezium rule (trap0) which is imperfect, and a second set of code for a new trapezium rule (trap1), which uses the old code and some new conditions to 'perfect' …

Member Avatar for John_47
0
214
Member Avatar for vegaseat

Starting with Python 3.3 you now have access to a high resolution time counter (nanoseconds and better).

Member Avatar for vegaseat
6
4K
Member Avatar for loemnk

hello there. in order to gain experience I started a small python project. it is an more or less simple, collaborative address book (Snow Leo and Python 2.6.1). the final step is to create a standalone programm. to create the address book I used PyQt4 and MySQLdb. since py2app chokes …

Member Avatar for vegaseat
0
5K
Member Avatar for jantrancero

So i made a script and it works fine but it could be better. The code will be written below, the purpose of the script is to make a beep sound when the timer runs out (that works) but i also want to show on the screen how many hours …

Member Avatar for CaptainFApin
0
2K
Member Avatar for HiHe
Member Avatar for Tayler_1

f = open("program0.4.txt", "w") done = input('Enter done for last name when finished') Last_Name = input("Enter Last Name: ") while Last_Name != 'done': First_Name = input("Enter First Name: ") Hrs_Wrkd =int(input("Enter Hours Worked: ")) Hrly_Wge = int(input("Enter Hourly Wage: ")) f.write('Last Name' + ' ' + 'First Name' + ' …

Member Avatar for Tayler_1
0
1K
Member Avatar for ChicagoBears2012_1

I have a function that has takes in a string "secret" sec = set(secret) print sec output: set(['A', 'C', 'E', 'I', 'H', 'M', 'S', 'T']) Assuming I called the function sending in the string "Mathematics", how do I get an ordered set. I'm looking to get unique characters in the …

Member Avatar for snippsat
0
261
Member Avatar for glez_b

The following script try to calculate the resulting average of the direction and magnitude of the wind well as daily averages of Temperature, Moisture and Sum of Precipitation. My monthly dataframe has the following column: data Fecha Hora DirViento MagViento Temperatura Humedad PreciAcu 0 2011/07/01 00:00 318 6.6 21.22 100 …

0
129
Member Avatar for boni_go

Hi, I try to copy tree by shutil.copytree(). While the function run, I get some Exception "File name too long". The path+fike name are realy long, and the exception as I understand is from the OS not Python. Do you have any solution? * I can not change the directory …

Member Avatar for edenrol
0
1K

The End.