15,190 Topics
![]() | |
While doing a project i decided to do a mechanism in a panal of its own class, so i could manage the sizers and layout better, then i wanted to take the end result of that panel and display it in my window. Although when i run this code as … | |
How do I convert the integer -2 to its hex 0xfe??? I tried hex() but it gives me -0x2 | |
I have various list being generated by a mapper function in this format >>> mapper("b.txt" , i["b.txt"]) [('thats', 1), ('one', 1), ('small', 1), ('step', 1), ('for', 1), ('a', 1), ('man', 1), ('one', 1), ('giant', 1), ('leap', 1), ('for', 1), ('mankind', 1)] >>> mapper("c.txt" , i["b.txt"]) [('thats', 1), ('one', 1), ('small', … | |
Hi Friends, I want to parse a header file and auto generate a .cpp file. Can any one please suggest me good link in doing so or provide me a sample python script which will automatically generate a .cpp file. I planning to using VC++ pre-build event to call this … | |
I'M learning python and I can write very small simple programs with Tkinter or play sound through pygame. I've just started the book "Beginning Game Development with Python and Pygame". I'M in the earlier part of the book and I've just been given the program below. The thing is, even … | |
numpy.vectorize takes a function f:a->b and turns it into g:a[]->b[]. This works fine when a and b are scalars, but I can't think of a reason why it wouldn't work with b as an ndarray or list. For example: [CODE=python] import numpy as np def f(x): return np.array([1,1,1,1,1], dtype=np.float32) * … | |
hello, i created an executable from a python project, with py2exe & cx_Freeze for testing, and both versions work fine on my Windows OS, but none work on other PCs (Win32), when i start the executable it says : 'The application has failed to start because the application configuration is … | |
Hello, im starting a new project, about the game who wants to be a millionaire, so In the beggining I have a Start Button, but I want to know how to set the parameters of the mouse click to be only within the range of the START button. heres what … | |
Hello, I'm sure there is a simple solution to this but I cannot seem to find the information I need in my textbook or online. I'm creating a GUI with an entry box for the user to input their name. I then use getText() to retrieve the name they entered … | |
Hello there, i have this problem when i try to combine a variable file name that is in languages other than English with a path, like this : path = 'C:\\Files\' path+=UnicodeName+'.txt' it gives the following error : UnicodeDecodeError: 'ascii' codec can't decode byte 0xda in position 7: ordinal not … | |
Hello everybody! I have to go through each subfolder and extract matching strings from each of the files (File_1, File_2, File_3, File_4, etc.). Unfortunately, I don't know how to do that under Linux. I have the following structure: MainFolder: ---Subfolder A ------File_1 ------File_2 ------File_3 ---Subfolder B ------File_4 ------File_5 ------File_6 ---Etc. … | |
[ICODE]class classA: #saved as classA.py def __init__(self): print "class A" printB() def printB(): print "B"[/ICODE] [ICODE]>>> classA() class A Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> classA() File "C:\Documents and Settings\Owner\Desktop\timetable\classA.py", line 5, in __init__ printB() NameError: global name 'printB' is not defined[/ICODE] Using the class … | |
Hi, I've been trying to make a poker game, i got the basic things running like giving the cards to the player and dealer, but i am having trouble coming up with a way to compare the 2 hands... I'm new to python, i tried different ways and didn't really … | |
Hello, I could use a spot of help today. I am very new to python (n00b) and I have a rather specific Issue I am trying to resolve. This problem can be solved using ArcGIS (for those who know it) I simply desire to know more about python so I … | |
Is there way to get the graphics card details in python. please help me in achieving this | |
I am trying to solve the problem Present at [url]http://www.codechef.com/problems/INTEST/[/url] I have made a small Python script to do my job :- [CODE]array = [] no_lines = 0 no = 0 j=0 div_no=0 no_lines = input() no = input() temp = no_lines while(no_lines>0) : i=0 i = input() array[j] = … | |
help! dunno how to convert this in python.. 'contains == ???' in python [CODE]if (basket contains "fruits") then try tell application "Document" to tell application "System Events" to tell application process "Document" to click button "Cancel" of sheet 1 of window "Untitled" tell application "Document" to quit saving no end … | |
[CODE]from Tkinter import * class ButtonHandler: def __init__(self): self.root = Tk() self.root.geometry('600x500+200+200') self.label = Label(self.root, text=str(self.mousedown)) self.can = Canvas(self.root, width='500', height='400', bg='white') self.can.bind("<Motion>",lambda x:self.handler(x,'motion')) self.can.bind("<Button-1>",lambda x:self.handler(x,'press')) self.can.bind("<ButtonRelease-1>",lambda x:self.handler(x,'release')) self.label.pack() self.can.pack() self.root.mainloop() def mouseDown(self, event ): return 1 def handler(self,event,x): if x == 'press': self.mousedown = 1 elif x == 'release': … | |
I am pretty new to the Jython world, I have a need to create the jvm custom properties but i am king on struck at array. please provide expertise suggestion.. Here is my code snippet : ### JVM CUSTOM PROPERTIES SCRIPT ### fileOpen = open("/tmp/jvmname.props", "r") fileRead = fileOpen.read() server … | |
Hi, I can send commands to my TRENDnet TV-IP410 camera using wget as follows: [CODE] wget --user=user --password=password http://192.168.1.140/cgi/admin/ptctrl.cgi?action=move\&Cmd=down [/CODE] This would send the "down" command to tilt the camera. There are also "left", "right", etc. commands What is the best way to do this in python? I could use … | |
Hello everyone, I am getting ImportError when I tried to do pure embedding and call Python function from C. The Python code is named dummy.py given by: [CODE=python] def multiply(x, y): print x, y z = x * y return z; [/CODE] It is called by the c program "calldummy.c" … | |
Hello all, I'm taking a programming course in python and I have to write a program using certain math functions like pow() and sqrt() and I don't know what to program. Please give me some ideas on programs. I don't need to know how to program them, just what to … | |
Hello all, I have python 2.6 installed, i can see it in /usr/bin and I can run it in terminal. I cannot however seem to figure out how to open the Idle, or get the program to show in the redhat drop menu. Kinda new to linux (some ubuntu use, … | |
I'm looking to write a program that should be capable of holding around 1000 records, each record will contain a varying number of fields and values. Usually, I'd create a list of dictionaries for something like this but wanted to know if that's the right way to go about it. … | |
I want to display out text in my panel inside a for loop,but when i use wx.StaticText. It will overwrite the previous sentence. How can i solve this problem??? [CODE]for item in ErrorStorage: print item wx.StaticText(self.p1, -1, item)[/CODE] | |
Hi! I designed a class in Python to do stuffs related to genetic algorithms. I have a method in this class, which should provide a sort of log to keep the track of the populations during the evolution. I mean, I provide the filename as a string argument to this … | |
Hi, id like to set values for a botton is wxpython by taking that value from a text file. For this code [CODE]button = wx.Button(parent, label = “x”)[/CODE] and for example on the 1st line of the text file id like to read x. Ive played about with this a … | |
I need help counting the number of times a particular number is used in a text file... and to output a number of results to a text file... eg: [B](input.txt):[/B] 01 40 39 01 72 39 36 56 72 82 39 ### 56 62 38 03 03 06 38 30 … | |
So I was thinking that there would be a simple Pythonic way to delete a directory structure. My app creates and deletes user accounts, which may contain any number of subdirectories and files. Hence, I wanted to do something like: [code] os.rmdir(user_directory) [/code] BUT...that throws an error when user_directory is … | |
I have a Python command line program I am attempting to convert into a GUI. Before I bury myself in code does anyone have some advice on this process? Is there a method to simply make everything in the CLI program show up in a tkinter frame? For inputs I … |
The End.