14,946 Topics

Member Avatar for
Member Avatar for Stefano Mtangoo

Hi guys, I have been away Python for long now. I need to brush with small project that will be downloading images from give url. I give url and it crawls through all pages in give location and its subfolders and download image. Now two challenges: 1. Crawl through all …

Member Avatar for Tech B
0
191
Member Avatar for macca21

Here's a question from my assignment, I need HELP! i'm after a basic structure of code that I can work from. pls try explain steps in code. THANX Create an application that utilizes your Order class to implement a simple Order tracking system. To do this your system must be …

Member Avatar for woooee
0
92
Member Avatar for G-nom

Hello In my program i have a matrix the code for which is [CODE] test = [ ["x" for x in range(5)] for y in range (5) ] for y in test: print " ".join(map(str,y))[/CODE] which prints something like: x x x x x x x x x x x …

Member Avatar for woooee
0
109
Member Avatar for Steven.T

Write a spell checking tool that will identify all misspelled word in a text file using a provided dictionary. The program will accept either one or two command line parameters. 1. The first command line parameter is the name of the text file that will be checked. 2. The optional …

Member Avatar for TrustyTony
0
1K
Member Avatar for jib
Member Avatar for macca21

OK, how do I make this program allow the user to modify the price of items and save and load the modified catalog? i've spent ages trying and failing. pls help! [CODE]'''maintain a catalog''' def main(): global catalog loadCatalog() while True: pick = showMenu() if pick == 0: break elif …

Member Avatar for Lizzard013
0
89
Member Avatar for miklamer

Hello everyone! I have a problem so i want to ask how to do that. I'm goint to write program for form fill. step by step: 1- login 2- fill form 'hostname' (then submit) 3- fill form ip/log/pass/description (then submit) 4- read web. if there is a problem refresh site …

0
42
Member Avatar for oaktrees

I have the following code, [code] import csv w=csv.writer(file('newfile.csv','wb'),dialect='excel') some_values=[[1,2,3],['A','B','C'],[4,'"5"','ab,c']] w.writerows(some_values) [/code] When I run it on my computer (a mac), newfile.csv is created. However, when I open newfile.csv, it is empty. Any ideas why?

Member Avatar for oaktrees
0
2K
Member Avatar for mysticstylez

Hi, So, i have a list that contains some words. I need to read a text file and cross reference it with each word in the list. if that word occurs in the text file, i need to filter it out with "*". How would i go about doing that. …

Member Avatar for griswolf
0
3K
Member Avatar for jib

[B][COLOR="Green"][B]I have done the blackjack program but every time i run it shows an error here is the code: P.S. I also need to show the value of the card[names of the cards e.g Jack etc[/B][/COLOR][/B] [CODE]import random as r def define_cards(c): rank_suit=["ace","two","three","four","five","six","seven","eight","nine","ten","jack","queen","king"] suit_rank=["clubs","spades","heatrts","diamonds"] for suit in range(4): for rank …

Member Avatar for jib
1
105
Member Avatar for rickymak

def info(object, spacing=10, collapse=1): """print methods and doc strings. Take module, class, list, dictionary, or string.""" methodList = [method for method in dir(object) if callable(getattr(object, method))] processFunc = collapse and (lambda s: " ".join(s.split())) or (lambda s: s) print [B][U]"\n".join(["%s %s" %[/U][/B] (method.1just(spacing), processFunc(str(getattr(object, method).__doc__))) for method in methodList]) if …

Member Avatar for d5e5
0
719
Member Avatar for jib

[B]############################### [COLOR="Green"]# PROLOG SECTION # hangman.py # Program to play the traditional game of hangman. # The computer picks a word and the player # has to guess it before he has made 7 wrong # guesses of letters in the word. # Each time the user makes an incorrect …

Member Avatar for jib
0
834
Member Avatar for cableguy31

I'm trying to write a script that will take as input a network and subnet mask and then ping each host. I can get it to work fine for any class C address that only increments that last octet. However, I'm kind of stuck on how can I work through …

Member Avatar for TrustyTony
0
101
Member Avatar for ChargrO

Hello, i was just wondering how i could make these buttons appear on the screen in the same position, but so the code is simpler and easy to use. [CODE] ## Screen design draft for major project ## Filename: majorProjectDesignDraft20090222.pyw ## import os from Tkinter import * import tkFileDialog class …

Member Avatar for sandorlev
0
241
Member Avatar for xcristi

Hello, I have an application with a db update dialog: a static text and two buttons. One of the button is bind with the [B]do_update[/B] method which uses multiprocessing module to run a long task in the background. To communicate from there, I use Publisher() class. A receiver for that …

Member Avatar for xcristi
1
1K
Member Avatar for haydensewell

from this starting point: matrix = [[0 for x in range(5)] for y in range(3)] I need to make this: |0 0 0 0 0| |0 0 0 0 0| |0 0 0 0 0| +-+-+-+-+-+ 0 1 2 3 4 I have been trying .append and .replace to try …

Member Avatar for vegaseat
0
2K
Member Avatar for marco64

Hello, I would like to know if you know any framework/classes for systems administration in windows/linux environment. Thanks for you replies! Bye, Marco.

0
142
Member Avatar for stabzagg

Hey there, I have written some code to draw a grid on a canvas but the code is far to long.. so I was wondering what the most efficient way to write my code would be. [CODE] self._canvas = Canvas(self, width = 450, height = 450, bg ='white', highlightthickness = …

Member Avatar for morgadao
0
5K
Member Avatar for niehaoma

Newbie. Sorry for lame question. I want to use each bit in an int (binary number) as a boolean. In essence (this is c"ish" pseudocode): [CODE] bitVal = 0x01F; // 32-bit value for(i=0; i <LIST_SIZE; i++){ if(bitVal[i] == 1) printf(List[i]) }[/CODE] So, for Python, I just need to know how …

Member Avatar for TrustyTony
0
122
Member Avatar for TrustyTony

This code was in discussion of getting numeric input to Python. This function returns the zero-stripped, normalized string form the input string if it is correct, False truth value otherwise (it can not be mixed with number 0 as accepted '0' are returned as string '0'). If string passes the …

Member Avatar for TrustyTony
0
1K
Member Avatar for Patagonikus

I need to put a digital (or analogic) clock in a pygtk window with a exit button. I was looking a example with Tkinter but I do not know how to integrate in a pygtk window [ICODE] from Tkinter import * import time root = Tk() time1 = '' clock …

Member Avatar for Patagonikus
0
523
Member Avatar for Etinnet

Hey all, I have a conceptual question. I have a 2-dimensional grid with on/off (0/1) values for every cell it. What I would like to do is to calculate the distance covered over cells with a value 0 and the distance covered over cells with a value of 1 when …

Member Avatar for TrustyTony
0
254
Member Avatar for vlady

Hello, I am learning dictionaries and I need help. Here is a script and the task is to modify print_hist to print the keys and their values in alphabetical order. I imagine that the result should be like this: d 2 o 1 r 1 v 1 thing is I …

Member Avatar for woooee
0
137
Member Avatar for pew2

I am working on a project for my programming class in which I need to use a Tracker class. The guidelines given to us are as follows: class Tracker: def __init__(self,window,objToTrack): # window is a graphWin and objToTrack is an object whose # position is to be shown in the …

Member Avatar for sergb
0
132
Member Avatar for jib

• shooter_clicked(x,y): This function is called when the shooter turtle is clicked on the screen. If the bullet not already moving, this function sets a global flag to cause the bullet to start moving upward. • Set the window dimensions and title. Call setup() to draw the window. • Set …

1
5K
Member Avatar for Robbert

Hi, I need some help on how I could add the following pie chart to a wxPanel. I just can't seem to get it to work without the pylab interface. [CODE]import wx from pylab import * class MyFrame(wx.Frame): """ Pie Chart Frame """ def __init__(self): wx.Frame.__init__(self,None,-1) self.panel=wx.Panel(self,-1) """ Start Pie …

Member Avatar for Robbert
0
192
Member Avatar for bunkus

Hi, I am trying to install Ming for Python 2.6 I have downloaded the windows setup from [url]http://sourceforge.net/projects/ming/files/Releases/Ming%200.4.3/ming-0.4.3.zip/download[/url] but I am running into problems since if I try to run the setup.py inside the directory py_ext like setup2.py build --compiler=mingw32 I get the following error message: running build running build_py …

Member Avatar for bunkus
0
211
Member Avatar for dbphydb

Hi, I am a tester and new to python. The code in bold should execute only if the webpage has the text 'BUILD COMPLETE'. This text is between the <th> tag and this is found using DataParser class. [CODE] URL = "http://11.12.13.27:8080/cruisecontrol" from urllib2 import urlopen from HTMLParser import HTMLParser …

Member Avatar for dbphydb
0
660
Member Avatar for dbphydb

Hi, After much research and help from forums, i have the following. Using HTMLParser to parse thru html pages and then finally reaching a webpage where i have to check all the checkboxes and then click the 'Deploy' button. Used ClientForm to do this. But i am getting some HTTP …

Member Avatar for dbphydb
0
167
Member Avatar for Kruptein

Well like the title says, everything was alined fine, untill I added the Shell, it's the shell I want to resize, but if I pass wx.Size(100,100) of self.console.SetSize((100,100)), it doesn't work :f What am I doing wrong? [code=python]class DEDITOR(wx.Frame): def __init__(self, *args, **kwds): # begin wxGlade: DEDITOR.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE …

0
68

The End.