15,179 Topics

Member Avatar for
Member Avatar for darealsavage

Hello everyone im pretty new to python and im having some trouble creating a program that takes a file containing numbers and imports it into python and makes it look like a table. the table is supposed to look something like this when the program is run. basically i figure …

Member Avatar for snippsat
0
261
Member Avatar for tizzqman

I need help with my code. Im kind of new to program and i need to do a final project for my class. I decided to do a converter program because i thought it would be sort of easy and challenging at the same time. but i wrote the program …

Member Avatar for sneekula
0
231
Member Avatar for mical700
Member Avatar for biscayne

Thw following piece of code generates 1 file for each row in csvData. I want to generate only 1 file and have already adapted the rest of the code. But not this main-loop. Is there an easy way to do this ? index = 0 # Generate the Scribus Files …

0
84
Member Avatar for biscayne

I have a piece of code where I fill variables with data and would like to add the first column of each row into the variable: So each variable in a row should contain: %VAR_ + 'value of column[0]' + headerRow[i] + % Now it looks like this which makes …

Member Avatar for biscayne
0
194
Member Avatar for bintony.ma_1

hi experts, I have a new quesiton following what I asked before: http://www.daniweb.com/software-development/python/threads/436159/python-remove-lines-when-two-specified-words-in-the-same-line I am still new python user, and hope and get your help again. my task is to do the following Python Remove current and following 3 lines when two specified words in the same line I have …

Member Avatar for bintony.ma_1
0
453
Member Avatar for sym366

trying to impleament a checkWin function that checks all possible wins for a player, but I'm notreally sure how to do it. from connect4cell2 import Connect4Cells from Tkinter import * class Connect4Frame(object): COLORS = ["White", "Red", "Yellow"] def __init__(self,rows = 6, columns = 7): self.cells = Connect4Cells(rows, columns, 3) self.rows …

Member Avatar for sym366
0
1K
Member Avatar for JazzyJ

I'm in my first AND LAST computer science class and I really need help with our final project. Up to this point all of my assignments have been completed from my teacher and TA standing over my shoulder telling me exactly what to do. I'm pretty sure they're just as …

0
120
Member Avatar for flopoe

Hello everyone; I am new to Python. How can we explain this code step by step. I couldn't understand some parts. myList=[43,21,12,80,3,2,35] end=len(myList)-1 while (end!=-1): swapped=-1 for i in range(0,end): if myList[i]>myList[i+1]: temp=myList[i] myList[i]=myList[i+1] myList[i+1]=temp swapped=i end=swapped print(myList)

Member Avatar for vegaseat
1
981
Member Avatar for inaxassan

Consider a hospital scenario. Design classes for: Patients. The class might have fields like unique ID for the patient, name, male or female, age, address, phone number, date of birth, height, and weight. I need help with this problem

Member Avatar for vegaseat
0
2K
Member Avatar for inaxassan

Design a schedule class for classes that a student takes during a semester? This is not a homework `class schedule: def classes(self, course, points, level,): self.course= course self.points = points self.level = level def get_course(self): return course.name` I am stock here

Member Avatar for vegaseat
-1
750
Member Avatar for slasel

Can I change the font size in only one widget and keep it the same in the root window? if yes then how please?

Member Avatar for vegaseat
0
240
Member Avatar for inaxassan

