15,175 Topics
| |
I need help creating a python function that makes concentric circles. I already have a function that makes a circle(from the Python Programming book), so I thought I'd use a for loop; however, I'm not sure how. Here's what I have so far: (where 'number' is the number of circles, … | |
I'm trying to make quiz GUI. The GUI has one button and an entry box. The user presses the button and it asks a random question from using the world database. After 10 questions, it tells you the number correct and incorrect. I'm having a lot of trouble with the … | |
Hi I want to compile py files to com files. Please help me. thanks. | |
Im trying to make a bac calculator and make a gui for it but am having issues with the math code for it. Here's my code. Everything I input returns 0. The BAC forumula is (150/body weight)(% alcohol/50)(ounces consumed)(0.025). Btw, I suck at math so it could be a math … | |
hi, I am working on a text proccessing project, actually related to protein sequences. I want to list occurrences of a search term with the hit positions. I tried the following, but it only gives it for the first hit. [CODE] text = 'MSKSASPKEPEQLRKLFIGGLSFETTDESLRSAHFESSSYGSAGRRF' index = text.find('SA') print index [/CODE] … | |
I am using scipy distribution scipy-0.4.9.win32-py2.4.exe with python 2.4 on Windows XP. When I try to import scipy I get the following error. [code] Traceback (most recent call last): File "<pyshell#4>", line 1, in ? from scipy import * File "D:\Python24\lib\site-packages\scipy\__init__.py", line 33, in ? del lib NameError: name 'lib' … | |
Here is some saved interaction in command prompt. [CODE]>>> type((1,2)) <type 'tuple'> >>> (3*x for x in (4,4)) <generator object <genexpr> at 0x00E73EB8> >>> tuple(x**2 for x in range(10)) (0, 1, 4, 9, 16, 25, 36, 49, 64, 81) >>> set(x for x in range(10)) set([0, 1, 2, 3, 4, … | |
I'm working on an addon system for one of my projects. I'm able to add a new menu item, but the self.Bind(...) is causing me troubles instead of bind the function to the menu-item, it just calls the function. and doesn't bind at all... :s [code=python]self.ID_OPEN=wx.NewId() wxglade_tmp_menu.Append(self.ID_OPEN, eval(menucontent)[i][0], "", eval("wx.ITEM_"+eval(menucontent)[i][1])) … | |
Attached are a C file, a .i file, and a Makefile that I thought could produce a Python-loadable binary. Also, I included a text file with the output I got showing the failure. It looks like I didn't include something vital but I don't know what. Can anyone help me … | |
Hi guys, I am a complete newbie (but learning slowly). I am trying to make a script to check for proxies that are contained in a file using a regex. Fact is that I lack of knowledge and I do not know how to make it go. This is my … | |
I have created an owl ontology using protege.Is dere any way to query the owl ontology n give the results to python code?? | |
I do have a problem with my connect four code ; it doesn't check whether there is a winner even though the function its okay :-/ Can anyone help me to solve my problem ??? [CODE=python] import random board = dict() rows,columns = 4,4 def game(): choose_player() #MAKE BOARD FUNCTION … | |
Hi, Does anyone have an example of code in wxpython that moves a sprite across an image background? Or can point me to an url that shows an example? Thanks | |
This problem came up in one thread and here is my finalised version to follow changes of files in list of paths given. | |
I'm working on an add-on system, which is till now going pretty good. no I need to assign an id to a menu item, but I don't know which are all in use (by other addons f.e.) so is there a way to either: -get a random integer that isn't … | |
Hi, This is my first post here, since I am new to Python. I've been messing around a bit with it and I think I have the basics in my fingers now. I've run into a problem with the HTMLParser: I want to use it to collect the url's contained … | |
Hello there, I am working on pylon frame work, when i am issuing return render('/test.mako'), it is displaying index out of renge error. Plz Reply to this post if u have any idea in this. Thanks ss | |
Hi i need someone to help me at least to give me an idea of how start thos assigment, is my first time taking a python class and is so advance for 1 month. I have to create a board game connect 4 with this instructions: The rules are as … | |
Hi guys! I have a problem calling the numpy.random.hypergeometric function with certain values. It seems like if the values hit in some certain range the program stalls and never finishes. I get no errors or anything and also a wxpython GUI that i have calling this function crashes with no … | |
Hi, i want to write a program that will automate my backup on a windows using python but i have no idea how to get started. can someone please point me to the right direction. thanks in advance | |
I need to monitor a number of folders over a period of time. so i pass the files in each folder to a list of list. [CODE] import os path_to_watch = [] path_to_watch.append("/path1/") path_to_watch.append("/path2/") path_to_watch.append("/path3/") before = [],[] for item, folder in enumerate(path_to_watch): print "i am here", item, " : … | |
Is there any problem with manipulating very long strings? When I say long, I'm meaning like over 100,000 characters long. I'm using examplelongString = data.readline() to get it from an html file. I then use examplelongString .find('text to find') to search for stuff. I've been trying to do it, it … | |
Hello, im currently working on a program and im trying to create a cascade, This cascade code works by itself but i want to implement def hello and def toggle into def __init__(self, master=None), at the moment im getting and error "UnboundLocalError: local variable 'submenu' referenced before assignment" does anyone … | |
I am trying to show a diff in two files from a daily script. i am unable to get it to read the files correctly and show what is different. example of the files is - <ad_xml> <group name="group1"> </group> <group name="group2"> <user> <name>user1</name> </user> <user> <name>user2</name> </user> <user> <name>user3</name> … | |
I had a question...Im using TKinter in python trying to build a GUI to run some command prompt scripts others have made. I am having some trouble though...pretty early on... I can open a file and get the file name, but I can not even pass the file name to … | |
The SetValue() and GetValue() are to complicated, but it should work with WriteText()... although this always prints a newline if I press the space button...? [code=python] def OnKeyDown(self, event): insp=self.text_ctrl_1.GetInsertionPoint() words=self.text_ctrl_1.GetValue().split(" ") #get all the words hl=[["in","red"]] #syntax list All words=in should become red prev="" #previous words processed wordcount=0 for … | |
Hi , I am trying to show members of groups in Active Directory and then enter them into XML format but am having problems getting it to work. I am new to all this stuff but have to get this to work fairly quick. Can someone advise please. [CODE]""" Script … | |
Hello all, just making a quick check to see if anyone can help me fix my code. I need to show the result in an entry screen... [CODE]# Tkinter class template to test apps try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk class … | |
Hi frnds, I am a newbie to python ( I am learning it for 1 month now on win platform) .I came across these cool functions of python like os.path.isdir("\\\\blah\\") but since "blah" is password protected I am always getting false as return!!!! Can anyone please tell me how to … | |
Is there any way to access a specific Window/Frame? [CODE]#!/usr/bin/python # communicate.py import wx class LeftPanel(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id, style=wx.BORDER_SUNKEN) self.count = 0 button1 = wx.Button(self, -1, "new frame", (-1, -1)) self.Bind(wx.EVT_BUTTON, self.OnNewFrame, id=button1.GetId()) def OnNewFrame(self,event): StockFrame(self,-1,'window %s' %self.count) self.count = self.count + 1 class StockFrame(wx.Frame): … |
The End.