14,952 Topics

Member Avatar for
Member Avatar for mitchandsuzy

hi everyone, I have searched for and answer to this and cannot find any solution. So please forgive me if it is a straight forward answer! I have a module that is imported. It has a number of subroutines inside it that need to be run, one for each year. …

Member Avatar for mitchandsuzy
0
83
Member Avatar for Buckets78

Let me start out by saying I've been playing with Python for a few weeks now, was recommended by a friend who uses Perl, and it's been quite enjoyable to play with. I've no other programming experience except HTML/CSS. This site has been a wealth of information and an excellent …

Member Avatar for Buckets78
0
82
Member Avatar for max.yevs

I'm trying to make a perfect numbers script but having almost no success... Perfect numbers are those whose factors add up to twice the number itself... factors don't have to be prime... So like the first four are 6, 28, 496, 8128... 28: 1,2,4,7,14,28 1 + 2 + 4 + …

Member Avatar for max.yevs
0
203
Member Avatar for ihatehippies

The question is in the title. How do you create a list r = range(5) and just reference the data without referencing the object itself. ie. o = r .. I just want to reference range(5) without referencing r itself. if i did o.pop(0) it likewise does r.pop(0) ...ideas?

Member Avatar for ihatehippies
0
77
Member Avatar for jmil2

I am working on a problem that requires that i create a 3x3 matrix in python using the list function. these are the functions that im required to use to create my matrix: def mlist(size): list = [] for i in range(size): list = list + [None] return list def …

Member Avatar for adam1122
0
8K
Member Avatar for ssn

Hi, I am interested in working on this project and would like to know more about this project...I am a completely newbie to Python. So I would like to know what I should study in Python and features that will be useful for this prj. Could you also explain in …

Member Avatar for vegaseat
0
108
Member Avatar for alicem

Hi, I'm a beginner, and just want to display an image using Python. I have this code... [code]from PIL import Image Image.open("pic.jpg").show()[/code] which according to what I've read, should work. However, it just opens Windows Photo Gallery and says 'There are no photos or videos selected'. I have ensured that …

Member Avatar for alicem
0
70
Member Avatar for alicem
Member Avatar for mbirame

Please see this thread to see where we are at... [URL="http://www.daniweb.com/forums/thread184723.html"]http://www.daniweb.com/forums/thread184723.html[/URL] I really don't have the knowledge to get this done, and I understand that I'm probably asking too much for someone to spend time for free on the forum finishing this project. Feel free to email me at joel …

0
60
Member Avatar for planetPlosion

I'm getting seemingly unfounded errors with this seemingly easy program.. the variables "guess" and "i" are user input [code] for guess in range (i): float(guess + float(x / guess)) / 2 print guess [/code] I'm getting: ZeroDivisionError: integer division or modulo by zero

Member Avatar for jlm699
0
150
Member Avatar for mdg583

Hello, I am relatively new in python, but I am jumping in and trying some things. I am working through how to write something like PyPanel, and am starting with PyPanel. The complicated part of that python is being extended by a custom c module, and the c module makes …

0
59
Member Avatar for daviddoria

A friend of mine said that python could be used to make simple GUIs (ie. a couple of buttons and a text box). I googled "python gui" and it looks like there are 30934 libraries to make GUIs. Is there a "standard" or "built in" one? Thanks, Dave

Member Avatar for jlm699
0
105
Member Avatar for phillip1882

im trying to write a recursive function that returns the fibonacci number, but am getting a weird result. here's my code. [code] def fibonacci(a,b,n): a =a+b b = a+b n= n-2 if n ==0: print b return b elif n ==1: print a return a else: fibonacci(a,b,n) x = fibonacci(1,1,7) …

Member Avatar for leegeorg07
0
101
Member Avatar for katamole

Hi all, Looking through the more popular visualization packages for Python, it seems like it is very difficult to specify a network with absolute length values for the edges. Example: Create 4 nodes: a, b, c, d Create edges between all nodes: a>b, a>c, a>d, b>c, b>d, c>d This is …

0
58
Member Avatar for katamole

