15,194 Topics

Member Avatar for
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
160
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
46
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
150
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
169
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
49
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
87
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
276
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
127
Member Avatar for dustbunny000
Member Avatar for Gribouillis
0
227
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
982
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
165
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
Member Avatar for novice20

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 …

Member Avatar for Gribouillis
0
572
Member Avatar for dustbunny000

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]

Member Avatar for griswolf
0
97
Member Avatar for lewashby

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 …

Member Avatar for Gribouillis
0
125
Member Avatar for Archenemie

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 …

0
67
Member Avatar for P!th

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 …

Member Avatar for P!th
0
234
Member Avatar for Abhishek2805
Member Avatar for cghtkh
0
57
Member Avatar for softbrianes

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

Member Avatar for Schol-R-LEA
0
103
Member Avatar for pacers10

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]

Member Avatar for TrustyTony
0
63
Member Avatar for pacers10

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]

Member Avatar for Schol-R-LEA
0
94
Member Avatar for pacers10

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" , …

Member Avatar for Schol-R-LEA
0
81
Member Avatar for corrwee

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 …

Member Avatar for griswolf
0
239
Member Avatar for tushartyagi

For my final year project, I plan to write a cloud server using Python. The client will be written by the other team member in Java. The first and foremost problem I have is make the necessary communication between the server and clients. For server to client talk, I thought …

0
62
Member Avatar for Syphilis

Ahoy Sailors! So I'm making an application using py2exe, Now as we all may know files get a tad hefty, I've trimming un-needed modules, Compressed the remained and finally compressed the resulting exe with UPX. Currently I've built the file under Python2.3 (Earlier the version, The smaller the dll). However …

Member Avatar for Syphilis
0
77
Member Avatar for Sci@phy

Hello. I've just started learning Python and I have a few questions. I'm using my program to communicate with some device through serial port using serial.py library. It's all going really fine. I've got a class device, and I'm using it to communicate with a device (logical ;) ). Q: …

Member Avatar for Sci@phy
0
113
Member Avatar for Don Monroe

Hi, I am a beginner with python,and have this assignment that buggs me for some while..hope smb can help me...now, the thing is that I have merged the lists of view point positions of the camera in an function:[CODE] mergeList=list() def linear_merge(list1, list2): mergelList = [] for item in list1: …

Member Avatar for TrustyTony
0
323
Member Avatar for peachdot

Hi there, i used tabControl. In first tabpage, user need to fill in the textboxs(ie:Name,id number,age,address,etc.) Then "Next" button click, a summary of what have been entered in 1st tabpage need to be display in second tabpage. i tried using label to display, self._label12.Text = self._textBoxName.Text self._label14.Text = self._textBoxAge.Text but …

Member Avatar for woooee
0
180
Member Avatar for rajashekharv

hi All, Looking for the python code which adds the lines to existing file at the beginning of the file. Tried using the seek method but not able to succeed. Can any one please help on this ?

Member Avatar for Gribouillis
0
83
Member Avatar for PaulStat

I'm trying to use the [url=http://docs.python.org/library/logging.html]logging[/url] module for python (2.6), whenever I try to use one of the handlers however it claims it doesn't exist. For example [code] import logging.handlers.SMTPHandler [/code] Gives me the error [quote] Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module …

Member Avatar for PaulStat
0
69
Member Avatar for ghingghing

we have a project on our finals and we need to make a program of payroll using menu with the output of employee name, update employee record. display employee record, delet record and exit in the main menu. .we are using the c++ program. .hope u can help me thank …

0
45
Member Avatar for DragonReeper

Okay basically I want to load an image and skew it. Does anyone have any suggestions how I can accomplish this? For a visual representation of what I want to do [CODE]+-+-+-+ |o|o|o| +-+-+-+ |o|o|o| +-+-+-+ |o|o|o| +-+-+-+ To: +-+-+-+ |o|o|o| +-+-+-+ |o|o|o| +-+-+-+ |o|o|o| +-+-+-+ [/CODE] The o's are …

0
70
Member Avatar for Saboo-Coder

Hello, friends! How can you resize an image in Python without using any image modules. Our teacher said that we can ONLY use the MEDIA module - no other modules allowed! So, how would you resize an image in this case? Here is the task that our teacher gave us: …

Member Avatar for TrustyTony
0
108
Member Avatar for novice20

hi.... I am doing an snmpwalk on MIB variables and dumping the output to a text file. I dont need all the info and need to read only a part of it. How can this be done efficiently in python?

