15,181 Topics
| |
I could reallly use some help. I am a complete newbie in python. What I would like to do is import a csv file (originally an excel file). Have the user pick a beginning month and an ending month and add the columns of the months between. For example I … | |
This is working code. You will of course have to replace the directories used in this code with your own that will be unique to your particular situation. You also must have ArcGIS, and the newest version is 10 which will only work with python 2.6. There is plenty of … | |
I'm working on a cleanup script for tv shows that I download. Right now I'm just looking for a file greater than 50mb, but there should be a better way. [CODE] import os import shutil dir = "C:\Users\Bobe\Downloads\TV\\" for folder in os.listdir(dir): if os.path.isdir(os.path.join(dir,folder)): for file in os.listdir(dir + folder): … | |
numbers = [] line = int(raw_input('Enter number: ')) while line != '': numbers.append(line) line = raw_input('Enter number: ') print "Size:" + " " + str(len(numbers)) Hey guys, once again I need some help with a challege. http://pokit.org/get/img/c00a1897d52de5b36329564861fadb1b.jpg For your homework, you are given a set of integer data readings, and … | |
I want to make a program that cross checks strings. Here is an example : **Enter line: AAGGAA This sequence can make a hairpin** **Enter line: UGAG This sequence cannot make a hairpin** **Enter line: GUGCCACGGCACCGUG This sequence can make a hairpin** **Enter line: GUACCACGGCACCGUG This sequence cannot make a … | |
xmlrpclib api throwing an error <ProtocolError for host:port/: 500 Internal error> when calling api with the data (contains non-ascii characters), after replaced that non-ascii characters its working. What would be the problem ? what is the resolutions on this? | |
Here is slow brute force way to find the largest palindromic product of three digit integers. You could do loop and break out of it if you go under the smaller number (the second one) of best solution found so far to be more efficient etc. | |
How the following code can be rewritten in a better way? #!/usr/bin/env python """Simple program for finding popular names over last 100 years, in response to vegaseat's last post in Projects for Beginners(9/1/2012). It first lists the popular names and then search for entered name by user""" oldnames = """Mary,Helen,Margaret,Anna,Ruth … | |
Hi guys, With Python, I am using genfromtxt (from numpy) to read in a text file into an array: `y = np.genfromtxt("1400list.txt", dtype=[('mystring','S20'),('myfloat','float')])` Which works okay, except it doesn't seem to read my 2 columns into a 2D array. I am getting: [('string001', 123.0),('string002', 456.0),('string002', 789.0)] But I think would … | |
So, maybe this is a concept out of the domain of programming... but I think not. Lets say we have a 400MB video file that we want to either send somewhere, or stream. Can we use python to break it into binary, break the binary into chunks, and then send … | |
Hi, I'm new to Python. Can someone please guide me in writing a Python script that bulk processes audio files and image files to create an audiovisual or movie out of them. Say we have 20 images and 20 audio files and want to create 20 video files out of … | |
I'm trying to open a tex file from within python, tell the tex editor to run (manually you would press ctrl + T) and finally close the program. So far I can only figure out how to open and close the program. this is what I have so far... os.spawnv(os.P_WAIT, … | |
Hello! I was trying to display/print elements of a list, suppose a = [1,2,3,4,5], using functions. But the code i wrote prints only the first element of the list whereas i needed all the elements of the list to be printed( as in 1 2 3 4 5 but all … | |
| Hello, I am having some trouble in importing a CSV file into an array. The CSV file has multiple columns, and what i really wanted to end up doing is getting the element inside each block of the CSV file. So far i've only been able to get a row … |
I am currently doing a python challenge in which I have to create certain codes. I am stuck on a particularly hard question and would appreciate some help. The problem is: In 1989, a journalist asked Paul Boutin, an engineer at the Massachusetts Institue of Technology, "What do you think … | |
So far, I think I'm doing it right however it doesn't seem to generate the results I wanted. def occurrence(e,List): for item in List: s = 0 if item == e: s += 1 return s Basically I want my function to count how many times e occurs in List. … | |
I'm trying to make a simple random name generator by pulling first and last names from text files. The problem I'm having is that sometimes the names are chopped off and incomplete with the output and sometimes the names are on two different lines. I would also like to be … | |
I developed a program I think has potential, but don't want the end user to a) have to download python and b) steal my code. How would I turn it the .py of my script into a .bat or .exe so my end user can run it? | |
I'm looking for the web online course for my learn Python Where are the best to learn python? Who know tell me, please. Thanks! | |
Modify the guess My Number program given below. Modify it so that now the player has only five guesses. If the player runs out of guesses, the program should end the game and display an appropriately chastising message. # Guess My Number # The computer picks a random number between … | |
Python & binary tree help PLEASE?!?????????please please please help me in anyway :'(? Write a Python program that : a: Takes in as input a list of numbers (Note that you have to type in these numbers using the keyboard) using: def insert(tree, key): if len(tree) == 0: return [key, … | |
Hi I am trying to automate svn checkouts using python script. this below command works from windows command prompt. I tried to use subprocess.call and subprocess.Popen , C:/Program Files/TortoiseSVN/bin/TortoiseProc.exe /command:checkout /url: http://xxx-svn/svn/branches/Common/module/Common_Jars_v1_1/lib /path:D:/svn-test1 /closeonend:2 it is not able to recognise the parameter > C:\Users\rajesh\Desktop>python svn-test.py > Traceback (most recent call … | |
I need someo #A Python text-RPG #A Jak Production #APOC global ammo global health global lives global exp global food ammo=55 health = 100 lives=10 exp = 0 food = 30 def part1(): print "50 Days After The Outbreak:You are standing outside of the Empire State Building." print "Vines, plants, … | |
Just wondering how the game would be put together, maybe even a step by step tutorial. I could use this to practice with the commands used without Tkinter or Pygame. This could be a good learning experience. | |
Hello, I am new to the forums and I am just starting to learn python. I have been writing the following program and have ran into a problem with getting it to work right. If anyone can offer some advice on what I am doing wrong I would be thankful. … | |
Could someone please tell me what this means. a[ ..., j ] Thank you | |
can someone correct this code for me? also, how do you make cmd open the .py file than execute that .py? def addition() print "This part of the test cover addition" p1 = raw_input "What is 9+9" if p1 = "18" set c()= c+1 c= 0 print "correct" else: print … | |
Hey guys, I'm trying to make an AI character perform a pattern movement when a certain action occurs rather than have him do it all the time. I call two different methods, one to move him left, then move him right, the problem is the first method is still active … | |
Just a few more explorations using a Python class to mimic a C Structure or Pascal Record. Loading the record from a csv type data file, displaying the data and sorting and searching the data in various ways. | |
| t=input() while t>0: t=t-1 m,n=input().split(" ") m=int(m) n=int(n) m=m%10 n=n%4 if n==1: print (m) elif n==2: print (m*m)%10 elif n==3: print (m*m*m)%10 else: print (m*m*m*m)%10 why this code is giving me NZEC error ? it is irritating me now. thanks |
The End.