15,190 Topics

Member Avatar for
Member Avatar for ohblahitsme

So I have a function called start() and it has multiple if statements and I want all of them to run. [code=python] def start(): print """You have just woken up from a very long nap. You find yourself in a dimly lit cave. There is a patch of light in …

Member Avatar for woooee
0
282
Member Avatar for dineshswamy

[CODE] a = input("enter the string") print "%s dinesh" %l m=re.match(r'(.*)(\.*)',l,re.I) print m.group() print m.group(2) [/CODE] i m getting the following error ,when i give input [CODE] Traceback (most recent call last): File "regularexp.py", line 1, in <module> a = input("enter the string") File "<string>", line 1, in <module> NameError: …

Member Avatar for dineshswamy
0
133
Member Avatar for floatingshed

With a lot of help from ihatehippies I got threads working yesterday. Now I need to stop 'em! More specifically I want to stop a second thread starting until the first has finished.. This is what I have in my threading class at the moment: [CODE]class ProcessThread(Thread): """Test Worker Thread …

Member Avatar for floatingshed
0
375
Member Avatar for darsha

[QUOTE]i am trying to implement a fitness function for GA. i got a code written in python. i don't have any idea about python. can someone help me to convert it into java the code is here [/QUOTE] [CODE]# there are many ways to do an eigenvalue decomp, this is …

Member Avatar for FALL3N
0
569
Member Avatar for theLured

Hello, I'm a python beginner and glad I joined this forum :). I'm wanting to make a simple program where the window is hidden for x seconds/minutes and is then shown again. My problem is that using time.sleep() causes the Hide() function to not run until after time.sleep() is complete. …

Member Avatar for ihatehippies
0
2K
Member Avatar for kavithabhaskar

I am looking at a source code There is a class called A and it has a parameter in its _init_ function called. Class A self.id = id There is another class called B and has a parameter in its __init__ function called Class B self.ide = ide There's an …

Member Avatar for inuasha
0
116
Member Avatar for minimee120

Hi all. I have an up and coming midterm, and this is one of the practice problems. All's I need to do is draw a Tic-Tac-Toe board in TURTLE. However, it has to be in a loop, or something, and I am having a difficult time putting it into one. …

Member Avatar for minimee120
0
162
Member Avatar for xopenex

Hello all, I found a thread similar, but it was closed... so here is the code and my question... I am wondering how to change the code from creating files to creating variables? this is the code from the thread on here.... and below it is the code that i …

Member Avatar for TrustyTony
0
198
Member Avatar for jone kim

I want to explain my code to you. 1. this code is to search for the given number whether it is present in the list or not. 2. first if statement returns the value of row if the i/p number is in the first column 3. if the given number …

Member Avatar for jone kim
0
240
Member Avatar for breatheasier

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? …

Member Avatar for xopenex
0
5K
Member Avatar for Eclipse77

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 ------------------------------------------------------------ …

Member Avatar for woooee
0
3K
Member Avatar for 47pirates

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

Member Avatar for dantinkakkar
0
167
Member Avatar for arindam31

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...

Member Avatar for TrustyTony
0
215
Member Avatar for vlady

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 …

Member Avatar for Lucaci Andrew
0
133
Member Avatar for Thropian

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?

Member Avatar for ihatehippies
0
294
Member Avatar for Kitty17

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 …

Member Avatar for Lucaci Andrew
0
692
Member Avatar for Fitchie

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 …

Member Avatar for Fitchie
0
292
Member Avatar for pwolf

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 …

Member Avatar for TrustyTony
0
1K
Member Avatar for straylight

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 …

Member Avatar for TrustyTony
0
164
Member Avatar for weIIet

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 …

Member Avatar for Thisisnotanid
0
2K
Member Avatar for TLSK

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 …

Member Avatar for TLSK
0
239
Member Avatar for dineshswamy

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

Member Avatar for dineshswamy
0
206
Member Avatar for floatingshed

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.

Member Avatar for floatingshed
0
99
Member Avatar for vlady

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 …

Member Avatar for vlady
0
122
Member Avatar for KickAssElmo

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 …

Member Avatar for ihatehippies
0
249
Member Avatar for Poikaer

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 …

Member Avatar for Poikaer
0
154
Member Avatar for pythonn8

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" + …

Member Avatar for pythonn8
0
361
Member Avatar for ljvasil

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 …

Member Avatar for ljvasil
0
177
Member Avatar for Lucaci Andrew

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 …

Member Avatar for Lucaci Andrew
0
176
Member Avatar for Tashalla

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: …

Member Avatar for woooee
0
759

The End.