15,179 Topics

Member Avatar for
Member Avatar for Muhammad Anas

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 …

Member Avatar for snippsat
0
433
Member Avatar for Syphilis

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 …

Member Avatar for vegaseat
0
63
Member Avatar for lewashby

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

Member Avatar for lewashby
0
136
Member Avatar for ErlendHL

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

Member Avatar for ErlendHL
0
91
Member Avatar for leiger

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 …

Member Avatar for Gribouillis
0
643
Member Avatar for TrustyTony
Member Avatar for TrustyTony
1
2K
Member Avatar for ppp88

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?

Member Avatar for TrustyTony
0
74
Member Avatar for leiger

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!

Member Avatar for leiger
0
151
Member Avatar for lewashby

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

Member Avatar for TrustyTony
1
248
Member Avatar for jv_05

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 …

Member Avatar for vegaseat
0
360
Member Avatar for alphaOri

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 …

Member Avatar for alphaOri
0
151
Member Avatar for shaqywacky7

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 …

Member Avatar for shaqywacky7
0
254
Member Avatar for prashanth s j

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 …

Member Avatar for prashanth s j
0
202
Member Avatar for ArtemisFowl

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 …

Member Avatar for vegaseat
0
536
Member Avatar for niehaoma

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 …

Member Avatar for niehaoma
0
71
Member Avatar for kelokely

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 …

Member Avatar for baki100
0
116
Member Avatar for vlady

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 …

Member Avatar for TrustyTony
0
158
Member Avatar for SoulMazer

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

Member Avatar for SoulMazer
0
273
Member Avatar for Gargen

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

Member Avatar for Orion2k
0
526
Member Avatar for kurtiskain

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

Member Avatar for griswolf
0
132
Member Avatar for ihatehippies

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 …

Member Avatar for TrustyTony
0
2K
Member Avatar for Syphilis

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 …

Member Avatar for vello
0
116
Member Avatar for i-teq

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 …

Member Avatar for i-teq
0
4K
Member Avatar for photoyid

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 …

Member Avatar for TrustyTony
0
839
Member Avatar for lstensland

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 …

Member Avatar for lstensland
0
440
Member Avatar for foco

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 …

0
64
Member Avatar for Pineapplesf

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

Member Avatar for vegaseat
0
13K
Member Avatar for daanh

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

Member Avatar for Gribouillis
0
131
Member Avatar for Syphilis

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 …

Member Avatar for Syphilis
0
138
Member Avatar for pixeldroid

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

Member Avatar for pixeldroid
0
172

The End.