15,181 Topics
| |
Hi all, I have got several python scripts and I need to run them in one shot. So I assume that in a .py file I can give statements ./file1.py ./file2.py ./file3.py etc to run multiple scripts. I am defining global variables in a config.py file and these will be … | |
Hi all, I have got several python scripts and I need to run them in one shot. So I assume that in a .py file I can give statements ./file1.py ./file2.py ./file3.py etc to run multiple scripts. I am defining global variables in a config.py file and these will be … | |
So, I am learning Python. To help my understanding, I was wondering how someone might make this code more efficient. Purpose: Take a 32-bit value (tempCode) and output each nibble. My way was to use a string, basically shifting out the binary value from bit 0 to bit 31 into … | |
There is a table that I need to access using pyodbc that contains numeric descriptions for some of the columns and I cant seem to figure out how to get to them by name. for example, this works great for pulling the column called 'Category' [code=python] cursor.execute("exec blablabla") for row … | |
Hello I made a program that submits a paragraph to a webpage, using mechanize. Its all working great, except when I view the paragraph, all the newlines have disappeared and it makes all the paragraphs all block up together into one long sentence. But when I open up the page … | |
| |
heya guys - new to posting here, but i have browsed the forums for help over this year so far. obvisoulsy im also new to python, only trying it since march. Im trying to write some code for a 'knock knock' program. It uses a txt file for the jokes, … | |
Not really sure what a command line argument is, but here is an example question that I don't understand: "Write a program that gets 4 integers as command-line arguments, prints the values and their total." Can somebody show me how to do this? I have like 10 of these to … | |
I was able to finish some: [CODE]def sieve( n, primes): numbers =[] # make a list of integers from 0 to n, inclusive for i in range(2, n+1): numbers.append( i ) # by definition, the first prime is 2 del(numbers[ _____________ ]) del(numbers[ _____________ ]) # while there are still … | |
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 … | |
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 … | |
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 … | |
Does anyone know about any companies, however big or small use python in any part of their game programing? I'v looked around the web to try and find some but i cant seem to find any, any help would be apreciated. | |
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 … | |
| |
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 … | |
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 … | |
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? | |
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. … | |
[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 … | |
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 … | |
[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 … | |
Hello! I'm planning to make an online program, actually it would only be a login system with GUI and a chat window after login. The client program would recieve some data from the server (like names, ages, etc). I don't want to use C++ for sockets, I want to use … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 = … | |
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 … |
The End.