15,406 Topics

Member Avatar for
Member Avatar for now0pen

I am playing (and learning a lot) with pywinauto on my windows vista pc. Is there a module like pywinauto that I can use for ubuntu? Thanks!

Member Avatar for JasonHippy
0
38
Member Avatar for machine91

How do you write a python code that looks at a specific cell in a csv file? I have the following data in a csv file 1 0 100 2 11 150 3 0 189 4 0 195 5 21 245 I need to write a program in python that …

Member Avatar for JeoSaurus
0
3K
Member Avatar for saurav4ever

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 …

Member Avatar for Gribouillis
0
333
Member Avatar for flebber

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 …

Member Avatar for richieking
0
156
Member Avatar for mukthyar1255

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

Member Avatar for griswolf
0
156
Member Avatar for yuvalm2

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 …

Member Avatar for woooee
0
227
Member Avatar for hughesadam_87

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 …

Member Avatar for hughesadam_87
0
118
Member Avatar for nnaorin19

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

0
41
Member Avatar for heavy.is.happy

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 …

Member Avatar for heavy.is.happy
0
217
Member Avatar for yuvalm2

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.

Member Avatar for woooee
0
71
Member Avatar for rickyfre

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

Member Avatar for vegaseat
0
105
Member Avatar for Mike_11

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 …

Member Avatar for richieking
0
758
Member Avatar for maf_9000

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]

Member Avatar for Gribouillis
0
1K
Member Avatar for heavy.is.happy

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.

Member Avatar for richieking
0
66
Member Avatar for tigrum

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 …

Member Avatar for serinformaticos
0
231
Member Avatar for Vengful

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 …

Member Avatar for Vengful
0
100
Member Avatar for debasishgang7

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

Member Avatar for Tech B
0
1K
Member Avatar for TrustyTony

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])

Member Avatar for TrustyTony
0
230
Member Avatar for Tomashqooo

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

Member Avatar for Tomashqooo
0
75
Member Avatar for debasishgang7

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

Member Avatar for debasishgang7
0
905
Member Avatar for codemonster

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 …

Member Avatar for woooee
0
93
Member Avatar for petzoldt01

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 …

0
73
Member Avatar for Checkerboz

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

Member Avatar for Checkerboz
0
121
Member Avatar for Thropian

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 …

Member Avatar for Thropian
0
76
Member Avatar for SasseMan

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 …

Member Avatar for Gribouillis
0
152
Member Avatar for ankurvit

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 …

Member Avatar for TrustyTony
0
196
Member Avatar for clyt

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

Member Avatar for clyt
0
138
Member Avatar for Tugnus

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 …

Member Avatar for Tech B
0
2K
Member Avatar for FALL3N

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?

Member Avatar for FALL3N
0
116
Member Avatar for Hawkwing

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]

Member Avatar for woooee
0
162
Member Avatar for Thropian

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

Member Avatar for Thropian
0
14K
Member Avatar for Kirielson

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

0
179
Member Avatar for Caraka

Greetings I'm running in circes trying to accomplish something very simple. I have a csv file with multiple lines resembling: 0002345, 24, 5, 0.24 I need this format in my output file: '0002345', 24, 5 0.24 The first entry is a census meshblock code and the leading zeros are relevant …

Member Avatar for Caraka
0
869
Member Avatar for AnjaliThukral

I have windows xp operating system at my home with python 2.5 and same operating system with python 2.4 at my computer lab. While working in python IDLE suddenly this error message --socket error:connection refused-- pops up and then python IDLE does not work at all.To make it work again …

Member Avatar for vegaseat
-1
1K
Member Avatar for Sinnocence

I wasn't able to find the link describing how to solve this. When I try to compile my program with py2exe using python v2.6 at the end of the process I get a message saying The following modules appear to be missing ['ICCProfile','_grabscreen','_imaging_gif'] my setup script is just : from …

Member Avatar for snippsat
0
199
Member Avatar for vegaseat

One more application of the Python Image Library (PIL). This short code creates thumbnails from all JPEG files in the current folder. The thumbnail image file is prefixed with a T_ and saved to the same directory. The program checks for existing files with this prefix, so we don't create …

Member Avatar for thenate
1
2K
Member Avatar for jmark13

