15,190 Topics
![]() | |
Hi, I need to define some common variables in one file and use that file in my python script , Like in php we define some variable in (eg :definevble.config) file, later we will use that file using include method in php script. Plz let me know how to do … | |
Hello everyone, I have a problem with TkMessageBox on Windows: My program receives a message from a server and then it should show a MessageBox, but instead of doing so, the program freezes. Elsewhere in the program, a MessageBox is called after the user having pressed a button, and this … | |
for seq_record in SeqIO.parse(open("mm.fa"), "fasta") : I am using the above code to read fasta files. But when the number of sequences record exceed about 30000, the python return this error: Traceback (most recent call last): File "C:\Python26\Neutral\AICMM.py", line 28, in <module> if (seq_record.seq[count] == "A") : File "C:\Python26\lib\site-packages\Bio\Seq.py", line … | |
I am trying to modify this trivia program to read scores from a separate text file and then add the scores to a running total if the user answers correctly. Here is my code so far: [CODE]# Trivia Challenge # Trivia game that reads a plain text file import os … | |
I wish to relate on some Pseudo Code if you Please !!! | |
Hi all! I am building a small app with pygtk as the gui. I have a thread that communicates over the network and when the user clicks a button I want a variable to be updated in my communication thread. I have made a class that subclasses Thread: [CODE] class … | |
Hi? i'm new at programming and im trying to decipher a code. i'm trying to count how many times a char occurs in txt file | |
Hi, how change in zope cmf server Document portal type? "Workflows This object's portal type is: Document. " I wish: "This object's portal type is: My new Document." Thanks | |
When running my code, I get a "substring not found" not entirely sure what that means..here is my code:\ [CODE]filename = open('code.txt','r').read() string = filename def decode(string): abc='ABCDEFGHIJKLMNOPQRSTUVWXYZ' n=1 result='' for rotate in string: result+=abc[(abc.index(rotate)-n)%26] n+=1 print result def main(): decode(string) main() [/CODE] | |
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? |
The End.