15,406 Topics
![]() | |
I'm new to Javascript and found some code on the internet that's supposed to create some nested select boxes. Here is the code: [code=html]<html> <head>Some testing</head> <script type="text/javascript" //src="http://trac.mochikit.com/browser/mochikit/trunk/packed/MochiKit/MochiKit.js?rev=1256&format=raw"></script> <script type="text/javascript"> /* <![CDATA[ */ // An array of the currently visible selects var level_selects = new Array(); connect(window, 'onload', function … | |
I'm having a problem comparing floats, given the values below, I'm getting the wrong results when running this piece of code let distAppart = 4.76837158203e-007 let factor = 0.01 [CODE] if distAppart < factor and distAppart > -factor: print 'this should not print with the given values.... But it does … | |
[code=python] class A: id = "" fld = [] def __init__(self, id): self.id = id def method(inp): a = A("a") b = A("b") c = A("c") a.fld.append("Histogram") a.fld.append("Dendogram") b.fld.append("Milligram") b.fld.append("Pictogram") c.fld.append("Pro--gram") c.fld.append("Dodge-ram") print a.fld print b.fld print c.fld inp.append(a) inp.append(c) inp.append(b) #__main__ inp = [] method(inp) for ins in inp: … | |
Hi! First, thanks for taking the time to look at my problem, I really appreciate it. Right now I'm trying to setup a columns of 'cells' made up of labels separated by horizontal panes within a scrolledframe. When i initially run my code everything fills in fine. However, when I … | |
Hi everybody! Don't know if it's possible to do with python... Anyway, I need to get some information from a QuickTime movie file (for now I need movie's duration in seconds, in fact). Topics in different forums point me to the QuickTime format specification PDF, I've already downloded it and … | |
I'm trying to extract information (people's names and other info.) from a public database into a spreadsheet. Unfortunately, info about the people in the dataset (like their name and occupation) is not visible in the source code. Instead, there is this application by Caspio done, from what I can tell, … | |
Hi I have made a program with wxPython and i have this bit of code: [code=python] def getpic(self,event,urlp='http://mirror.bom.gov.au/radar/IDR043.gif?20080427173538'): fc = url.urlretrieve(urlp,filename='Weather.jpg') image_file = 'Weather.jpg' self.bmp = wx.Bitmap(image_file) self.img = wx.StaticBitmap(self.background, wx.ID_ANY, self.bmp, pos = (20, 60)) self.background.SetInitialSize() [/code] This is a bit of my code, not the full thing but … | |
I have a list of document pages with indicators where each document begins "ND": [CODE] Page1,ND Page2, Page3, Page4,ND Page5, [/CODE] I am trying to format it so that I have a two column csv with the first and last page: [CODE] Page1, Page3 Page4, Page5 etc [/CODE] I cannot … | |
Could anyone please tell me a good place to start in making a generic and customizable media player in python. perhaps a tutorial on how to. I can't find much except for already completed media players by other people. I think it would be ideal for my college project, however … | |
I have been trying to run a code .But i have been getting this error [CODE] Traceback (most recent call last): File "notebook.py", line 126, in <module> Testbook() File "notebook.py", line 90, in __init__ bufferf = "%s %d credits %s Difficulty" % (question.question_id, question.credits, question.difficulty) AttributeError: 'ShortAnswerQuestion' object has no … | |
Hi I am new to Python, I would like to inquire why the script below can't use fileHandle.readline() I am trying to store the data in an input file into a structure, but I am not sure why line = file.readline() fails ? The structure contains mode. Each mode contains … | |
Hi All, I am in the process of learning python. I have a gui that gives the user the option of selecting between two applications to run. Currently each button calls one of these two modules (another python script), using the import command. Since it takes a few minutes for … | |
Hi everyone, I need to append checkboxes in a tree control structure using Python. While searching for the same, I came aross a module called “Snack” which can be used for getting a tree with check boxes in python(called as CheckboxTree). But I am not getting the Snack Library anywhere. … | |
JAX ([url]http://www.jax-conf.com/[/url]) is the the most comprehensive conference on web and enterprise development. It provides an ideal forum for software developers, project managers and architects to learn about the latest Technology, Architecture and Agile Methodologies. It is this very special blend of topics which has made JAX the conference of … | |
Hi all, [code] class: FileCheck(object): def checkFiles(install_vers=None, uninstall_vers=None): if uninstall_vers != None or install_vers != None: if uninstall_vers != None: for ver in uninstall_vers: print "checking %s" % ver if install_vers != None: for ver in install_vers: pass print "done" if __name__ == "__main__": check = FileCheck() check.checkFiles(uninstall_vers=["1.0","1.3"]) [/code] I'm … | |
Hi All, I am using a python system command to execute a C++ executable file which takes certain binary input. For example: C++ exe name is "Test" "Test" takes the following input . '\x02\xfa\xcbQH\x00' command = '/opt/etc/Test %s' % ('\x02\xfa\xcbQH\x00') system command I am using is : os.popen(command) When this … | |
Hi everybody! I have a small prob here... I'm trying to assign a directory (folder) path to a variable while evaluating python script. Well, to be more clearer, I need to do run something like: getDirPath.py '[I]mypath[/I]' and after that I need to get this path as variable inside my … | |
Hello, I've been swimming with Python for a while, but there are remote field of it which I don't find easy. For example I have made an API from some XML files, and there will be many versions of it. The API is actually several modules either with functions or … | |
Hi: I want to reach through a batch file that has many lines of which I want to do further processing only if there is a line starting with "call ..." Also the line should not contain call %_anyvar% How do I search for a pattern where it matches call … | |
import win32com.client wordapp = win32com.client.Dispatch("Word.Application") # Create new Word Object wordapp.Visible = 0 # Word Application should`t be visible worddoc = wordapp.Documents.Add() # Create new Document Object worddoc.PageSetup.Orientation = 1 # Make some Setup to the Document: worddoc.PageSetup.LeftMargin = 20 worddoc.PageSetup.TopMargin = 20 worddoc.PageSetup.BottomMargin = 20 worddoc.PageSetup.RightMargin = 20 worddoc.Content.Font.Size … | |
I am running a very simple python application and I noted that the memory allocation is something like 4,5M. This is a problem in my case, because I have to run 2 thousand process at the same time. The memory I need is 100k or less. Is there any way … | |
Hi, I have seen in python`s help (the .chm file) that in the opengl section it has a code like this: import gl, GL, time def main(): gl.foreground() gl.prefposition(500, 900, 500, 900) w = gl.winopen('CrissCross') gl.ortho2(0.0, 400.0, 0.0, 400.0) gl.color(GL.WHITE) gl.clear() gl.color(GL.RED) gl.bgnline() gl.v2f(0.0, 0.0) gl.v2f(400.0, 400.0) gl.endline() gl.bgnline() gl.v2f(400.0, … | |
hi, I don't use python very often, and I don't have a lot of experience with network programming either. A friend of mine came up with a problem, and I was wondering if anyone could help out: "I need to connect to another computer with a UDP socket and TCP/IP … | |
Hi. I am opening jpg file with [code] a = Image.open(sys.argv[1]).convert("P")[/code] then I'm getting it on a list with [code] c = list(a.getdata()) [/code] could someone help me to conver this list to array?? I would be glad :) | |
Ok, I am fairly new in using Python, but have a pretty good understanding of it. But I'm up against something that I just can't figure out. I have an archived file that I am trying to take apart into individual files. It isn't a zip file, but an ascii … | |
Hello, I'm trying to make a web bot that fills out a login form from this at&t site [url]http://www.viewmymessage.com/en/legacy/login.jsp[/url] I cannot seem to get it to work though here is my code: import urllib import urllib2 url = 'http://www.viewmymessage.com/en/legacy/login.jsp' user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'messageId' … | |
Hi all, I provide the following command in my run window (Start->Run) python setup.py sdist setup.py contains a module named Modular, from distutils.core import setup setup(name='Modular', version='1.0', py_modules=['Modular'], ) But there is no Modular.zip file being created [as said in the documentation]. There is no output whatsoever...Why is this so??? | |
Hello, I am fairly new to Python and starting to get it. But I am having some difficulty with pickle. I am trying to get a account program to pickle user input and to save that in a data file and then reload said info and read as input for … | |
Hello, I am trying to export a SELECT statement to a csv file. I have got it work like so: [CODE] for row in context.sqlTestExport(): print "%s,%s,%s,%s,%s" % (row.ID, row.test1, row.test2, row.test3 , row.test4) RESPONSE.setHeader("Content-type","application/vnd.ms-excel") RESPONSE.setHeader("Content-disposition","attachment;filename=SelectTest.csv") return printed[/CODE] it does return the csv file that I want. The problem is … | |
Hi, I was wondering how to get around a problem I was having with eval(). I have a list of strings and each one is the name of a python file found in the same directory as the current script. I was it to import these modules to use in … | |
hi, guide me,how to make a another way to write again [CODE] a=1 c=0 d=0 b=1 num1=1 e=1 while b <1000: b=a*3 a=a+1 c=b+c while num1<994: num1=e*5 e=e+1 d=num1+d print "Here is the sum of multipile by 3 and 5 is %d"%(c+d) [/CODE] | |
How can I read data present in a large XML file using SAX parser?. I want to transfer the data from XML into tables created in MS Access. Please help. Regards, Dinil | |
why does this code Hangs??!!! I am on Windows [CODE] from subprocess import * proc = Popen("cmd",stdin=PIPE,stdout=PIPE) pin = proc.stdout pin.read() [/CODE] <HANGS JUST RIGHT HERE> | |
Hi i have been fiddling around with the wxPython GUI toolkit for a bit and i wanted one of my programs to start with the window expanded. I googled it but couldn't find an answer there so any help here would be greatly appreciated. | |
I'm currently trying to make an address book that can store data in a .txt file. [CODE] print "Virtual Address Book" print "Austin Jackson; Project 4 : Jun 14, 2008" print " " print "1. Add New Contact Information" print "2. View Adress Book" choice = input(">") if choice == … | |
this was the question on my exam the other day Which strings does regular expression r"^([^aeiou]\w)+\1$" recognize? (3 answers) "o_o-o_" "baraba" "ananas" "anasan" "-O->-O" "izgriz" im not into re at all :D, I tried to compile that expression and check for every string.. funny thing was that none was recognized.. … | |
I'm trying to use the BlueSoleil SDK with Python. To do this i use ctypes to call the BlueSoleil DLL. Here is the code: [code=python] import ctypes print ctypes.cdll.BsSDK.Btsdk_Init() print ctypes.cdll.BsSDK.Btsdk_StartBluetooth() print ctypes.cdll.BsSDK.Btsdk_StartDeviceDiscovery(0,0,0) ## print ctypes.cdll.BsSDK.Btsdk_GetInquiredDevices(None,None) [/code] The last call should return the number of active BT devices around, which … | |
Hello. I am a relatively new python programmer, but I know my way around the language. I have decided to do some work with PyOpenGL -- I just finished a game that had to be in XNA, now I have a bit more free reign and I prefer to do … | |
Hi. I'm having a little difficulty understanding character sets in Python. Basically I'm trying to write a function that will substitute a non-ASCII character with a similar ASCII equivalent. So if given a string like 'ÂBÇD', the function would iterate through the string object, replacing select characters to return a … | |
Hello, I am trying to split a word into an array For example, "airplane" becomes ['a','i','r','p','l','a','n','e'] Any suggestions? | |
I have started to use the PyScripter IDE and really like the many features it has. However, everytime I make an error in the code, and as a beginner I make a lot of errors, it rather ungraciously exits. There must be something wrong in my settings? | |
I am trying to compare a list of words to a dictionary to see if there are any matches. How do I do this, as diction.has_key() does not work for lists? | |
can anybody help me build a function to replace certain language specific characters in a file? for example, i want to replace Ș with Ş, so it will be published correctly in a web page. | |
Heloo, i have just encountered a problem in comiling a module of a program made by python and um not experienced in it, where should i run the module, in the command prompt of windows or in the shell, i dunno wheather i post this thread in the right place, … | |
First thanks for taking the time to review my issue. I've been banging my head against a wall the last 24 hours. What I want to do is have a list of labels bound to a list of particular events. I want to be able B1-Motion from one label to … | |
Hello, I have a problem with calling a staticmethod from another staticmethod when I try use dictionary {} to handle. My code is very basic, but in the future I will add many other static method: [CODE] # -*- coding: utf-8 -*- import sys class DateFormat(): """Class to format and … | |
Hi everyone, I'm new in this forum. By the way it's not longtime since I started learning python. After a couple o months of studying and tutorialing I'm now nearly finished with my first application. I've used Tkinter as GUI and there's one thing that's making me nervous: I want … | |
hello, everybody in dani, im system Administrator with MCSA certification, presently im working in millennium development goal in Nigeria. i have passion of python programming and i really enjoy forums for wxpython , wxglade and django :) | |
hi, am carol. I just started working on python and really want to know a lot more about it. Thanks for having me here! sayonara | |
Hi All, Beginner programmer here with an easy question I hope. I want to be able to compare the value of the first item in a list to the second item in the list to see if they are sequential. so in this list: numblist = [1 , 2 , … |
The End.