15,185 Topics
| |
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 … | |
Hello Friends, I am an absolutely beginner in the world of computer programming. I started my voyage in this world yesterday by starting learning Python. I am reading an e-book on python [URL="http://openbookproject.net/thinkcs/python/english2e/"]here[/URL]. That book has been written with examples from Linux platform. So, I felt this problem while going … | |
What's Up? OK, So I'm designing a nice new shiny UI for my Python script, Now when one of my buttons gets clicked I want it to perform some of my own defined tasks, So I need to define my own 'Slot' if I'm correct? But I can't figure out … | |
[CODE]import sqlite3 def find_details(id2find): db = sqlite3.connect("surfersDB.sdb") # grap surfer data from database db.row_factory = sqlite3.Row cursor = db.cursor() cursor.execute("select * from surfers") rows = cursor.fetchall()[/CODE] In the code snippet above from "Head First Programming", the syntax for the database code is poorly explained. Is row_factory a call, method, or … | |
Hi. I make a new array, p: [CODE]p=[[x]+[0]*(y)]*z[/CODE] then if x=1, y=2 and z=3, the array is: [CODE][[1, 0, 0], [1, 0, 0], [1, 0, 0]][/CODE] But now, the problem steps in. If I now say that p[0][0]=2, then the array is: [CODE][[2, 0, 0], [2, 0, 0], [2, 0, … | |
This is code I've taken from another website, and adapted to work with the JFileChooser. I got it working so that someone could select a java file with the chooser, and I'd send a "java -jar FILENAME" to the console and the app would launch. However as soon as I … | |
I used this pattern few times to answer a thread and thought to post it as snippet. | |
which software i need to install to run a code started as follows: [CODE]from appuifw import * from e32 import *[/CODE] can anyone help me? | |
Python works fine in the console, but I'm having problems using python in a Java program. In case someone here has any ideas, I'm posting a link back to my original post (please reply there and not here): [url]http://www.daniweb.com/forums/post1246152.html#post1246152[/url] Thanks! | |
[CODE]def find_details(id2find): surfers_f = open("surfing_data.csv") for eash_line in surfers_f: s = {} (s["id"], s["country"], s["average"], s["board"], s["age"]) = eash_line.split(";") if id2find == int(s["id"]): surfers_f.close() return(s) return({}) lookup_id = int(input("Enter the id of the surfer: ")) surfer = find_details(lookup_id) if surfer: print("ID: " + surfer["id"]) print("Name: " + surfer["name"]) print("Country: " … | |
Excuse, I need to work with data bases. In a little research I made, I found that python has a library call sqlite3 but I don't find information of how I use it. So if anyone can explain it to me I'll be so thankful. PD: I need this because … | |
I'm using python and I want to be able to create an object of a base class and have it initialize the object using the __init__ of a subclass. I use a function defined outside of the classes to determine which subclass' __init__ method should be called. I found a … | |
Hello everyone, I've just started using the pypcap and dpkt modules and tried the code on google code for pypcap and I get nothing. Heres the code I used: [code] import dpkt, pcap pc = pcap.pcap() pc.setfilter('icmp') for ts, pkt in pc: print `dpkt.ethernet.Ethernet(pkt)` [/code] I think this is suposed … | |
Hi all, Currently I execute multiple scripts in the following format: os.system(./script1) os.system(./script2) os.system(./script3) But now I need to modify the code in such a way that script1, script2 etc return a success code(0) or failure code(1). But os.system can not return these values. What I need to do so … | |
I've been working through the book Python Programming In Context and everything runs fine except cImage. I went to the website to download it, but so far I haven't found a version for Python 3.1.2. I can use the cImage.py file they give on the website, but in order to … | |
I have been playing around with Python, numPy, SciPy, and matplotlib for a few weeks now. I was wondering how easy (assuming it is possible) to utilize a waveform file (example: .lpf or similar scope-captured waveform file), and re-plot that waveform using matplotlib, etc. Anyone have experience doing this? I … | |
I have a list of files of similar format. I want to extract all lines form each file that are containing exact character for example I need to extract only lines with TPO and saving to another file also I need to extract only lines with HOH and saving to … | |
Hello, I make an exercise from a book : Think Python: How to Think Like a Computer Scientist by Allen B. Downey, Version 1.1.22, random words exercise 7. I made a script like this (see below) but how can I make list (named book) just once and since then after … | |
Hi, so I'm having quite the difficulty here. Let me start by explaining the architecture of my scripts. My "Listener.py" is a script that uses asyncore in order to listen for connections and receive commands from them. If it receives the text "play" from a connection, it calls another script, … | |
im just curious im currently learning all major programming languages that are usefull to me and i am wondering what is python useful for in a realistic sense | |
Hi everybody! I am currently working on a low level console/text based python phonebook. I have a working program and i can add and search entries just fine, but what I want to know is...can I remove entries? I am using the OS package...so i 'import os' at the beginning, … | |
I wrote this function to compare two strings and find their similarity. It returns the percent of their letters in common in place. ie "hello" and "yellow" share the "ello" (8 of 11 characters) and thus are 72.72 % similar. I feel like there is a better way to write … | |
What's Up? I can't seem to post this in the PyQt section (No post new thread button) Anyway I've started using PyQT to design a UI for my python script, I've googled around for ages and racked by brain, But to no avail, Nothing I've found is specificy tailored to … | |
Whilst having 20+yrs in IT I'm brand new to Python programming... I'm trying to reference an object in a different class as a lookup... I have a class which describes items and their prices I have a class which describes a currency code and a conversion rate I'm trying to … | |
Is there a way to determine which shift key is pressed? I am writing a program that shows an image and I want the user to say which side of the screen it is showing up on.... I thought of using the mousekeys but realized that not all computers have … |
The End.