15,179 Topics

Member Avatar for
Member Avatar for andrewtrench

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 …

Member Avatar for andrewtrench
0
9K
Member Avatar for vegaseat

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 …

Member Avatar for eljakim
0
3K
Member Avatar for blah32

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

Member Avatar for vegaseat
1
126
Member Avatar for Purnima12

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

Member Avatar for Purnima12
0
2K
Member Avatar for SoulMazer

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

Member Avatar for SoulMazer
0
192
Member Avatar for jinfiesto

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 …

Member Avatar for jinfiesto
0
188
Member Avatar for kelokely

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

Member Avatar for TrustyTony
0
92
Member Avatar for aint

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 …

Member Avatar for TrustyTony
0
106
Member Avatar for elvis1

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 …

Member Avatar for elvis1
0
304
Member Avatar for hust921

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 …

Member Avatar for hust921
1
96
Member Avatar for WildBamaBoy

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 …

Member Avatar for WildBamaBoy
0
137
Member Avatar for Syphilis

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 …

Member Avatar for Tech B
0
95
Member Avatar for ChargrO

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 …

Member Avatar for TrustyTony
0
328
Member Avatar for MrAlshahawy

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

Member Avatar for MrAlshahawy
0
201
Member Avatar for xav.vijay

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 …

Member Avatar for luizfeliperj
0
916
Member Avatar for j23

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]

Member Avatar for ultimatebuster
0
2K
Member Avatar for tehbrozor

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 …

Member Avatar for tehbrozor
0
242
Member Avatar for Valchris

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 …

Member Avatar for Gribouillis
0
93
Member Avatar for TrustyTony

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 …

Member Avatar for TrustyTony
0
1K
Member Avatar for Mattokun99

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 …

Member Avatar for jcao219
0
192
Member Avatar for Joslup
Member Avatar for lewashby

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

Member Avatar for lewashby
0
107
Member Avatar for Syphilis

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 …

Member Avatar for TrustyTony
0
91
Member Avatar for G_S

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 …

Member Avatar for Gribouillis
0
184
Member Avatar for G_S

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

Member Avatar for G_S
0
2K
Member Avatar for niehaoma
Member Avatar for niehaoma
0
103
Member Avatar for Sagar14

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): …

Member Avatar for Sagar14
0
145
Member Avatar for theguy126

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

Member Avatar for vegaseat
0
1K
Member Avatar for nsutton

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 …

0
120
Member Avatar for lstensland

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 …

Member Avatar for TrustyTony
0
349

The End.