15,175 Topics
| |
Hi guys, I'm new to this website so if I made some mistake please forgive. :) I just want to learn more about Python , I'm new to Python and i'm trying to improve. Here is my work (took some help from Daniweb) i just want to ask that how … | |
I have never used Python before, and unfortunately, this makes me completely ignorant. For this I apologise. I have a Dell Dell Latitude D430 laptop running Mint Katya I am attempting to start up a python script which is used to program 4 servos. I have python 2.7.1-0 as supplied … | |
The exercise says the following: """ Pairwise comparision of DNA sequences is a popular technique used in Bioinformatics. It usually involves some scoring scheme to express the degree of similarity. Write a function that compares two DNA sequences based on the following scoring scheme: +1 for a match, +3 for … | |
So I have a program that takes the value of an item.. checks the values with price then prints a result. Now my professor is asking for a 4th function that acts as a "data exchange" between the other 3 functions and act like a host for all the values … | |
hi all i have a homework for Lehmann primality test and i have to know very big numbers as big as x**(2**128) python is enough for 2**128 but when numbers bigger than it don't do it my teacher python has a structure for it and i didn't find it for … | |
I have create in MySQdb a DB with a table named example,in this table i want to save a name, this name is in Greek language.My problem is thw follown when i try to save the name instantly without use textctrl, its ok but when i use textctrl i take … | |
how can i calculate float value? eg it is 32/10 3.2 in calculator in python 32/10 is 3.0 help me out | |
I need a custom dialog. I've been playing around for hours trying to create one and simply don't get it! All I need is the standard wx.TextEntryDialog but with 2 text fields. Can anyone please help? Thanks. | |
Hello! I don´t understand how to use a condition " if i == predmet: " i is an objet type of subject In my code I need to reach the condition: [ICODE]def add_mark(self,predmet,mark): for i in self.predmety: if i == predmet: print True[/ICODE] but I don´t know how to make … | |
So I need to write a function that if a file exists, it will change the file name by sequentially adding integers, starting with 1, to the base file name (the part that does not include the file extension). so if the filename is hello.dat, then it will return hello1.dat … | |
I'm in a computer programming course on Florida Virtual School, and I'm stressing out over our current assignment, because it seems like it should be easy. The point of the assignment is to write a program to count how many times the Scribbler robot stalls and then print the results … | |
hi , how can i print data as grid view in python, in my case a variable is carrying all the data which is coming from table and i want to print them by using two nested loops. [CODE]data_from_table = ['col 1'] + "/t" + ['col 2'] + "/t" + … | |
Hi everyone, I've written a cellular automata code in python that updates land uses based on each cell's adjacent neighbors. I import a text file as a dictionary with cell id: land use code. I also import a text file with each cell's adjacent neighbor. I then run the cellular … | |
So, what is my deal... I'm working on a script, which, at some point will require the user to insert his or hers username and a password. My question is, how can I make that when the user will write in the password box/line whatever, instead of its characters, to … | |
I have a battleship python assignment due in an hour and I can't figure out where the error is in this code. It seems like when player 2 plays sometimes the coordinates saved in Board.remaining_ships can't be deleted because they aren't there. Please please please help Here is the error: … | |
I'm a beginner with python and I'm trying to write a program that asks the user for how many classes they have taken, then asks them for the class codes and prints the classes they have left to take. I can get the program to run perfectly for one list … | |
[CODE] list1 = [4,5,6] for n in list1: print "list1:", list1 print "n:", n list1 = [7,8,9] [/CODE] output: list1: [4, 5, 6] n: 4 list1: [7, 8, 9] n: 5 list1: [7, 8, 9] n: 6 list "list1" is not affecting even though it is re-assigned in for loop. … | |
Hi guys, I'm trying to make an enemy object follow a player object but I'm having a problem with picking up the player co-ordinates, it gives me an error "Player object has no attribute x" Here's whats iv'e got: [CODE] import pygame pygame.init() class Player(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self) self.image = … | |
| Hi, I'm looking for a way to getthe domain a computer is connected to and the name of the domain controller if possible. I've looked at the os, socket and platform and can't find anything. I have been able to retrieve various bits of system info using these modules but … |
I was wondering, is it possible to do something like the following? The given code obviously doesn't work. [CODE] l = 5 (l == 5)*(k = 7) #Returns error message.[/CODE] The reason is, I'd rather avoid doing something like the following for the project I'm currently working on. [CODE] if … | |
Hi :) Can anyone help me? I want to display image in my GUI using tkinter (python 3.2.2) Do i need to download this python image library ==> PIL-1.1.7.win32-py3.2 or actually it was already in tkinter? How about the code? Thanks for the help. | |
Hello! I have a class project and attempting to use a listbox to read a string of tab data from a simple text file. When the string of data is printed to the python shell the rows of string data appears to be spaced. However, when the string of data … | |
I keep getting this error and i don't understand why. [code]Traceback (most recent call last): File "E:\University\Workspace eclipse\dictionares\src\dcts\dicts.py", line 105, in <module> fr_runt() File "E:\University\Workspace eclipse\dictionares\src\dcts\dicts.py", line 95, in fr_runt run.run() File "E:\University\Workspace eclipse\dictionares\src\dcts\dicts.py", line 58, in run self.data.write(file, key, value) File "E:\University\Workspace eclipse\dictionares\src\dcts\dicts.py", line 23, in write fh = … | |
I just joined this community, after searching and not finding what i was looking for. I am new to programming, I'm just 15, my dad programs for a living, but doesn't know much with python. Forgive me if my code is sloppy, i have been told so by my dad … | |
In the following code I am trying to select a file either from a file chooser or just typing out the path. The problem is I want the comboboxentry to change background color when something is put in it. The code works fine if it's a combobox (Line 7 is … | |
I would like to create a function using the code below called drawMove which takes 2 parameters (x or 0) and square number. That draws an x or 0 in the numbered boxes on the grid below. Input should be: drawMove(turtle,cellsize,O,6) ---> this should draw a O in the 6th … | |
Hey guys, I have a simple numpy datatype: [CODE]spec_dtype = np.dtype([ ('wavelength', float), ('intensity', float) ])[/CODE] I chose to use this in my program because it's very easy to read in 2-column spectral data files using the genfromtxt() method. Therefore, I made a fairly sizable program around this datatype. Now … | |
I am having problems with a GUI I'm working on. The idea is to have a tree list of signals and be able to drag them onto the plot. Eventually having a long list of signals and multiple plots etc.. However the code segmentation faults after a seemingly random number … | |
I am trying to create a function which would take a list and be able to count the number of ints floats and str in that list. output should be: list = ['v', 3.0,1, 'etc'] freq = countDataTypes(list) print(freq) [2,1,1] any help would be greatly appreciated so far: [CODE] >>> … | |
| def fnKey(dic, value): return [k if value == v else pass for k, v in dic.iteritems()] can anyone tell me why this doesn't work? i'm trying to return the key for a known value from a dictionary |
The End.