Member Avatar for ptmcg
0
231
Member Avatar for Vibze

Hello, i want to pass variables in url with slashes for example if the url is [url]http://host.com/script/2008/05/05[/url] the script would get 2008, 05 and 05 as variables (year,month,day) i'm using mod_python/publisher. Thanks in advance

Member Avatar for Schol-R-LEA
0
2K
Member Avatar for udaydce

A is [[ 0. 2. 0. 0. 0. 4. 0. 2. 0. 4.] [ 0. 0. 0. 8. 4. 0. 0. 1. 8. 0.]] B is [+0.016 +1.950 +0.016 -0.028 +0.121 +4.007 -0.016 +2.008 -0.028 +4.009 ] [-0.536 -0.121 -0.536 +7.684 +3.856 +0.179 +2.230 +0.358 +7.684 +0.214 ] When I …

Member Avatar for Gribouillis
0
78
Member Avatar for udev

I want to set the last 7 columns in the given matrix. Here is the code I used [CODE] temp = mat('[6 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 2 0 0 0 4; 0 3 0 0 0 0 0 3 0 …

Member Avatar for Schol-R-LEA
0
85
Member Avatar for gishi

Hi Guys, I was hoping someone can help me with this. I have a python program that reads and writes files in utf-8(unicode). When I run it in Eclipse, the output is perfectly fine. When I try making an exe file of my program it is not working. I also …

Member Avatar for TrustyTony
0
370
Member Avatar for novice20

i have a problem... within my python script which does an snmpwalk, there should be an intelligence to create a static table which maps OIDs to corresponding text strings, query the table and in the output of snmpwalk, i need to replace the numeric string with its textual string.. for …

Member Avatar for woooee
0
120
Member Avatar for --Fire--

Hi As a part of my semester project, I am supposed to do a Python based OS. The key idea is, simplest OS that lets you boot successfully and run some simple command line scripts, like how DOS works, but in Python and runs Python. I am completely baffled as …

Member Avatar for Archenemie
0
748
Member Avatar for snow56border

I am working on an assignment in python. The goal is to make a function with two parameters, one for a string and the other for a pattern. If the pattern appears in the string, the program must return true, or false if otherwise. Also, the pattern can accept *'s …

Member Avatar for TrustyTony
0
375
Member Avatar for pythonlearning

just write this function for a recursion trace back, but it become a infinite loop and won't get into the next level of recursion. I cannot find the problem, many thanks! p_value gotten from a matrix outside, tested that and it is OK. status, i, j pass form main and …

Member Avatar for Gribouillis
0
77
Member Avatar for danholding

i am a newbie to python (well to all programming really) i am having problems with "pywinuato" i have downloaded it and installed it but when i try to import it, it states that there is no module names "pywinauto" am i missing something. also i tried deleting it and …

Member Avatar for cghtkh
0
380
Member Avatar for TrustyTony

From [url]http://stackoverflow.com/questions/228181/zen-of-python[/url] Tells you what is Zen of Python Actually this is enough to print the Truth: [CODE]import this[/CODE] Loop version from [url]http://stackoverflow.com/questions/3559124/dissecting-a-line-of-obfuscated-python[/url] [CODE]result = [] for c in this.s: ## fixed tonyjv if c in this.d: result.append(this.d[c]) else: result.append(c) print "".join(result) [/CODE]

Member Avatar for TrustyTony
0
533
Member Avatar for novice20

while trying to configure yapsnmp-0.7.8, i get the following.. checking for patch... patch checking for kstat_open in -lkstat... no checking for socket in -lsocket... no checking for HMAC in -lcrypto... no checking for init_snmp in -lsnmp... no configure: error:[B] Couldn't find libsnmp [/B] what might be the reason?

Member Avatar for novice20
0
167
Member Avatar for udev

Hi! I want to read from a set of documents and put the information into a matrix[x][y] , where x is the document and y is a boolean field denoting whether a particular word appears in the document x or not. So each row would have y fields/dimensions where i …

Member Avatar for udev
0
117
Member Avatar for novice20

hi... is there any MIB parsing tool which generates an excel file or like that can be queried?

Member Avatar for jice
0
49
Member Avatar for patrickm129

Hello, I'm trying to learn Python to get ahead in school but don't know where to start. I already have a shell and SW installed on my machine to write the code, but I can't find a good index of the codes. What would you suggest I do or learn …

Member Avatar for cghtkh
0
248

The End.