15,181 Topics
| |
Hi, I'm wanting my program to loop and create different files outputting at different stages in a while loop, I just can't work out how to make it happen! here's a stupid example [code=python] while (a<10): a = a+1 if (a=4) or (a=6): output = open('output'+a, 'w') #something like this? … | |
Hi, I'm in need of some help in using functions for the hangman game. The professor doesn't understand how difficult it is for a first time programmer and just doesn't explain new concepts thoroughly. The game that I'm trying to code looks like this: Enter the secret word: LETTERS ------------------------------------------------------------ … | |
I have a server in python and client in java and i want to share images through the socket how can i do so? help plz | |
Hi , I want to achieve something like this . Consider the example [CODE]>>> txt 'arin.thearc@gmail.com' if '@' or '.' in txt: do something[/CODE] I just want to know how can we nest ORs and ANDs inside the if or while loops... | |
hi! I have another struggle. I'd like to have this kind of output: [COLOR="Green"]som object studenta: Janko Mrkvicka som object predmetu: fyzika, mam znamky: [4, 1] a priemer: 2,5[/COLOR] How can I make it? my output is a bit different (it is in last line): [COLOR="Red"]som object studenta: Janko Mrkvicka … | |
I started looking into networking and storing/altering data on a computer. I've got everything running, but can't get it to work from an outside computer. Is there an easy way to get past the LAN restrictions or am I going to have to change settings on my router? | |
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 … |
The End.