15,185 Topics
| |
Hello everyone, It's about a week that I have started to learn Python, and I am planning to design and code a simple chat server, with a bunch of clients as a practice. I have seen the easiest implementation of such program on the net(just google: "Simple chat server in … | |
So I'm pretty new to using python and a beginner. I've written a code on how to figure out the length of 2 polylines and now I'm trying to figure how to display the data using canvas... I've tried like a million times and I just can't get it to … | |
I am trying to make a number guessing game in Python. The correct number is 42. Right now I have it so that it gives you a message when you are too high, too low or right on. I want to add two other messages. One message for no input … | |
Hi, I have some problems just to write a simple string output to some txt.file. That is my test code: [CODE]test = open('Test.txt', 'w') test.write("Teststring") test.close()[/CODE] I use Python 2.6.5 and PyScripter If I direcly enter the code in the IDLE SHELL, sometimes it works, sometimes only the file is … | |
Hi Folks, I have a set of csv files that I open and read the contents of a row into a DictReader, this works fine 99% of the time, but occasionally one of the fields in a record has an extra new line character. For example here's the format of … | |
I have a file that has a repeated number of blocks of different sizes as in below: ID: 2 Time: 76 Op: GET Domain: facebook.com LPath: /common/css/common.css Referer: [url]http://google.com[/url] User-Agent: Mozilla/4.0 ID: 3 Op: GET Domain: rfi.fr LPath: /common/css/common.css Referer: [url]http://yahoo.com[/url] For each block, I want to print only the … | |
Hi all, does anyone know if there is already a module or something floating about that would let me create apps for my itouch all responses are appreciated, python01 | |
If we have a number -2.0, -1.0, 0.0, 1.0, 2.0, 3.0 etc, can we remove the floats with minimal usage of if statements? I know that we can round down, but it wouldn't work in case we get a float like 1.2435532, or something similar. Note: Note that the list … | |
I want some insight into /etc/apt/preferences and /etc/apt/sources.list file on debian | |
I'm trying to make a Python script that makes a HTTP POST with some headers, and with a file as the body. I've found all sorts of documentation online about making a HTTP POST with headers, but can't figure out how to make the POST with a file as a … | |
I have 2 lists X=['a'] Y=['b','c','d','e','f'] I need to make a new list Z such that, Z = ['ab','ac','ad','ae','af'] I know this uses simple concatenation. I tried several times but without success. I am a beginner so please help me with the code. Thanks in advance. | |
Hi I've been pulling my hair out over this program. It is uses a Class for creating objects to be used in an ordering tracking system. I'm having problems calling the objects and implementing them. I'm trying to follow a structure along these lines When an order is created payment … | |
Convert the following code to a for loop while (b < a) : b = b + 1 print b | |
Hello all, I am in need of a simple plotting library in python that can work according to the given specification. I have around a million entries of data which I need to represent on a graph. The problem is that most of the libraries need a list for plotting … | |
whenever i want to use urllib or urllib2, i get this error IOError: [Errno socket error] (10035, 'The socket operation could not complete without blocking') i have tried googling it yet i havent found anything helpful any help is apreciated, python 01 | |
Hi there, I am fairly new to Python and have installed Python 2.6 and IronPython 2.6 for .net 4.. I am attempting to write my first script and can't get past my first line of code, which is just import clr I get the error ImportError: No module named clr … | |
I'm trying to use pythons logging.handlers.SMTPHandler with a configuration file (so that I don't have to have passwords etc. inside of the script) Now the guide I'm following is [URL="http://docs.python.org/library/logging.html#configuration-file-format"]here[/URL], now the RotatingFileHandler is working, but I never receive an email, or an error for the SMTPHandler. Anyway here's the … | |
Hi, I want to change an item from one value to another. How would I do this? | |
hi all, im fairly new to python and am struggling to find out how to read javascript values from a site. Help is much appreciated. thanks, Python01 | |
Say I have two lists: list1=[a,b,c,d,e,f,a,b,c] list2=[a,c,d] How could I compare list1 and list2 such that I would get an output like: list3=[match,-,match,match,-,-,-,-,-] So that it goes in order Here's my code: [CODE]h=[] for i in range(len(change2)): for j in range(len(atom)): if atom[j]==atom[i]: h.append("H") else: h.append("-") print h[/CODE] Both change2 … | |
Hi, I want to change an item from one value to another. How would I do this? | |
Sorry if this is in the wrong thread, I haven't been here in a long time. Hi, I'm having a hard time in trying to position my wx.StaticText and wx.TextCtrl so that it's not stuck at the very top and very left. Life so [URL="http://i154.photobucket.com/albums/s274/Tye-Ann/daniweb.png"]Screenshot Here[/URL] Here is the code … | |
Here's something of mine that might actually be useful: a Python implementation of the K-means clustering algorithm. I wrote something similar last year in Java for a school project, and decided to rewrite it in Python this summer for practice. The purpose of the algorithm is to discover internal structure … | |
Hey, I am trying to use multiprocessing via the Process module. I run two processes in unison and for some reason python or the os kills my process after roughly 50 seconds or during long processes (~3 min). I just get the following output: File 3 of 8 2010-10-11 13:28:09.090816: … | |
Hi everyone.. I'm new to python, the more to matplotlib :( and I am hoping that I can get help from this community... :) I have a .csv file, first column is a time stamp with format HH:MM:SS, next 8 columns are values of different parameters. I want to plot … | |
while trying to install net-snmp-5.6, i get following error [B]gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c netsnmp/client_intf.c -o build/temp.linux-i686-2.5/netsnmp/client_intf.o netsnmp/client_intf.c:1:20: error: Python.h: No such file or directory In file included from /usr/local/include/net-snmp/net-snmp-includes.h:69, from netsnmp/client_intf.c:4:[/B] my debian system has python2.5.2 where can I find Python.h header … | |
I am having problems with tuples. I have a list of tuples that have (x,y,z) coordinates. Each coordinate is a float. How can I calculate the distance between two coordinates? Can you do this with tuples? [CODE]coord=[] for line in CN_list: x=line[30:39] y=line[38:47] z=line[46:55] coord.append((float(x),float(y), float(z)))[/CODE] | |
Minimal Server [CODE]import socket s = socket.socket() host = socket.gethostname() port = 1234 s.bind((host, port)) s.listen(5) while True: c, addr = s.accept() print 'Got connection from', addr c.send('Thank you for connecting') c.close()[/CODE] Minimal Client [CODE]import socket s = socket.socket() host = socket.gethostname() port = 1234 s.connect((hos[/CODE]t, port)) print s.recv(1024) These … | |
Im making a custom text editing program as a mini project and id like a little advice on the way to go about it. Within wx python I could use a rich text box or a textctrl box I believe. The type of things I am going to need my … | |
I heard this forum was a wonderful place to ask programming related questions. So here I am, I'd like to know if anybody has a solution to a problem I'm having. I'm currently planning on creating a game on Python, and I've decided to make use of a joystick in … |
The End.