15,179 Topics
| |
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 … | |
Can anyone suggest how to create Table Row and Column in WxPython? Thanks in Advance[TEX][/TEX] | |
[CODE]def egcd(a,b): u, u1 = 1, 0 v, v1 = 0, 1 while b: q = a // b u, u1 = u1, u - q * u1 v, v1 = v1, v - q * v1 a, b = b, a - q * b return u, v, a … | |
The problem is to get a random list of numbers from a list This is what i have so far.[CODE]import random def numberShuffle(myList): sList = [] nNumbers = len(myList) for i in numbers: j = random.randint(i) return (sList) [/CODE] | |
I think i have the function for mean but i also need to figure out below mean. This what i have so far.[CODE]import math def mean(alist): belowMean = alist mean = sum(alist) / len(alist) if mean <= alist: belowMean = item return belowMean [/CODE] | |
I am having trouble trouble figuring out this problem any help would be appreciated. The problem wants you to change english into pirate language. Using the string split and join methods. This is what i have so far. [CODE]import copy def wordReplace (wordText): wordDict = { "hello" : "avast" , … | |
Hi, guys I'm having trouble writing this word count program in python3. I've been able to find alot of help for past versions but nothing for 3. It is just a simple word count program, with a user input sentence. So far I have [CODE] def main(): print ("This program … |
The End.