15,175 Topics

Member Avatar for
Member Avatar for Damian_xyz

Hello all, I'm trying use this script: [url]http://www.estamos.de/blog/2008/09/05/getting-things-done-gtd-migration-from-d-cubed-to-monkeygtd/[/url] I've tried it on my windows machine (with ActivePython installed) and on my Ubuntu machine. On both, I get this error message: File “d3tomgtd.py”, line 30, in import xml.dom.DOMImplementation ImportError: No module named DOMImplementation The script's creator seems to think that "xml" …

0
52
Member Avatar for adam291086

I am trying to print out a dictionary result. The dictionary is made from a database search. I have tried to print it in every possible way here is the code [CODE]#!/usr/bin/python import elementtree.ElementTree as ET import urllib import MySQLdb print "Content-type: text/html\n" info={} def find_text(element): if element.text is None: …

Member Avatar for adam291086
0
119
Member Avatar for Micko

Hello, I'm writing a simple calculator in C. The main problem is I need to parse string to evaluate for example 1+2*(3-1)/2.5. However writing such parses is a very hard task. This is a trivial thing Python using this code: [code] s = raw_input('Please enter expression:') try: x = eval(s) …

Member Avatar for hunkaboy2003
0
4K
Member Avatar for StarZ

Hello, I'm Still a python beginner. I've got this Assignment, and I think I've finished half of it. Can anyone help me out on this assignment. The codes I have done already are: [I]The assignment asks to: Make a program that prints a list of 5 items in your house …

Member Avatar for Murtan
0
136
Member Avatar for cyberjam39

