15,185 Topics
| |
Hi, This is the existing code: [CODE]for c in chartNames: chartUrl = baseChartUrl+c hd = extractChart(chartUrl) writeChart(hd,c) for key in hd: if key in chart: chart[key].append(c) else: chart[key] = [c] [/CODE] when i wanted to insert a line before [CODE]chartUrl = baseChartUrl+c[/CODE] by putting the cursor to the end of … | |
Hi everyone it's been almost a year since I gave up programing in python so I have forgotten a lot of things, so just bare with me. Ok so I was playing around with python and ended up with this little program. [code=python] def test(): number = input("Number: ") scale … | |
I am having a text file contaning the following: "int Function1 (int arg1, "0|1", char * arg2); int Function2 (int arg1, " ", char * prt1); ..." I need to open this file, split the each word and store it as global variable. I did this in Perl but now … | |
Hi, i wrote the socket script in python, Here both server and client running in under same machine. operating system is ubuntu 8.10 desktop version. [B]tcp server[/B] [CODE] 1 #!/usr/bin/env python 2 3 import socket 4 import sys 5 6 server_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) 7 server_socket.bind(("", 5000)) 8 server_socket.listen(5) 9 while … | |
Hello, I am new to Python. I am trying to start writing some simple programs in it. Which IDE would you suggest? I am currently using NeatBeans for my Java programs but i don't think i can use it for Python P.S. I am using Mac OS X 10.5.7 Thank … | |
I'm working on learning on programming with Pygame by following a tutorial linked from the Pygame site. I seem to have stuck myself in a hole, however, because I can't seem to set keys to do different things within the program. I'm trying to first close the program by pressing … | |
If I do something like this: [code] print "%08d" % 2 [/code] It will print '00000002'. However, I want to change the "8" to a "3" at runtime (to get '002' instead). I tried this: [code] MyLength = 3 print "%0" + str(MyLength) + "d" % 2 [/code] but I … | |
Hello, I am trying to write a GUI front (with tcl/tk) for a python module. Unfortunately the module takes parameters and I don't know how to call a python module with parameters without going into interactive mode (I'm running Debian) I can get tcl to run a test module with … | |
Hey guys, Lets say I had two different files, each with a column of data. So: [CODE](File 1) 1 2 3[/CODE] And [CODE](File 2) Friend Foe Fighter[/CODE] In the end, I want to unify these into one large file: [CODE] 1 Friend 2 Foe 3 Fighter[/CODE] Each file has an … | |
Hi All, In my python script i use to run some oracle queries for this i require a library to connect to oracle which is [B]cx_Oracle[/B]. When we were using 9i(oracle).. my script was running fine.. and now when we migrated to 10 G its giving problem... Few lines of … | |
Hi, I posted some Python code on my blog at blogspot [URL]http://pyarticles.blogspot.com/[/URL] . However, it not display my code correctly. How can I do to solve this problem ? Thanks :) Eiwot | |
Hi, I am new to socket programming, I have a generated data for every minute in client side and i want to send this data to server for every minute using python script. Client laptop having Airtel GPRS connection(in moving vehicle) and server desktop at my home. Both client and … | |
Hi All, I am using the following code to write data into an excel sheet: [CODE]# Open the Output Spreadsheet objExcel = win32com.client.Dispatch("Excel.Application") # Creating object to write to Spreadsheet self.xlApp =Dispatch("Excel.Application") # Creating Workbook self.Wkbk = self.xlApp.Workbooks.Add() # Get sheet count intShtCnt=self.Wkbk.Worksheets.Count # Creating worksheets wsObjReport = self.Wkbk.Worksheets.Add() # … | |
Hi friends, I have developed a program with reportlabs module to generate a PDF file on macos x. The pdf file is generated successfully But, i cant open the pdf file automatically i mean manually i click on that file then it will be opened. Also i used this syntax … | |
I need help please. this cgi program works fine only if the user puts in more than 66 chars..i chopped the lines into 66 chars each so they would fit in the textarea the problem is that record comments() works perfectly for writing multiple lines and the \n char in … | |
This will hopefully be my last noobish question post. Please could somebody explain or link to explanation: 1.yeild 2.return thanx in advance | |
| Hi a while back you guys helped me make a good spell checker, now i want to advance it so that if the difference between 2 words is small it will change them, I think i need to use diiflib for it but i don't know how to do itmy … |
Hey guys, Has anyone here ever used python to produce data files which can be immediately read by excel? I thought at first if I just tab-delimited my data, I could copy and paste an entire data file into excel. This is not the case. When I take a tab … | |
Hi, i am making downloader, and I want to use diferent progressbar for every link (like ff downloader)... I made treemodel [CODE]treemodel = gtk.TreeStore(gtk.gdk.Pixbuf, str, gtk.ProgressBar)[/CODE] and i put in components with this [CODE] def insert_row(self, model, parent, type_image, file, pbar): myiter = model.insert_before(parent,None) model.set_value(myiter,0,type_image) model.set_value(myiter,1,file) model.set_value(myiter,2,pbar) return myiter[/CODE] my … | |
How do you copy and paste the text from every page of a book from Google books View plain text option: For example: [url]http://books.google.com/books?id=r70CAAAAQAAJ&printsec=frontcover&dq=true+devotion+blessed+virgin&lr=&as_brr=1&ei=cwB1SZOcI5j4MO6c-bkM[/url] instead of doing it by hand. Also how do you open a series of table of contents like this: [url]http://www.catholictradition.org/Classics/humility-text.htm[/url] and then 1. copy paste on … | |
My goal is to write a function that takes a number and returns the number of solutions for that number, a form along the lines of f(a) = x_0 + x_1 +...+ x_n = a. where n can be any number such that n < a. Another restriction that I'm … | |
import csv file = open('signin.csv',"rb") reader = csv.reader(file) rownum = 0 for row in reader: if rownum == 0: header = row else: colnum = 0 for col in row: print '%-8s: %s' %s(header[colnum],col) colnum += 1 rownum += 1 file.close() Hi could any one help me out, i am … | |
I'm making a module to simulate a neural network, speed is an issue so I've written it in c, basically you build the network in python, and then run call a simulate method that is pure c. One thing I want to add is the ability to inject current into … | |
I'm a little stuck on this particular piece of code that I'm working on. I'm supposed to check the contents of 1 text file (original), and compare it with another text file (filter) to see if there's any words that matches up. What I have now is a so-called working … | |
[code=python] def prints(value, ..., seps='', ends='\n', files=sys.stdout): print(value, sep=seps, end=ends, file=files) print = prints [/code] Would this permently overwrite print or just overwrite it while my program is running? | |
Hi, I am pretty new to python and I have a really noobish question: What does %s mean | |
I'm trying to learn wxPython. Unfortunately when I came to China in Jan I had to leave the nice wxPython book in Canada because it was too heavy for my suitcase. So I humbly ask you to bear with my ignorance. As practice (and because I have a practical use … | |
How would I round a number to the nearest multiple of 10? | |
I have the following files: [CODE] # add.py #!/usr/bin/env python import os import Cookie import hashlib import MySQLdb import cgi import cgitb; cgitb.enable() def showform(): reshtml = '''Content-Type: text/html\n <html> <body> <form action='add.py' method='post'> Name: <input type=text name=name size = 15><br> URL : <input type=text name=url size=30><br> <input type=submit value="Add"></form> … | |
| Hi I was asking around for ideas for programs and I was challenged to make a browser, but I have no idea how to do this, do any exist currently? and how could I do it please? |
The End.