15,190 Topics
![]() | |
Hello everybody, I am Saurav Saha from India. I am not aware of python but just because i am working on a tool that is on python i got struck. I have many directories in which two files are kept 1. *.txt and 2. *.pdbqt I wanted a program that … | |
Is there a way to do nested list comprehension? for example I can square a range of numbers, even only. [CODE][x*x for x in range(1,20) if x % 2==0][/CODE] but what if I want to square the even and times the odd by 3. [CODE][x*x for x in range(1,20) if … | |
[B]Hi , I hope you people will me, to send mail using python .i searched for this program in google i found lot of programs ,when i run this programs on windows7,run successfully, but i didn't get mail to destination(recivers) mail account, please send me send mail python script.which is … | |
I am about to begin working on a program serving simultanuously a handfull of non-technical clients. I am still trying to select my user interface, and would like your suggestions, given that my main program would be written mainly in Python. I would suppose that most of the actions requested … | |
Hello all, Following the guide on sourceforge, I've created several pyplot programs which have nice event handling. I'm able to press keys on my keyboard and the plots advance and change. The backend for this program is GTKagg. There are several instances where I can change parameters in the plot … | |
Hello! does any1 knows how to convert captured hex packets in mac frame type(control, management, data) and their subtypes? please let me know thanks | |
Hi. I have a very very easy problem in my program. The problem is that i want to load another page via press a button. It till work like any webbrowser. First och gonna write in the URL in a textbox, then press a button named Go or Enter or … | |
I am running some multi-process program, its various processes being python interpreter instances. I wish to be able to identify which process is which in the task manager. How may I perform that? I use the multi-processing module for this application. | |
![]() | I bet someone already asked this but I can't find the thread. I am using windows XP home edition. I loaded python 2.6.6 off the web as it is the same version some of my code is written in. When I click on the idle GUI I get no response. … |
Hi, this is my code for Python: [CODE]granted = False for count in range(10): password = raw_input('Please enter a password: ') if password == 'thepassword': granted = True break print 'You have entered invalid password %i times.' % (count+1) if granted: print 'Access Granted' raw_input('Press ENTER to continue...\n') else: print … | |
i am building a simple sync program, whan the program starts it takes all the bandwith, i need to set the speed limit, i am using using ftplib [CODE] file = open(local_file_path, 'r') print ftp.storlines('STOR '+ file_name , file) [/CODE] | |
Hi. I got two questions about wxPython! 1. Can python use Internet explorer 6 as webkit? Like Visual Basic.NET do. 2. Has python a webbrowserfunction who pause the program untill the page is 100% loaded? When continue. | |
Hello everyone I haeve tried to understand the capabilities of python in web development. Have gone throuhg forums and online tutorials. Nevertheless I am not able to find any topic which can give me some insite along with basic examples of how to send http get data from an xp … | |
hello im new to python and im just making simple programs(for now) so im doing this guessing game where the user enter a number and tells him if he got it right or not. here is the code [CODE] import random import re print 'This is a guessing game' def … | |
I am trying to open multiple ports in a computer with PYTHON Sockets. Here is my code.. [CODE]import socket import thread from threading import * BUFSIZ = 1024 clientsock = socket.socket() def handler(clientsock,addr): while 1: data = clientsock.recv(BUFSIZ) if not data: break def function(): for n in range(1,5): var = … | |
Next quiz is posted as code snippet. It is quite interesting code. What it does? And where [B]in your system[/B] you already have this code? (in little different format) (If you have not follow tip in page [url]http://python.org/download/[/url]) | |
[CODE]tomashqooo@Tomashqooo:~$ python Python/tcrack.py File "Python/tcrack.py", line 86 ostring2 = ostring2' -c 'station' mon0' ^ SyntaxError: invalid syntax[/CODE] That`s my error message when ostring2 and station are string variabiles and ' -c ' and ' mon0' is text. Please help me what`s the problem here??? | |
Hi all, Here is mu scenario.I am trying to open multiple port on a compute. I am trying to make the code multi threaded.So here is my code: [CODE]import socket import thread from threading import * s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def handler(clientsock,addr): while 1: data = clientsock.recv(BUFSIZ) if not data: … | |
The following is a class from a search engine program that I'm working on (via a text book). I'm attempting to modify the following code so that it will count the number of occurrences a user's entry has from a source. My initial attempts was to create a new method … | |
Decided I want to use python for web programming. I am a fan of Lighttpd, but when it came to python, just seemed like apache had some better options. I am currently setup with Apache2 and mod_python. I use VirtualHost site configurations to serve a few websites, and do per-site … | |
Okay so as a complete newbie... Currently I am at chapter 6 of a book called How to Think like a Computer Scientist ([URL="http://openbookproject.net/thinkcs/python/english2e/ch06.html"]http://openbookproject.net/thinkcs/python/english2e/ch06.html[/URL]) and I for some reason can't figure out this exercise: Make this doctest pass: [CODE]def print_digits(n): """ >>> print_digits(13789) 9 8 7 3 1 >>> print_digits(39874613) … | |
I have a command lets say [CODE]f(x): print x[/CODE] I want to create several buttons to print various numbers so I made a list of the objects to print when I tried to do [CODE]for x in thislist: bind_all(x,lambda:f(x))[/CODE] which bound the buttons properly but all the buttons print the … | |
Hi! I want to make a python program that runs different simple command line scripts. Right now I use os.system which works fine for running the scripts, but the problem is that the scripts sometimes halt and wait for input from the user. So my question is, how do i … | |
Hi, I'm looking to code the following problem in python. If (for example) dict={A:0.7,B:0.8,C:0.9,D:2.3,E:0.1,F:2.4} and so on.. (i have a big dictionary of A-Z something like this) I'm looking to find repeated substring in a string that has a dissimilarity of no longer than 0.5 (between highest and lowest). The … | |
I want to obtain the data from .dat file which contains millions records (most of them are string) with 52 fields. I am trying to store the data into 52 lists. However, it is very slow Here is the code: import sys try: file= open("test.dat", "r") except IOError: print >> … | |
So I'm pretty lost in Python. My teacher doesn't explain the commands for Python so I'm really confused on how to write this. I have to write a green screen type program that takes a picture with a green background and replaces it with another picture by looking at the … | |
I am writing Python on my mac, and am trying to pipe the output from the Terminal to python.. I think this is achieved with os.popen? | |
If I have a class variable being passed to a function, is there a way that I can get the class that the variable is from? [CODE]class someclass: def __init__(self): self.somevariable='somevalue' def somefunction(self): print('gotta get here') def someotherfunction(somevariable): somevariable.needparentclasshere.somefunction() myclass=someclass() someotherfunction(myclass.somevariable)#this needs to print 'gotta get here'[/CODE] | |
Ok so I'm trying to get images to resize which I could do with Image.PhotoImage but now I'm using RGBA .png files so I have to use ImageTk.PhotoImage and I can't figure out how to resize them anymore any help on this kind of thing? I'm using python,tkinter | |
Hello, I'm having trouble running the CalcOpticalFlowPyrLK in Python. When I try doing the calculations for the Lucas Kanade code it will not compute the error I get is the following:[ICODE] File "****", line 63, in callback (currFeatures, status, track_error) = cv.CalcOpticalFlowPyrLK(old_image, new_image, old_pyramid, new_pyramid, old_features, (3,3), 1, (cv.CV_TERMCRIT_ITER, 10, … |
The End.