Hi I've been learning python through andrew harrington's guide, but i got stuck on a problem where you enter a list (ex. ['very', 'hot' 'day'] and have the IDLE return this----> 'veryhotday'. Ive been thinking on how to do that using a for loop statement as was intstructed in the …

Member Avatar for sneekula
0
105
Member Avatar for jvignacio

hey guys havin some problems getting to add up the check boxes ticked in python from a form.. this is my html file: [CODE]<html> <body> <form action="cgi-bin/cost.py" method="POST"> <p>Enter Name: <input name="name" type="text"/></p> <p>4 x 100-watt light bulbs for $2.39:<input name="4 100 watt" type="checkbox" value="$2.39"/></p> <p>8 x 100-watt light bulbs …

0
72
Member Avatar for jloyzaga

I have a vbs script and I'd like to convert this bit to python, It runs a macro within an excel spreadsheet and outputs 4 select lists <code> Set oExcel = CreateObject("excel.application") Var = oExcel.Run ("'I:\Data\CISSS\Resources\UserIDPassword.xls'!mymacro") </code>

0
41
Member Avatar for gabec94

I am writing a program that accepts a sentence and then prints out the longest line, this is what I have so far, but I am lost on what the x variable should be equal to. Any help is appreciated, thanks. sent=raw_input('Enter sentence:') splicedsent=sent.split(" ") longestword=splicedsent[0] if x in range(splicedsent[1:])>splicedsent[0]: …

Member Avatar for gabec94
0
4K
Member Avatar for Stefano Mtangoo

I want to wait the song to finish after it finishes, I want to call another function How do I do that in wxpython

Member Avatar for Stefano Mtangoo
0
144
Member Avatar for mmeclimate

Hi, I'm new to Python and I was given an unknown (supposedly binary) to read. The problem is that I am not sure on how to real the 'actual' data. I have opened the file as: [code=python] f = open('/home/mmeclimate/test/test.dat', mode='rb') f.readline() [/code] The output from readline is: [code] 'MO00\x14\x00\x00\x00\x00\x00\x00\x00\\\x00\x00\x00\xb8\x00\x00\x00\x14\x01\x00\x00p\x01\x00\x00\xcc\x01\x00\x00(\x02\x00\x00\x86\x02\x00\x00\xe4\x02\x00\x00B\x03\x00\x00\xa0\x03\x00\x00\xfe\x03\x00\x00\\\x04\x00\x00\xba\x04\x00\x00\x18\x05\x00\x00v\x05\x00\x00\xd2\x05\x00\x00.\x06\x00\x00\x8a\x06\x00\x00\xf2\x06\x00\x00^\x07\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05 …

Member Avatar for mmeclimate
0
2K
Member Avatar for Stefano Mtangoo

Hello Developers, I have simple media player that have slider that runs in sync with the song. When I want to move a song on given position using slider it moves slowly with strange gagging sound while other media player like foo/win' media player when you move song to a …

0
61
Member Avatar for Stefano Mtangoo

I have simple player with wx.ListCtrl as playlist. I first Load List through open file dialog. I populate a dictionary with filenames (populated in Playlist) as keys with their path as values. When I press play, the onPlay method calls onSetPath method which looks up for selected file from list …

Member Avatar for Stefano Mtangoo
0
127
Member Avatar for Stefano Mtangoo

Everything seems to be well, but NOTHING GET PLAYED!!!! :oops: I have tried and tried but doesn't work. WHAT IS WRONG???? :shock: [code=python] #media control #Copyright 2008 Evstevemd #Just media Player to play the playee import wx import wx.media as media import os, sys class MediaPlayer(wx.Frame): def __init__(self, parent, id, …

Member Avatar for Stefano Mtangoo
0
169
Member Avatar for krammer

How would I empty my linux trash from python? Would I just do a simple os.remove? Or is there an easier way? I am also working on deleting all files within a directory, for multiple directories. I have found this: [CODE]#!/usr/bin/env python import os def nukedir(dir): if dir[-1] == os.sep: …

Member Avatar for krammer
0
280
Member Avatar for SteveJ.

Ok, so here's the deal. I've got a CSV file in the following format (example): Jon | Steve Frank | Joe Steve | Jon Joe | Jon I want to create a python program that reads in the CSV file and outputs a count of relationships, if that makes any …

Member Avatar for jice
0
194
Member Avatar for gabec94

I am trying to write a program that shows the longest word from an input . This is what I have so far, I am not sure what to set x equal to, or if that is even right: [CODE]sent=raw_input('Enter sentence:') splicedsent=sent.split(" ") longestword=splicedsent[0] if x in len(splicedsent[1:])>splicedsent[0]: longestword=x else: …

0
72
Member Avatar for SoulMazer

Hi, I have been learning Python and have a quick dictionary question. I am trying to make a "vocabulary test" to help myself study, and am trying to do it with a dictionary. So far I have this: [code=python]testwords = {"uno":"one","dos":"two","tres":"three","cuatro":"four",\ "cinco":"five"} def vocabtest(): for value in testwords: print "What …

Member Avatar for SoulMazer
0
276
Member Avatar for gabec94

I am a freshman in highschool and have just started learning Python. This week I have an assignment on while...for...and lists. I have tried this problem and this is what I got so far, I'm not sure if it is correct at all: start=float(raw_input("Enter the starting value:")) end=float(raw_input("Enter the ending …

Member Avatar for stephendoyle75
0
84
Member Avatar for Damagh25

I have some code for a routing algorithm in python programming language but i don't understand the code at all. I am only a beginner and i was wondering if anyone could explain it for me in plain text. Could you please go through and explain each part. Cheers. Here's …

Member Avatar for Damagh25
0
221
Member Avatar for Stefano Mtangoo

The debug process never connected back to WINGIDE: Aborting debug session I have tried repair python, no success. Also tried run IDLE same story

Member Avatar for Stefano Mtangoo
0
122
Member Avatar for adam291086

Ok i can send this soap request in PHP no problem. But i need to do something similar with python. The authentication happens in the SOAP headers. How can i construct a soap header with python, i am using the module SOAPpy. Any help is appreciated.

0
36
Member Avatar for jvignacio

hi guys im trying to make the words that have capital letters in small caps, then count the numbers of times a certain words appears in the text. i managed to count the number of times a word appears but now im having trouble converting upperletters to caps on all …

Member Avatar for jvignacio
0
223
Member Avatar for jcafaro10

I'm trying to get reflection to work in Python. I'm used to it in java but am having trouble getting it to work in python. Here is basically the code I have. [CODE] c = myObject.__class__ # get the class of the object newC = c.__new__(c) #create a new instance …

Member Avatar for jlm699
0
96
Member Avatar for happymadman

How do you assign a random int to a variable more then once say i use this code [code] import random x = 1 while x == 1: random = random.randint(1,100) print random raw_input ("Push <enter> to print another random number") [/code] It will print out the first random number …

Member Avatar for happymadman
0
229
Member Avatar for jcp200817

Hey, I have to do a script for class in which a user inputs a phone number like the ones you see on TV. 555-buy-this I need to make a script that will change the alphabetic characters to numbers. I asked my teacher and he said we had to do …

Member Avatar for jcp200817
0
447
Member Avatar for jcafaro10

Hey all, What does it mean when you get an error that says ImportError: no module named main. I wasn't aware I was trying to import a module named main. I don't even have a module named main. I'm using Jython and I'm reflecting on an instance of a python …

Member Avatar for jcafaro10
0
5K
Member Avatar for lllllIllIlllI

Hi guys, I was making a program yesterday that would send an email using the email modules of python as well as the smtp module. My problem is when i put it into an exe using py2exe and vega's code snippet setup i get some problems. This is the error …

Member Avatar for lllllIllIlllI
0
2K
Member Avatar for tomtetlaw

Hi all! Im making a mario clone, and i was wondering how to write the jump function in the Mario class, any help would be good, im using PyGame by the way. heres my code so far: [code=python] #usr/bin/env python import sys import os import pygame from pygame.locals import * …

Member Avatar for tomtetlaw
0
159
Member Avatar for tomtetlaw

Im testing out blit() and i ran into this error: [code=python] Traceback (most recent call last): File "/home/tom/Desktop/pygame/test/main.py", line 15, in <module> screen.blit('image.jpg', (10,10)) TypeError: argument 1 must be pygame.Surface, not str this is my code: import pygame pygame.init() running = 1 while running == 1: screen = pygame.display.set_mode((800, 600)) …

Member Avatar for tomtetlaw
0
2K
Member Avatar for lllllIllIlllI

Hi guys, I have a program that lets the user play a sound but i was wanting to know how i could make it so the user could vary the speed in which the sound plays so the sound can play slowly and quickly and normaly as well. Is this …

Member Avatar for lllllIllIlllI
0
3K

The End.