Hello again, So, I'm trying to work out a problem where there are 6 symbols in a string (A, B, 0, 1, [, ]). The brackets always have to face each other in the string but they can be nested. There are some rules, most of which I have down, …

Member Avatar for TrustyTony
0
139
Member Avatar for Petan Kl

Hello, I am wondering if there is an efficient way (other than for cycle) of solving following task: I need to multiply e.g. two matrices and at every point in the matrix there is an array. The two matrices shall be multiplied using matrix multiplication and when the elements of …

Member Avatar for Gribouillis
0
214
Member Avatar for FALL3N

ok, I'm sure the answer to this is very simple.. there may even be some component in the os package to do this... I want to do what the code underneath seems like it would do.. I understand it does not, and when I try to run the code, I …

Member Avatar for FALL3N
0
279
Member Avatar for FALL3N

hello all, I have a program, and in it, it eventually specifies 'aFolder' to be os.walk(path/to/folder) how do I obtain inifo such as the name or the path of the folder, is it then the temporary current working directory?

Member Avatar for snippsat
0
114
Member Avatar for jml101

Hello All, New to Python, I keep getting an indentation error after the if (yescheck == todcheck): line. Any suggestions? As far as my python knowledge goes, I've got it correctly aligned, but clearly not. Could some of you try running this, see if it goes? [code=python] import os yesfile …

Member Avatar for vegaseat
0
722
Member Avatar for TrustyTony

I thought to post some not quite so trivial as it looks quiz for Python, to test if your brain has Python installed OK ;) Try to figure out what interpreter answers (#? lines), then check with your Python interpreter of choice: [CODE]>>> a = list(range(10)) >>> a[1:1] #? >>> …

Member Avatar for TrustyTony
3
673
Member Avatar for Kirielson

Hello, I'm trying to run an object on Python with ROS. When I run the code with a variable inside the object: [CODE]class lk(old_image): ....then some code def main(args): rospy.init_node('lk', anonymous=True) old_image = lk(old_image) try: rospy.spin() except KeyboardInterrupt: print "Shutting down" #cv.DestroyAllWindows() [/CODE] [ICODE]Traceback (most recent call last): File "/home/aadejare/ros/omnisensor/nodes/lk.py", …

Member Avatar for griswolf
0
342
Member Avatar for hszforu

I started learning python3 some 3-4 days ago.My ultimate aim to learn this language is to design web apps(eg apps to automate account creations for seo etc.) For this i guess i will have to use django or turbogears for this, but now i came to know that django or …

Member Avatar for hszforu
0
194
Member Avatar for TrustyTony

There was little buggy version of Python base conversion around, so here quick hack for my own program, including test with random numbers to verify it.

Member Avatar for TrustyTony
0
933
Member Avatar for johanngomes

Hi people, i am in trouble with python quotes, see this: [CODE]string = "qwerty"[/CODE] when i do a print string it returns: [CODE]'qwerty'[/CODE] how do i replace this singles quotes to double quotes when the value of the variable is returned? there is a way? thanks in advance! ;)

Member Avatar for Schol-R-LEA
0
688
Member Avatar for TrustyTony

What modules come builtin with your Python? Let's exclude the internal _ starting ones for this question. You know those? Are you sure? Good, because I did not! (Hint WindowsXP and Python2.72 has 27 builtin modules) Here the answer in code [CODE]import sys print('\n'.join(n for n in sys.builtin_module_names if not …

Member Avatar for Gribouillis
0
304
Member Avatar for Tremillian

I took an intro python class and learned some about jython. Unfortunately, what I have in mind is far too complicated for my level of training. Is it possible to use jython to import pictures from a scanner? If so, what module would I start with/use? The scanner is an …

Member Avatar for FALL3N
0
134
Member Avatar for pblnrao

I created python executable with py2exe. In my program, I use the pywin32 module. [U][B]Details of the SW's[/B][/U] OS Window 7 64 Bit Python 2.6 pywin32-214.win32-py2.6 when i created the exe its working fine on other system running Windows 7 but giving below error when running on Windows XP systems... …

0
135
Member Avatar for andrewtrench

Hi. I have a problem that I am tearing my hair out to solve. I am trying to transfer tens of thousands of records into a sqlite db using the script below. The script seems to run okay and I can see the db growing as it runs to some …

Member Avatar for andrewtrench
0
2K

The End.