15,190 Topics

Member Avatar for
Member Avatar for ahspats

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 …

Member Avatar for masterofpuppets
0
382
Member Avatar for lewashby

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 …

Member Avatar for masterofpuppets
0
122
Member Avatar for MRWIGGLES

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 …

Member Avatar for woooee
0
138
Member Avatar for Yeen

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 …

Member Avatar for Yeen
0
153
Member Avatar for hondros

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 …

Member Avatar for hondros
0
118
Member Avatar for Elvedon

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 …

Member Avatar for vegaseat
0
150
Member Avatar for Vector_Joe

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 …

Member Avatar for jlm699
0
160
Member Avatar for lrh9

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 …

Member Avatar for Ene Uran
0
12K
Member Avatar for tonywacu

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

Member Avatar for Gribouillis
0
35
Member Avatar for jayjay85

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.

Member Avatar for jayjay85
-1
134
Member Avatar for vulcanfire

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 …

Member Avatar for masterofpuppets
0
70
Member Avatar for uv2009

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

Member Avatar for uv2009
0
144
Member Avatar for goisagi

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 …

Member Avatar for goisagi
0
75
Member Avatar for Dokino

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 …

Member Avatar for Dokino
0
127
Member Avatar for EvaDo

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 …

Member Avatar for Gribouillis
0
181
Member Avatar for lewashby

In the following code, could someone please explain these if statements? elif 5 <= unhappiness <= 10:, & elif 11 <= unhappiness <15:, they have two arguments, one on each side which is something I haven't seen before. Also, what the one to the far right for anyway? Also, this …

Member Avatar for masterofpuppets
0
151
Member Avatar for kaydub123

I need to write: Starting weight of food (in lbs:ozs)=8:9 into a python 3.0, I'm very new to this and what I came up with was: Starting_weight_of_food_in_lbs{:}ozs=input("Enter Starting_weight_of_food_in_lbs{:}ozs") print("Starting_weight_of_food_in_lbs{:}ozs entered=", Starting_weight_of_food_in_lbs{:}ozs) and I belive i'm way off....any help would be great!

Member Avatar for masterofpuppets
0
133
Member Avatar for Gribouillis

Joining together ordered sample points (xi, yi) when ths xi's are different yields a piecewise linear continuous (P1) function. This snippet defines a handy class to manipulate these functions. It allows computing the value and the slope of the function at each point, arithmetic operations, absolute value, truncation and linear …

Member Avatar for Gribouillis
1
594
Member Avatar for rajeshwari_ib
Member Avatar for patriciuuu

I'm trying to make a SMTP Checker using Python. The checker will do the following things: The code will take a list of smtps accounts (ex: host,user,pass) and will try to send an email to a email you will specify in the code. If it's successful (the send of the …

Member Avatar for nure
0
386
Member Avatar for vegaseat

This program uses the Python win32 extension module to get information on disk or flash drives for Windows machines. Specify the drive with its letter. If no drive letter is specified, the current drive is applied.

Member Avatar for Gribouillis
4
3K
Member Avatar for NicholasE

Hi all, I would like to make a for loop in which should do the following: To print the string n[i] twenty times then the string s[i] only one time. Then leave a gap and continue this until the n reaches n599 and s goes to s30. n0 n1 n2 …

Member Avatar for NicholasE
-1
86
Member Avatar for AutoPython

I have a limit of 30-45 dollars to buy an editor (with Python support, obviously) . Here's what I would like. Customizable syntax highlighting (like the kind in Notepad++). Auto indent, so it autmatically indents 4 spaces after a ':' character. Good code completetion. A built in IDE. Preferably like …

Member Avatar for Gribouillis
0
172
Member Avatar for smohrchi

I've been working with Java for several years now and it's time for me to expand to other languages. I've decided to learn Python and have now just started looking into where to begin. I'm wondering if there is one, maybe two books out there that are considered to be …

Member Avatar for jaux
0
90
Member Avatar for baskar007

I have a list of part files (that is many parts of single file). I want to append all parts into a single file to make a full file. I used this code: [CODE] import os l = ["home/baskar/1.part","home/baskar/2.part","home/baskar/3.part"] source_file ="/home/baskar/source.file" re_size = 0 buffer = 10*1024 #10 KiB's for …

Member Avatar for Archenemie
0
184
Member Avatar for deonis

Hello I'm trying to add highlighting to the specific keywords in the text widget. For instance I would like to highlight : Hello World. where is "hello" - will be coloured in red and "World" coloured green. Any Idea ??? [CODE] from Tkinter import * import os import subprocess import …

Member Avatar for deonis
0
3K
Member Avatar for katharnakh

im confused with [I]__call__() [/I] method defined within the class. [I]__init__() [/I] is used as constructor, and is called when we create an instance of the object. when does [I]__call__() [/I] method get called even though we not specify it explicitly... please help..........

Member Avatar for snippsat
0
17K
Member Avatar for checker

This is what I intended to do [CODE] class person: "class to represent a person" def _init_(self): self.name = "" self.age = 0.0 self.sqr_age = 0 class ageName: def listAgeName(x,y): # x is name # y is age x = 0 y = 0 listAgeName = [('John', 18)] p = …

Member Avatar for fallopiano
0
122
Member Avatar for johnroach1985

Hi there! I new learner in Python. And just couldn't get threading. I wrote this script. [CODE] import sys import MySQLdb if len(sys.argv)!=3: """the program name, mac and ip makes three""" """stop program and send error""" sys.exit("Must provide mac and ip!") mac = sys.argv[1] ip = sys.argv[2] print 'Connected to …

Member Avatar for woooee
0
287
Member Avatar for sjgriffiths

hello I am inserting records into a MYSQL table via a loop Records are being inserted, but every now and then the program bombs out with the below message There is nothing wrong with the query line though (If i restart the job, this record will be inserted without issue) …

Member Avatar for woooee
0
177

The End.