15,179 Topics
| |
I would like to be able to create a list of all instances of a class. [URL="http://www.daniweb.com/forums/thread131805.html"]Another post[/URL] here described how to do it by appending to a list during the __init__ routine but since I am a real Python newbie (and even more of a newbie to classes) I … | |
Let Python do the work for you and figure out the roman numerals for a given integer. I have to ask you to keep the integer values somewhat reasonably low (from 1 to 4999), since roman numerals from 5000 on use characters with an overline and most PCs don't have … | |
I am calling: c = Counter() ...exactly as in the collections example code here: [url]http://docs.python.org/py3k/library/collections.html?highlight=collections#collections.Counter[/url] but it gives me this error: NameError: name 'Counter' is not defined Anyone know why? Note that I have 3.1.2 and yes I include "import collections". Thanks | |
[I]Now, I may have bitten off a bit more than I can chew with this promised program for my pops, but I am confident, with time, I can puzzle out a solution with some help! Background Info: My father is a doctor responsible for monthly schedules, usually penciled painstakingly on … | |
Hi, I have a very simple problem yet I can't find out how to do it for the life of me. I am creating a simple CGI script with Python and part of it needs a HTML form. This is what I have so far (excludes imports, etc): [code=python]font_size = … | |
Thus far, installing and getting Python 2.6 running properly on x64 Windows 7 has managed to be a fat pain in the butt. Latest in my saga of silliness, is that the PyDoc server doesn't run properly. Initially, I was getting "pydoc is not recognized as an internal or blah … | |
I have a series of files similar to that 1A2B_A.txt, 1A2B_2C.txt, 1A2B_DF.txt, 1B23_D.txt, 1B23_B.txt, 1B23_25.txt, and many more I want to combine each three files starting with the same four code before the "_" Thanks in advance | |
I am working on the folowing code, which basically counts every letter in a given text. I want to store the numbers in letter names: A=1 B=3 and so on... I guess it stores the number underthe name 'letter', but not under the corresponding letter 'A'. It would be great … | |
Hi guys ! I am willing to ask you if you could think of a py script that loads a text file and just joins the data contained in there following this example This could be an input: ssms smsmsms sksksskkks ppppplkl ndndndnd kdkdkdkdkppp And this an ouput: ssmssmsmsms sksksskkksppppplkl … | |
Hallo everyone at DaniWeb :) A made a mail script, that i need to somehow break, to close the connection to the gmail server securely. Can someone give me a hint, what to do for that. [CODE] import smtplib import urllib2 import time def sendIP(): # fetch pub ip pub_ip … | |
How do you make Python distinguish from files and folders if they are dragged and dropped into the program's window? [CODE] import os import string newDrag = raw_input("Drag and drop the file or folder you want to add.\n") newStrip = newDrag.strip('"') #Removes the quotes Windows randomly adds for some reason … | |
What's Up? OK, So I've been scripting (Some what) my first Python project, Host.py & Guest.py: Host.py listens for sockets connections on your computer, While Guest.py connects to Host.py and sends some text. Now yesterday a light bulb appeared above my head & I instantly got a thought ''What If … | |
Hi, i was wondering if someone could help me out here. from the below code i get the following error "TclError: couldn't open "H:\SDD12\Images oses.gif": no such file or directory" but i dont understand why the r is vanishing from the filename... [CODE] root = tk.Tk() root.title('background image') # pick … | |
Hi all , I got two questions : How to convert the time of a message from "127558161.23" to 03/06/2010 12:42pm ? When I receive a message and I want to know the number of the sender so I can resend him a message it returns me his name - … | |
hi I have a problem with the following code ... [B][COLOR="Blue"]>>> j = win32pipe.popen('c:\\disk\\plink jnitin@10.94.101.178 -pw mat123 df -g','r') >>> for i in j: print i >>>[/COLOR][/B] As you can see the file object 'j' does not have anything in it... But if I type [COLOR="Purple"]'c:\disk\plink jnitin@10.94.101.178 -pw ibm123 df … | |
i want to use input validation so that the user can only input decimal numbers. can someone help [CODE] while int_x != : #this is where im having the problem print "the number entered must be a decimal number" int_x = input("Enter a decimal number:") [/CODE] | |
Hello! I am trying to display a FITS image, if your not familiar with the extension its fine (gtk.Image.new_from_file() isn't either). I can get my image data to a numpy array (2D (256x256 to be exact)) I am having the most difficult time getting this into a grayscale image. I've … | |
Hey all, I've been experimenting with a basic chat server/client from my Python textbook, in efforts to keep the code clean and simple I think some optional code was omitted and it's made the books example a little buggy. I've been having troubles with the line: [CODE]transmission = self.request.recv(1024)[/CODE] This … | |
Here is solution number one for one word anagrams, I gave in discussion thread, response time in my humble Athlon PC under 70 ms. List of words is from original posting of the discussion thread. [url]http://www.daniweb.com/forums/post1206616.html#post1206616[/url] This version does not give we'd for input dew. Next time I give final … | |
Hi, I have been using a Python script to launch various applications but have run into a problem when trying to build some resiliency into it. A second script i created waits and checks for a certain window title to take focus and then clicks on the OK button if … | |
Can i put a flash aplication in on my program on python? | |
[CODE]def save_transaction(price, credit_card, description): file = open("transactions.txt", "a") # the "a" means you are always going to append to this file file.write("%s%07d%s\n" % (credit_card, price, description)) file.close() items = ["DONUT", "LATTE", "FILTER", "MUFFIN"] prices = [1.50, 2.0, 1.80, 1.20] running = True while running: option = 1 for choice in … | |
What's Up? OK, So my first Python script is still underway, Once a computer connects to the first script, we can then start sending text between them using a nice simple easygui. However after sending your specifed text once, It won't come back and ask you again. [code]#!/usr/bin/python import socket … | |
Hi I'm using python 3.1 and Windows. My program writes xml code to a text file, the problem is that windows needs to know that this file's encoding is utf-8. Right now it does write the proper code, but other programs (firefox, for instance) fail to read it because it … | |
Hello, I am making a file comparing program, and I want it to display line numbers permanently, like any normal text editor does. Is it possible to do this with tkinter? thanks | |
Answered my own question. Wish I could figure out how to delete this post. | |
Hi, I'm at present working on extracting data from various online news sites, and then analyzing it. The code is given below. But when I'm writing this last code, the following error is coming: >>> import newsfeatures >>> allw,artw,artt= newsfeatures.getarticlewords( ) >>> wordmatrix,wordvec= newsfeatures.makematrix(allw,artw) Error: Traceback (most recent call last): … | |
I tried renaming my .py file to .pyw. But compiling with py2exe does not make a difference. I tried using root.withdraw() but all it does is freeze the application, prevent the initial canvas from popping up, and fail to remove the command prompt window anyways. Does anyone have a solution? … | |
I'm a fairly advance Python programmer. I'm am making a text based RPG which is easy for my skill but I've been wanting to learn XML for my C# project especially. My RPG is HEAVILY inspired by fallout 3. I love the dialogue options and I want to write an … | |
I have a twill script that I am trying to use to get the html code from a web page and output to a text file. The problem I have is that all the code does not show up in my text file. The actual parts I need are left … |
The End.