15,190 Topics
![]() | |
Hey i'm trying to place a ship onto my grid but my translation function is trying to iterate over None type, if someone would write a simple horizontal ship placement in translation function i'm sure i can finish the rest, thank you! [CODE]class start(object): def __init__(self): self.GameT = int(raw_input("One Player … | |
[CODE]sizeA = 2**28 M = [0]*sizeA[/CODE] The above code creates an array but, each element is 4 bytes each. How do create a large byte array with type 'B' (eight bits unsigned)? I would like it to be as large as possible. I need it for a sieve prime number … | |
Hi. I have a small dilema. I have 1 Picassa .ini file a contacts.xml file and a few images all in the same folder. On the images there are certian people, picassa.ini file holds the image name and id's of people included on that image in such format: [CODE][img_8538.jpg] faces=rect64(4ac022d1820c8624),d5a2d2f6f0d7ccbc … | |
For school I have to write a program that requests a 3 part name and breaks it into a first, middle, and last name. I wrote the code but the alignment of my output is not right. I was wonderng if someone can tell me what I did wrong and … | |
Hello guys, just joined the community. Found it through google. :) I am basically new to python, only couple of days of knowledge. I am trying to make all the words in a txt file appear in 4 or 5 in a row. so the txt file looks like this: … | |
For school I have to write a program that requests a 3 part name and breaks it into a first, middle, and last name. I wrote the code but the alignment of my output is not right. I was wonderng if someone can tell me what I did wrong and … | |
Hi, Just started learning python..and want to learn to do this I want to read a text file that something like 10000 20000 30000 40000 20000 30000 88888 88888 60000 12333 44431 12345 I want to get the difference of numbers in column1 divided by x, where I want to … | |
(I'm new to programming in general) I created a program in python without an interface and part of it used a raw_input to get a users answer and compare with a stored answer. This was in a loop that limited the number of attempts the user could have. This worked … | |
So, even thou I have searched throughout the forums, I couldn't get a clear answer, maybe perhaps I'm a noob @ Python. As a beginner, I don't know much about Python, and it's frustrating to search the net and not find the actual answer. So, I'm working on this project, … | |
Hello, pls can anybody show how works printing? here is the code: [CODE]class Student(object): def __init__(self, name): self.name = name self.report = dict() def add_subject(self, subject): self.report[subject] = list() def subjects(self): return self.report.keys() def s_subjects(self): lpre=[] for subject in self.subjects(): lpre.append(str(subject)) print lpre class Subject(object): def __init__(self, name, teacher = … | |
Hi.. I'm a first time poster so please excuse any idiocies.. I'm a third year software design student and I am on my Industrial placement. I have been given the task of parsing 100's of word documents. I am required to extract the information stored in certain tables and export … | |
Hi everyone! Am new to python, getting grounded in it as fast as i can but now, i have some issues. I use the web2py framework for web development. At the moment, am working on a blog using one of the CMS (named InstantPress) designed in web2py also. While editing … | |
i've been having trouble figuring this out since im new to python and i really wanna figure it out! Write a Sentinel controlled While loop that allows the user to enter text until they enter ! by itself. Output would be like this: Enter some text: Hi Enter some text: … | |
Hi, I'm pretty new to python, just started 2 weeks ago xD, and new to forum too, I tried to search to see if there were any other question that was similar to this but couldn't find one. Therefore, I apologize if there's already another thread with the similar problem. … | |
I have a problem that I have been working on. I felt like I was getting close just to find out with wasn't the 100% correct way of doing it. What I need to do is take a list of names from a file in the format last, first, middle. … | |
Hi team. I have the below code working 100% on my local machine. It makes the required updates and I am happy with it. But when I try to run it from the server, it gives the attached error message. Please ignore all other lines(I have just removed other lines … | |
Hi, firstly i'm gonna be honest and say that this is homework for my programming class, but the teacher doesn't have a problem with us using the internet to get help aslong as we dont blatantly steal code. The problem is to take a text file containing for example the … | |
![]() | Hi. I'm new to python. First off I'd like some advice on where to find modules for python that I can trust don't do anything malicious. There seems to be a lot of modules availible for python but how do I know that they only do what they advertise they … ![]() |
Hello, I have some networking questions for anyone. What library(s) is best for the following task. Obviously in python. I have 2 servers and an undetermined amount of clients(<100). 1 of the servers is a game server. 1 Server will be used as a "middle man" server that sends commands/info … | |
i using this code for making a page but the images are not showne in web browser win i deploy the script please help..... [CODE] def get(self): self.response.out.write(""" <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>my page</title> <link href="stylesheet.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>my page</h1> """) f_path=os.path.join (os.path.dirname (__file__),'\image') … | |
I have a question...I'm trying to get text out of a website containing Spanish characters (like ñ or á) using urllib2 (and with #-*- coding: latin-1 -*- near the beginning of the Python file). However, when I write the output of the text to a file, I get something else--for … | |
Hello, How do I mark a thread as solved? And if there are other tips? Bauke | |
I have data which has a very particular format that I'm trying to store in a numpy array. avi_05MSalt00001.txt 2012 Feb 07 20:12:41 50000 (usec) 300 10 I've defined the following numpy datatype: [CODE]timefile_dtype=numpy.dtype([ ('filename', file), ('year', int), ('month', str), #Why don't these work? ('day', int), ('time', str), ('int_time', int), … | |
is there a way to keep the format of a html source code for example when you view a source code of a website, is there anyway to keep the same structure, i have tried using read() readlines() i tried saving the source code then opening it up in my … | |
My little GUI runs a command line program which has a progress indicator in the console window. How can I make this data appear on my Gui status bar? Thanks. | |
hi i want to know how i would display i file that has been open and read into the tkinter text widget do i have to write it out the file to a variable than insert it into tkinter text widget? | |
Hey guys! I wrote a small program, which works. Unfortunately, when things get too complicated, it breaks down. The objective is to list the occurrences of vowels in a given word, such that for (word = yellow) and index spits out (e = 1, o = 1) The code KIND … | |
Hello, Below a part of my code. The part 'for index in range(len(regels))' works but doesn't go through all of the lists in 'regels'. 'regels' is a nested list. [CODE]for row in inputReader: regels = ['Auto','Brandstof auto',' tinq ',' shell ',' tank s ',' dap ',' slump oil ','q8 ','brand … | |
I have this code, it's basically a program which I wrote, a 'Guess my number' game. The only problem is that I did something, and now I can't choose from my options anything else, that the first option. I put all my conditions in the while True loops, and now … | |
Hello, Friends, I am new to python, currently I have a requirement to use python to create a mapreduce job in HADOOP... I searched every where but couldn't get any lead. 1) First I need read a KEY, VALUE pair from the Hadoop sequential file. 2) Secondly, need to uncompress … |
The End.