15,190 Topics
![]() | |
Hi, Im trying to write an irc client with python. This is its login page(i hope it will be) [CODE] #!usr/bin/env python # -*- coding: utf8 -*- import gtk, sys, socket class PyApp(gtk.Window): def con(self): iserver = self.entry.get_text() inick = self.entry2.get_text() room = self.entry3.get_text() password = self.entry4.get_text() socket.server = iserver … | |
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. … | |
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 … | |
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 + … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … |
The End.