15,175 Topics
| |
My mission is to reproduce the "print screen" button. Must be in memory(no saving the file...). [CODE] import PIL import ImageWin as IW import ImageGrab import win32clipboard, win32con img=ImageGrab.grab() img=IW.Dib(img) win32clipboard.OpenClipboard() win32clipboard.SetClipboardData(win32con.CF_BITMAP, img) win32clipboard.CloseClipboard() [/CODE] [COLOR="Red"] raises TypeError: expected a readable buffer object! [/COLOR] I tried using the tostring method. | |
Hello, I've stumbled upon question I can't solve on my own. What I need is to write a program in python that would perform selection sort, but here's trick - it has to be recursive. So, for example I have l = [3,2,1] after using sort(l), l = [1,2,3] I've … | |
So for one of my university projects we have been assigned a problem to complete. I have the code working fine for the example output provided however I just need some help regarding a few errors that need fixing with different inputs. I am not asking for you to do … | |
Hello, I've been downloading my news for offline use with this script: wget -r --no-parent -Q4096m -U Mozilla A.stm -erobots=off [url]http://news.bbc.co.uk/2/hi/business/default.stm[/url]' But it dumps it into one folder, and the titles are numbered. Is there any regular expression or other command I can use to seperate them into folders by … | |
For those of you that are familiar with wx... I'm just dipping my toe into the world of wxPython and I've been trying to put together a very simple Wizard app. Right now I have code that is working properly, but I'd like to know how I can change the … | |
Writing my own turtle class (I understand that Python has it's own turtle class, but this is for an assignment) with an imported graphics.py to draw a koch snowflake and c-curve. What I have came up with so far are all the functions I need. I just need some assistance … | |
have code snippet.any ideas? for clust in clusters: #for each name in a list of names i have outNM = "fam" + str(count) + ".mcl.fas" #a series of files i want written to outFL = open(outNM, 'a') for c in clust: #for each letter in my list of names that … | |
I know it seems that everyone is writing a 'backup' program these days. I started working on this a couple weeks ago and now my dream just keeps growing. I have written a script that uses rsync to backup selected files and folders in my home directory to an external … | |
Okay, here's my issue. I want to take a message a user enters, and then take it and convert it to a number, the standard a-z = 1-26, with space equaling 0. I haven't put in any punctuation yet. Anyways, I think I needed a loop, and I made this … | |
I have 2 frames in my wxpython program, MyFrame and OptionFrame if I start my program it shows MyFrame, and if I end it, the frame disappears and the program stops. If I start my program and choose to show the option frame, it will show it, but if I … | |
This snippet defines a function [b]chmod[/b] which uses symbolic strings to represent the mode (eg [b]u+rwx[/b]) like the shell command 'chmod'. | |
I want to add a bunch of tags similar to *BTAU1293812 to the end of a bunch of strings (eg ">ASIOHDA87982374:r:23423:2342: 2342 known" i have : count = 0 ....then i open the file and the handle for line in fi: if line[0]==">": handle.write(line +"*" + "BTAU1293812" +str(count) + "\n") … | |
I am currently a student in computer Information Technology and I would like to ask those of you who are experienced working in this field. I didn't really know what forum to post this, so I am posting in Python because I love the language and have posted here before. … | |
Hi everyone. I have a problem with a GUI application i have written with wxPython when i run it under windows. The strange thing is that the code runs exactly as expected in Linux... What the code does: It calculates the area of bars of reinforcement and it checks if … | |
I have a hmwk assignment that i'm stuck on....It calls for a while loop so I need to basically repeat this 4 times but I cannot for the life of me figure it out....any help would be great I narrow the code down so it works when I input the … | |
i want to write a simple app which does nothing else except that you can drag an image in a window(simply clicking somewhere on the screen and moving mouse while holding the left button down). The problem is that my image moves only once and only a little bit and … | |
In the following program, how does the value of [COLOR="Red"]crit_name[/COLOR], end up in the [COLOR="Red"]self.name = name[/COLOR] value? Is it because it's passed to that class and name is the only value in the [COLOR="Red"]__init__[/COLOR] parameter that has no default value? Thanks. [CODE]# Critter Caretaker # A virtual pet to … | |
Hi, I am trying to write a snippet of code that checks if the user entered a valid color from an imported file called graphics.py. [code] # Get a valid color value from the user. color = raw_input("Enter a color: ")[/code] graphics.py contains a huge list of built in color … | |
I've got a bit of a problem. I've got a test tomorrow in python programming, and I've been learning the language using 3.1. The computers we're taking the test on all have 2.6 installed. They're Linux (not very familiar with Unix). Obviously this is troublesome. I don't want to spend … | |
Hi there My Algebra 2 class just started matrices, and I don't want to go out and pay $100 for a graphing calculator, just for the matrices, when I can code one myself. So... this is my code, and I can do it without classes, but I decided to make … | |
I have written two scripts in python. When I run the two scripts as individual programs they run correctly. But when the second script is run as a module within the first by importing it, an image file is not recognised. I have tried calling the full pathwayof the image … | |
Hi, I've been using Komodo Edit for my Python the past few weeks. I wanted to be able to use the F5 key like in idle. So I did a keybinding to F5 with this command: [CODE]%(python) %F[/CODE] That works well. Then I wanted to be able to hit F4 … | |
I'm wondering if it's possible to change the border color of a tkinter entry widget border. I don't think it is, because no such option exists in relevant documentation. You can change the width, but that just results in the whitespace being recessed - creating a raised 3d border. If … | |
hello, i'm a great beginner in Python. But now my problem is that i have to model the growth of plant development using L-system.... but where to start this?? please, i need your advices otherwise i m lost.... please. i hope to hear from your very soon....thx | |
i need to fade a picture into another picture.i need to use crossfade function to to this. i need some help please, i am new at this. any help would be great. i have done a program than makes a double image but this need to happen slowly. | |
Hi, trying to learn recursion right now. I'm trying to write this program where it will tell the position of the letter if found in the list. I'm trying to not use the in function or the .index() function to find the position. I got everything except the position. Any … | |
Hello all, I would be grateful for your advice regarding something I tried to do using unique() but it didn't work. I have a two dimensional numpy array that looks like that (but much larger): >>> pop_A1 array([[10, 2, 10], [10, 9, 10], [10, 9, 10], [10, 9, 10], [10, … | |
Hi, there! I'm pretty new to the programing world and I have a question. How can I write this code so it returns to surv1.set_sex = raw_input? after the "not in sex statement"? It's really confusing maybe I should try and write it in someother way? I don't quite understand … | |
hello, I'm writing calculator with Python and i came across few problems. First problem is that if user enters letters it would ask him to reenter them i thought i could do it like this [code=python]try: class num: x = float(raw_input("number\n")) numb = num() except: bull = False else: bull … | |
Hi!totally new, i did an undergrad in non-python related science, and I'm trying to move into incorporating python into my postgrad, so my questions right now are fairly basic. I basically want to run muscle (a sequence alignment tool) on a large number of files.how do i start a python … |
The End.