Hi there, I've been searching the documentation but I can't find any answers (perhaps I'm asking the wrong questions). Say we have a list of animals: Sheep, Cow, Pig, Horse. All of these animals have attributes (4 legs, etc.) We have the name of the animal and the attributes stored …

Member Avatar for katamole
0
395
Member Avatar for taboyo22

How do you get programs like bubble sort, quick sort to print a result. def bubblesort(list): for passes in range(len(list)-1, 0, -1): for index in range(passes): if list[index] < list[index + 1]: list[index], list[index + 1] = list[index + 1], list[index] return list Thanks

Member Avatar for jlm699
0
84
Member Avatar for max.yevs

say you have a list, b, you don't know how many items are in there, but how could you add up all the items? for example, if your list is [2,4,5,8,10] is it possible to find the sum of all the numbers? so it will give you 29? i've been …

Member Avatar for max.yevs
0
79
Member Avatar for muhammadammar

I am working on a script which uses subprocess and multiprocessing modules, the problem is that when i try to kill a process it said that WindowsError Access is Denied Here is the problem in detail def function1(file, childConn): some statements def fuction(): process1 = subprocess.Popen(process1_path, 0, None, None, None) …

0
49
Member Avatar for max.yevs

this is kind of a quick question, but just a bit complex: say i want it to find n in range(5), i would do this: [code]for n in range(5): print n[/code] and it would return 0,1,2,3,4.... but what if instead of returning i want it to put it in a …

Member Avatar for max.yevs
0
106
Member Avatar for seamonkie

I am having problems with this code and im nooby what im trying to do Create a game where the computer picks a random word and the player has to guess that word. The computer tells the player how many letters are in the word. Then the player gets five …

Member Avatar for jlm699
0
765
Member Avatar for henryxxll

I created a Python script to find two whole numbers that, when multiplied together, will equal the target number, or factors. My script works by dividing the target number by a regularly increasing integer, and checking to see if the quotient is a whole number (integer). Here's the script: [CODE="python"] …

Member Avatar for woooee
0
131
Member Avatar for max.yevs

i'm making a program, i need to know is there a command for "divisible"? as in [code]if m is divisible by n[/code] if not, is there a command like "if its a whole number"? as in [code]if m is a whole number[/code] of course i can work with either command, …

Member Avatar for max.yevs
0
302
Member Avatar for shiva666

hello to all i need help getting the output of this program to write into a file elif choice == "3": print "all users list :" print"\n" import active_directory for user in active_directory.search ("objectCategory='Person'", "objectClass='User'"): print user "" that lists all active directory personal .. in rows how can i …

Member Avatar for shiva666
0
61
Member Avatar for tivrfoa

hi!! to show the source code I thought it is supposed to do this (at least it worked using ipython with version 2 of python): >>> method?? I'm using version 3. How can I show the source of a method. eg: >>>def sayHi(): print('Hi') >>>sayHi?? then show the source code. …

Member Avatar for vidaj
0
180
Member Avatar for invinate

Hello, I start a thread that runs exec and sets the global variable to True, meaning that the thread finished. The main thread that creates this new thread runs in a loop while the global var is False. The problem is that the exec job is also running in a …

Member Avatar for invinate
0
81
Member Avatar for blair.mayston

Hi, Playing with a script I did a while ago that sends emails alerts when rss feeds are updated to make it more readable, and have struck a problem. At present the email it sends is formatted as follows: "http://www.stuff.co.nz/national/2344448/Group-charges-in-to-reduce-bag-use" Group charges in to reduce bag use (Pressure from environmentalists …

Member Avatar for blair.mayston
0
16K
Member Avatar for maybetuesday

Hi I'm having some trouble with my code. In my code, I've designed a frame with a checked box inside using wx.Frame and wx.CheckBox. I'm trying to allow users to decide whether they want to grayscale a list of images. If the user checks the box, wx.ProgressDialog is launched. All …

Member Avatar for lllllIllIlllI
0
193
Member Avatar for daviddoria

Does anyone have a good 2 line summary of WHEN to use perl/python/bash/etc? To do easy-ish things, they can clearly all be used, but there is likely an ideology behind each that indicates WHEN/WHY to use them. For example, I use VB if I want easy GUI, c++ if I …

Member Avatar for leegeorg07
0
134
Member Avatar for max.yevs

so i was trying to make a very simple counter (although not sure if that's what you call it) [code]import time a = 0 def main(): time.sleep(5) b = a + 1 print (b) del(a) a = b del(b) main() main()[/code] i know this is very unefficient and there is …

Member Avatar for max.yevs
0
133
Member Avatar for khozamtho

how to compile and run a python file,and how to change a directory in Python25.what should i import first in order to run a python code.like import math and ......

Member Avatar for woooee
0
204

The End.