Design a class called "sentence" that have a constructor that takes a string representing the sentence as input. The class should have the following methods: get_first_word get_all_words replace(index, new_word) Change a word at a particular index to "new_word." E.g. If the sentence is " I'm going back." and set_word_at_index (2, …

Member Avatar for sneekula
0
1K
Member Avatar for inaxassan

class airlineTicket: def __init__(self, start, destination, dateoftravel, firstClass,\ economy, business, price): self.start = start self.destination = destination self.dateoftravel = dateoftravel self.firstClass = firstClass self.economy = economy self.business = business self.price = price Design a class for an airline ticket. Some of the fields of an airline ticket are start, destination, …

Member Avatar for sneekula
-1
2K
Member Avatar for redcar2228

This is my code for creating a url list and Im getting an index out of range error? Please help! #! /usr/bin/env python import re TOTAL_PAGES = 619 idFile = open("listOfURLs2", "r") outFile = open("output", "w") idList = [] urlList = [] temp = "" tempStr = "" currentList = …

Member Avatar for snippsat
0
388
Member Avatar for foodstamps

I'm trying to process a list contained within a separate text file. I am able to read the file, and generate an output containing the contents of the file, but the output generated is the unprocessed version, identical to the input. I do not encounter this problem when the list …

Member Avatar for foodstamps
0
309
Member Avatar for biscayne

Using print in a python script gives the following result: 10.25, 9.23, 8.97, 8.71, 8.40, 8.36, 8.30, 8.21 10.25, 9.23, 8.97, 8.71, 8.40, 8.36, 8.30, 8.61 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15 0.60, 0.60, 0.60, 0.60, 0.50, 0.50, 0.50, 0.15 4.85, 2.85, 1.85, 1.25, 0.95, 0.85, 0.80, 0.45 …

Member Avatar for biscayne
0
245
Member Avatar for piyush3dxyz

yesterday one of my friend tell me to make RTS engine in pygame......I know basic things which is used to make RTS Like 1. Unit selection 2. Unit moving 3. Resource management But only 1 thing i still cant figure out....Which is path finding.....I read all articles which is on …

Member Avatar for yoni0505
0
120
Member Avatar for prashanth s j

Hi all, could anyone please provide me a simple example of python threads? I tried looking at the python cookbook, but I find it quite confusing with its mentioning of thread, threading etc (I am familiar with threads in C only) All I want is: From my machine I need …

Member Avatar for Gribouillis
0
342
Member Avatar for That.T3rr11

I need help converting this python code to c# could someone help me please? #!/usr/bin/env python # encoding: utf-8 import sys, getopt import os, urllib, urllib2, re, string, math help_message = ''' ''' no_param = ''' ''' verbose = False fakeMode = False curPath = os.getcwd() + "/" # Should …

Member Avatar for deceptikon
0
508
Member Avatar for TeaAnyOne

12347 10000 secretary James Harrison 12348 20000 secretary Jade Powell 12341 40000 consultant Adam Johnson Hi, lets just say that the text above is a text file. I would like to store these employees information, then asking the user to search for (e.g payroll number) which then will print full …

Member Avatar for Lardmeister
0
79
Member Avatar for hpre

What is the best heuristic for solving the Sokoban problem (using astar and gbfs)? can you show me an exsample for the implementation?

-1
43
Member Avatar for hpre

please help! I keep getting this error : (-3, -3, IndexError('list index out of range',)) class SokobanProblem(search.Problem): def __init__(self, initial): ##-------- creates an object of the class ## tmp_list = list(initial) row_len = len(tmp_list) column_len = len(tmp_list[0])-1 goal_list = [] for i in xrange(0, row_len): tmp = list(tmp_list[i]) goal_list.append(tmp) goal_tuple …

Member Avatar for Schol-R-LEA
0
253
Member Avatar for StinaBremm

For my networking class we have to do an assignment using python to code a client and server that will connect to each other and the client will send these messages: 0 - Response This message is a response to a previous request 1 - Echo Request This is a …

0
148
Member Avatar for lycanickel

Hello everyone I am of course new to ppython and I am having trouble joining an integer variable and a string without a space in between them. Lets say my variabe was an integer of num = 121 and I wanted to print the proper ending of "st". which would …

Member Avatar for Gribouillis
0
371
Member Avatar for krystosan

i read on the setuptools page that they do not have setup for win 64 bit and instead their is ez_setup.py which i downloaded and from command prompt typed `python ez_setup.py` then i checked back in the *D:\Python26\Lib\site-packages* directory their is a new easy-install.pth,setuptools.pth,setuptools-0.6c11-py2.6.egg,andd setuptools-0.6c12dev_r88846-py2.6.egg file, now from python interpreter …

Member Avatar for krystosan
0
210
Member Avatar for TeaAnyOne

12347 10000 secretary James Harrison 12348 20000 secretary Jade Powell 12341 40000 consultant Adam Johnson Hi, lets just say that the text above is a text file. How would I go about searching and printing the rows with 'secretary' only? Or any other value? When the user is asked to …

Member Avatar for TeaAnyOne
0
178
Member Avatar for chophouse

I just moved to a new server and installed Python 3.3. On my old box i was using Python 3.2. Now my scripts that import pymysql won't work, saying the module doesn't exist. Wher do I download this from? I'm on Win Server 2008 R2 (on both boxes) Thanks

Member Avatar for chophouse
0
103
Member Avatar for slasel

Hi, Is it possible to embed something made with pygame, like some sort of animated display or bouncing ball... into a Tkinter made window, with tkinter buttons/frames etc... If yes, then may you please tell me how can i do that? Thanks

Member Avatar for vegaseat
0
232
Member Avatar for shills300

hi guys, i was wondering if anyone knew how to make a color wheel in python using turtle. i'v searched all over the web to see examples but haven't had any luck. i am a beginner programmer and it's very confusing to say the least so any explanations would be …

Member Avatar for vegaseat
0
3K

The End.