15,181 Topics
| |
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 … | |
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 | |
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 … | |
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 | |
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) … | |
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 … | |
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 … | |
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 | |
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 … | |
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) … | |
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 … | |
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 … | |
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"] … | |
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, … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 ...... | |
Hi everyone, I am trying to get PDF file output from the python program to give a print. is there any solution? please give me a valuable reply... | |
Hello everyone I have created [COLOR="Red"]Tkinter application on Mac OS X.[/COLOR] [COLOR="Green"]I need to take printout for the output of that program from that application only.[/COLOR] Kindly please give me a valuable response. Regards BHANU | |
Hi, there my code is below [ICODE] resultlines=[targetlines[0] % dResult['SEC'], targetlines[1] % line1b, targetlines[2] % (section_type,dResult['SEC'],mat_data), targetlines[3] % section_data, targetlines[4] % (math.sin(float(dResult['ANG'])*math.pi/180), math.cos(float(dResult['ANG'])*math.pi/180), 0)] for line9 in resultlines: line9=line9+"\n" binf.write(line9)[/ICODE] , which generated the format with empty lines below *beam section,section=I,elset=UC356X368X202,material=STEEL 0.1873,.3746,.3747,.3747,.027,.027,.0165 1.000000, 0.000000, 0.000000 *element,type=b31,elset=LCHS965-14-3 39,3490,1612 *beam section,section=PIPE,elset=LCHS965-14-3,material=S355 0.4825,.0143 … | |
Hi! I'm using IDLE. [CODE]Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> test = 1 >>> if test: print "ok" SyntaxError: invalid syntax (<pyshell#2>, line 2) >>> [/CODE] Does someone can help me? Thanks. | |
Hi, I've written a python cgi app that lists image files in a directory then when the user clicks on a link it converts the image to a .jpg and displays it in a simple html page. I'm using tempfile.NamedTemporaryFile to create a temp file that the converter can write … | |
Can the edit wizard be altered to allow more than 4 packs to be used? Now more of us use large screens more than four can be useful. | |
i made another extremely simple script, but i've looked through all the random python commands(10.6) and can't figure out how can i write a nonunique random script? as in all the random numbers can be the same? like random.sample? say i have a list [1,2,3,4] and i want to pick … | |
yet another quick question... I wrote this at the end of a script [code]y = 1 n = 0 i = input("Again? Y/N: ") if i is 0: print ("Good bye!") exit if i is 1: execfile ("program2.py")[/code] now of course if i is 0, they won't be able to … |
The End.