15,181 Topics
| |
I want to make a programme for adding data in my my database(mysql).I did everything right and i can add,delete,change,get data using MySQLdb. My problem is when i want to add gui(Tkinter) i get error message.I googled and did everything to solve it but stucked.Please help me!!!!! my code is: … | |
This is my first experiment with sockets. Its kinda like the beginings of a VNC app. The basic gist is that one file on computer "A" takes a screenshot of the computer screen and sends it to computer "B" where another file accepts the connection and receives the data. Computer … | |
Okay, here's what I am up to now. I am trying to figure out how to write sin waves to a .wav file, for playback. Here's the issue: I have no idea what I'm doing. I looked up the documentation for the wave module, and have been able to open … | |
I can't figure out how to set a radio button within a filemenu. I can use myRadioButton.SetValue( True ) outside of a filemenu. What I'm trying to do is to automatically set a particular radio button dependent upon the last value used. [code=php] import wx class MyFrame(wx.Frame): def __init__(self, *args, … | |
Here I have a simple range function that can use floats as steps or increments. In a time test (using Psyco 1.6, python 2.5, and a basic PC), the normal frange function was able to go up to 1,000,000 from 0, by .3 , and finish that in about 0.5929 … | |
You can use Python modules math, wave, and struct to create and save a synthetic sine wave of given frequency and duration (size) ... | |
Hello, I would like to add a six-line header to a data file for many files in a loop. However, I need to add the header to a data properly first... My inclination (as a python novice) is to write the header and append the data to the header. However, … | |
Currently I am working with multiple layouts now. Is there any way that I can save the state of the layout, and shift to the next layout and restore the state when I return back to the layout? | |
Hello everyone, my latest project is this: 1) Ask user to input a function 2) Plot said function Well, I figured out how to strip the function into two parts, input a number, and evaluate the function. That all works fine outside of a defined function I created. The trouble … | |
[CODE]import time import calendar # time tuple/list index YEAR = 0 MONTH = 1 DAY = 2 WEEKDAY = 6 # weekdays MON=0 TUE=1 WED=2 THU=3 FRI=4 SAT=5 SUN=6 # months JAN=1 FEB=2 MAR=3 APR=4 MAY=5 JUN=6 JUL=7 AUG=8 SEP=9 OCT=10 NOV=11 DEC=12 HAVE_30_DAYS = (APR,JUN,SEP,NOV) HAVE_31_DAYS = (JAN,MAR,MAY,JUL,AUG,OCT,DEC) HAVE_28_DAYS … | |
Hi My question relates to Python GTK I have an image -a JPG - which I draw onto a drawing area. I want to reveal a portion of the image -say a 10pix by 10 px square -only where the mouse pointer is currently at. Everything 10 x 10 px … | |
Hello I am trying to use Visual Tkinter but it's giving an "Invalid procedure call" error each time I try to place something on the form and the program closes. Screenshot of what I'm getting: [url]http://i48.tinypic.com/10zy5br.jpg[/url] I'm not even able to add a simple button to the form & when … | |
Hi, I would like to read data from an .asc file with a six-line file header. I just want the data without the header. I'd like to start at the 7th line and go until the end collecting the data into a single list. Each different data file I'm looping … | |
Hi, I'm a c++ guy trying to learn python. I'm trying to code something which models how a jukebox would work. The code I've attached simply adds numbers to a list on keypresses (enqueuing) and then other threads remove them (the player). My problem goes like this: When I press … | |
| Hello, im trying to use a function inside another function and getting an error: The function: [CODE]# Function that recieves number of characters and calculate cost of advertising def costAd(numChar): if numChar >= 15: cost = 35.00 else: cost = 35.00 + ((numChar - 15) * 3.55) return cost costAd()[/CODE] … |
Hi, What I'm trying to do is to write a script which would open an application only in process list. Meaning it would be "hidden". I don't even know if its possible in python. If not, there has to be a function would allow for a program to be opened … | |
Evaluation of formula G =((p→q) ^p)→q and the output display the result of true false' conclusion if it is a valid, invalid or inconsistent.. thank you for any response its a big help to my study her's my unfinished code [code] import sys p=[True,True,False,False] q=[True,False,True,False] a = [] def p_AND_q(p,q): … | |
I have a text file that contains Road Name types paired with their abbreviated form. For example: ... Avenue,Av Road,Rd South East,SE Terrace,Tce ... How do I a create a dictionary variable from this CSV file in python 2.5.1 so I can get it in this form? {...'Avenue': 'Av', 'Road': … | |
Hi, I have tried to send email through python code the code is - import smtplib from email.MIMEText import MIMEText #try: s = smtplib.SMTP() s.connect('') # I have given server name of email s.sendmail("","","test") # i have given from user and send user print "Succesfull" s.quit() #except: # print "Error … | |
[CODE] import random unordered = range(10) random.shuffle(unordered) list = [] list = [0,1,3,4,5,2,6,7,8,9] def selection_sort(list): l=list[:] sorted=[] while len(l): lowest=l[0] for x in l: if x<lowest: lowest=x sorted.append(lowest) l.remove(lowest) return sorted [/CODE] im trying to manually sort a list of integers from 0 to 9 using selection sort. i cant … | |
I am currently working on a central widget with multiple layouts. I want to display few items in the statusbarin one widget and when I shift to the other widgets the items in the statusbar shouldn appear. How can I do this? | |
What method / methods should be be used in order to get the frame to start up in a central position of the screen, and could you also provide the code please. I'm using wxPython. thanks | |
i see how this code prints s which is 'cad' but, then it somehow backtracks to print s again which is 'cat' according to the results after i execute it. can someone walk me through how this works? it would be a great help. [CODE]def eds(k,L,s): """ starting with the … | |
I'm getting "TypeError: unsupported operand type(s) for *: 'instance' and 'int'" It looks as if I am not setting a correctly and it would be great if someone could assist me with my problem. Thanks! [CODE=python] #! /usr/bin/env python from Tkinter import * import tkMessageBox tkMessageBox.showinfo("Text","Hello. Tell me any whole … | |
i dont even know where to start in this one lol ....... write a program to calculate and print the total parking charges for a customer at a long term parking lot. The charges are calculated according to the number of days parked at the lot. The parking charges for … | |
For my Intro CS class I've been asked to write two programs, described as the following. def glyph(image): """Given a grayscale image, returns the corresponding glyph.""" and def text(image, glyphs, threshold): """Given a grayscale image, a list of 26 glyphs corresponding to the 26 uppercase English letters (in order), and … | |
i have a lot of doc files to convert everyday. Any suggestion that help me to automate this conversion. Thanksssss :) | |
Hi all I have just joined the site , as i have posted on other forums and i have had no replies back. I have a file named index.py and in this i have def index() and def show(), when i access localhost/index or localhost/index.py or localhost/index.py/show or localhost/index/show it … | |
Hello! I started to create my own tiny 'framework' mainly built on the socket and the thread module. I haven't been doing too much thread programming before. My problem is that when I try server.waitForConnections(2), at the second connection, it says [code] Unhandled exception in thread started by Error in … | |
I know that this is an easy one but it is hard for me to figure out. I need to make a program that can: * Open the file and read through all of the lines in the file. (got this) * If a line starts with "Subject:", skip the … |
The End.