15,175 Topics

Member Avatar for
Member Avatar for TrustyTony

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.

Member Avatar for hughesadam_87
0
556
Member Avatar for M.S.

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 …

Member Avatar for vegaseat
2
270
Member Avatar for python1956

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 …

Member Avatar for vegaseat
0
539
Member Avatar for ryantroop

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 …

Member Avatar for hughesadam_87
0
178
Member Avatar for neriahfred

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 …

Member Avatar for hughesadam_87
0
191
Member Avatar for imixkumuku

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

Member Avatar for hughesadam_87
0
1K
Member Avatar for depy

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 …

Member Avatar for vegaseat
0
608
Member Avatar for BobTheLob

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 …

Member Avatar for Ene Uran
0
6K
Member Avatar for theadmiral99

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 …

Member Avatar for TrustyTony
0
186
Member Avatar for ProNewb

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

Member Avatar for ProNewb
0
174
Member Avatar for blaine.rogers.14

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 …

Member Avatar for blaine.rogers.14
0
258
Member Avatar for Jacklittle01

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?

Member Avatar for Alice25
0
3K
Member Avatar for duyencaothi

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!

Member Avatar for Max00355
0
177
Member Avatar for apaulogy

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 …

Member Avatar for Max00355
0
208
Member Avatar for beela16

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

Member Avatar for Lardmeister
0
272
Member Avatar for brajesh79

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 …

Member Avatar for Lardmeister
0
15K
Member Avatar for Jacklittle01

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

Member Avatar for M.S.
-1
167
Member Avatar for chris99

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.

Member Avatar for Jacklittle01
0
1K
Member Avatar for nova4005

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

Member Avatar for nova4005
0
145
Member Avatar for zeusprog
Member Avatar for zeusprog
0
139
Member Avatar for Jacklittle01

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 …

Member Avatar for Jacklittle01
0
134
Member Avatar for Dann0

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 …

Member Avatar for nmaillet
0
175
Member Avatar for vegaseat

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.

Member Avatar for hughesadam_87
3
363
Member Avatar for I_m_rude

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

Member Avatar for I_m_rude
0
90
Member Avatar for foodstamps

I'm a complete beginner in the programming world, so forgive me for the basic questions. I'm trying to run Peter Norvig's spelling corrector from the Windows XP command line, but am having difficulties. I have a text file of addresses with a number of misspellings. I would like to use …

Member Avatar for TrustyTony
0
324
Member Avatar for zeusprog

Please I'm new to python and I'm trying to understand a line of code. Can someone please explain to me the implications of the addition of the for loop inside brackets with the random integer generator. Thank you for i in range( 0, 50 ) : ran_values = [ random.randint( …

Member Avatar for zeusprog
0
270
Member Avatar for runge_kutta

Hi! I have been using igraph to generate graphs representing social networks (i.e. people are represented by nodes/vertices and connections between people are represented by edges). This has been going well, and I've managed to plot these relationships with some success. My question: Can I associate a 2-D position with …

0
56
Member Avatar for Dan08

Hi, can someone please tell me if there is a way to make my server accessible from the outside world? it works pretty well on localhost. I tried port forwarding, opening the ports it uses, but nothing works. I read somewhere that it only allows connection from the same network, …

0
136
Member Avatar for ryantroop

Which module would I look into to capture things like disc read/write speed, as well as possibly capture what the disk is reading/writing at the time. I would like to make a diagnostic module to check if my disc speed is taking a hit, as I rebuilt a PC and …

Member Avatar for ryantroop
0
97
Member Avatar for henry.sj.shin

Hello All, I'm trying to write a function that outputs the reverse of the input. I know that you can use the built-in list.reverse() or S[::-1] methods, but I want to make it using the 'for' loop. My code initially is: def reverse(S) for x in S: print(x, end = …

Member Avatar for TrustyTony
0
392

The End.