15,179 Topics
| |
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 … | |
I am new to programming and have been reading a few books on Pyhton but can't seem to grasp what I believe is probably a simple process. I need someone to show me briefly a sample script that would allow me to open a CSV file and edit it line … | |
I have a simple script to POST a pdf to a server. It works great when I use Ubuntu to run it. However, when I run it in Windows, I get this error: Error: <urlopen error [Errno 10035] A non-blocking socket operation could not be completed immeditately> Could this be … | |
I am having a lot of trouble sorting an array. The array contains 140 inner arrays of 3 points (x y z). I would like to sort all arrays based on lowest x coordinate to the highest. I have googled many methods and none of them have worked so far. … | |
i'm reading a an excel file with xlrd. When i'm running the code a warning pops up: 'WARNING *** format u'"*"' produces constant result ' I think that u'"*"' stands for unicode, is that correct? But what does 'produces constant result' mean and what implications can it have? Thanks | |
What's Up? So, In my first python script, If a button is pressed, Then it defines a variable called var, With the content of "0" and then sends it over the net to another python script, And here's the problem. When it comes to receiving the content of var. [code]var … | |
Hi folks: Once again, working w/Python in Maya, a 3D animation app. I'm using a potentially time-consuming procedure to generate a list of commands, and I want to store the list in the Maya file. The best solution I can think of is to convert the list to a string, … |
The End.