15,175 Topics
| |
Please provide a pseudocode algorithm for this question please. Please do the pseudocode for Python 3.2.2 Write a program which asks the user to enter a username, and then a password. Then when they type the command “log off”, they will have to retype their username and password in order … | |
printBoard: A call to this function with printBoard(5,4,[1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]) would print the following output to standard output: |-----------| | 1 0 0 1 0 | | 0 0 0 0 0 | | 0 0 0 0 0 | | 0 0 0 0 0 | |-----------| def board(l,h,list): %a length, … | |
So I have a number of CSV files with 6 columns of numbers in each file. I would like to perform a few operations (multiplication, division etc.) on each column in each of the CSV files using Python and instead of opening each file manually, I want to add the … | |
Write a program which asks the user to enter a username, and then a password. Then when they type the command “log off”, they will have to retype their username and password in order to log back on again. Please note i am using python 3.2.2. Regards Mark | |
how would you go about highlighting text in the tkinter text widget ? | |
Hi. I am a beginner with Python. I've done some PHP work in the past but I suspect this is not helping with my progress in Python. I have a text file that basically looks like this: [CODE]a=1 b=2 c=3 a=4 b=5 c=6 a=7 c=8 a=9 b=0 c=11[/CODE] At the … | |
I am really struggling with a Python classes project. Here are the directions Design and implement a class called Dog that contains attributes (data) representing the dog’s name and age. Define the Dog constructor to accept and initialize that data. Include one method that will reset the dog’s age, one … | |
So I have been working on Pascal's triangle and going about it a different way then most. I am attempting do to a series of if and elif statements to check for the values in rows and columns of those rows. However my novice skills in python are stopping me … | |
Please tell me what I'm doing wrong. I have a list, and I want python to make a file out of it. [CODE]def changename(filename, modifier): return filename[:4]+modifier+filename[-4:][/CODE] [CODE]def fileWrite(filename, ext, sortedList): openthis =open(okfilename(changename(filename,'_'+ext)),'wb') for item in sortedList: openthis.write(item) openthis.write('\n') return[/CODE] [CODE]lastnames.append(newNames) lastnames.sort() print '\n'.join(lastnames) names.close() fileWrite(filename, "Last-sorted", lastnames)[/CODE] | |
I have to write a program that will decode a Ceasar cypher with any possible rotation length on a long string that will be imported into the program. I'm trying to figure out some pseudo coding on how I want to tackle this problem but there is one key thing … | |
I am developing the Django application which runs the Matlab code and create some txt and png files on the server.when I run these below python command on server, it works fine but when I try to run from the server (it is coded in Viewspy).It shows file is updated.(from … | |
hi, my code involves something like this: [I]IP = "123.123.123.123" string = "Your IP is %s and it's 100% correct" % IP[/I] The IDLE thinks the second % is a operator and I don't know how to make it as a regular text. please help. | |
Guys I have this string: [CODE]mystring = 'blue, pink, red, red, red, white, long, short, blonde, blonde'[/CODE] I want to: 1.) Split it into a list, 2.) Erase all duplicates 3.) Sort it out alphabetically so I did this: [CODE]mystring = list(set(mystring.split(', '))).sort()[/CODE] But why when I go to call … | |
Guys I'm looking for a clean way of splitting a string into a list: I have this: [CODE]myString = 'blue, red, pink, purple'[/CODE] and I want this: [CODE]myString = ['blue', 'red', 'pink', 'purple'][/CODE] How do I do that? | |
Im trying to write a program that inputs a single letter and prints out the corresponding digit on the telephone. Im having trouble finding out a way in which you can group the variables that have the same digit, but im not sure how. You guys have any suggestions? P.S. … | |
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 … | |
[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: … | |
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 … | |
[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 … | |
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. … | |
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 … | |
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. … | |
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 … | |
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 … | |
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? |
The End.