15,190 Topics

Member Avatar for
Member Avatar for novice20

hi...i am trying to install python 2.6 on my debian system.. I followed the following instructions[B] [url]http://www.fps-gamer.net/installing-python-2-6-on-debian-lenny/[/url] [/B] on doing [B]aptitude install -t testing python-central[/B] i get [B]E: Invalid record in the preferences file, no Package header[/B] can any body pls reason out:(

Member Avatar for Gribouillis
0
784
Member Avatar for redyugi

This is used for finding the roots of a parabola. The parabola must have a number in front of x2 (x squared), a number in front of the single x, and a following number, or you can have a perfect square parabola. (in the form "number x2 - number") This …

Member Avatar for redyugi
0
443
Member Avatar for neely615

I am new to this forum (and python), but since I found excellent post here, I figured it would be the best place to post this question which is two part: I have many (+100) .txt files which are space delimited (not csv or tab, possibly referred to as ASCI?) …

Member Avatar for neely615
0
577
Member Avatar for Gribouillis

The with statement allows all sorts of syntactic sugar in python. This snippet defines two contexts: [icode]inevitably[/icode] and [icode]preferably[/icode] which register a function call to be executed at the end of a block of statement. Although they are not very useful (the function call could be written directly at the …

1
541
Member Avatar for dustbunny000

Hi. I was wondering if anyone knows how to establish x,y,z coordinates in python. I want to be able to extract this data from a text file. Here are sample lines in my text file: [CODE] ATOM 1 N GLN A 4 62.131 49.287 59.621 1.00 67.10 N ATOM 2 …

Member Avatar for TrustyTony
0
838
Member Avatar for group256

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 …

Member Avatar for python01
0
151
Member Avatar for communitygirl90

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 …

Member Avatar for strider1066
0
159
Member Avatar for doctorjo5

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 …

Member Avatar for Schol-R-LEA
0
217
Member Avatar for Brutus2000

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 …

Member Avatar for d5e5
0
99
Member Avatar for PaulStat

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 …

Member Avatar for d5e5
0
2K
Member Avatar for Ashena

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 …

Member Avatar for TrustyTony
0
14K
Member Avatar for python01

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

0
51
Member Avatar for KrazyKitsune

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 …

Member Avatar for Gribouillis
0
48
Member Avatar for novice20

I want some insight into /etc/apt/preferences and /etc/apt/sources.list file on debian

Member Avatar for Gribouillis
0
43
Member Avatar for Wumbate

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 …

0
44
Member Avatar for knan

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.

Member Avatar for Gribouillis
0
114
Member Avatar for Ultralisk

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 …

Member Avatar for Ultralisk
0
157
Member Avatar for sss33

Convert the following code to a for loop while (b < a) : b = b + 1 print b

Member Avatar for snippsat
0
44
Member Avatar for nk28

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 …

Member Avatar for Gribouillis
0
146
Member Avatar for python01

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

Member Avatar for python01
0
166
Member Avatar for sjones1025

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 …

0
46
Member Avatar for PaulStat

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 …

Member Avatar for Gribouillis
0
1K
Member Avatar for dustbunny000
Member Avatar for Nick Evan
-1
85
Member Avatar for python01

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

Member Avatar for python01
0
264
Member Avatar for dustbunny000

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 …

Member Avatar for Gribouillis
0
117
Member Avatar for dustbunny000
Member Avatar for Gribouillis
0
226
Member Avatar for Megabyte89

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 …

Member Avatar for Megabyte89
0
980
Member Avatar for G-Do

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 …

Member Avatar for woooee
2
1K
Member Avatar for jeffrey.pry

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

Member Avatar for woooee
0
164
Member Avatar for arareyna

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 …

Member Avatar for Gribouillis
0
3K

The End.