Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
60% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
~13.4K People Reached
Member Avatar for bharatk

I am trying to find the index position of the minimum element in a list and print the element at the corresponding index position in another list. For example: [CODE] ?- min2(X,Y,[a,b,c],[5,3,7]). X= b y= 3[/CODE] Code: [CODE] min2(A,B,[A|_],[B|_]). min2(A,B,[X|T1],[Y|T2]) :- smallest(W,[Y|T2]), % using a predicate to find the min …

Member Avatar for bharatk
0
2K
Member Avatar for bharatk

Hello I have 4 .py files along with __init__.py in a folder. I want to create a file which would act as a menu and load classes from the files in that folder. I have that file outside the folder. The contents of that file: [CODE]from files import * print …

Member Avatar for bharatk
0
219
Member Avatar for bharatk

I have 2 lists: a=[0,1,5,7] b=[2,10,6,3] I need to get this list : c=[(b[0]+a[0]),(b[0]+b[1]),(b[0]+b[1]+b[2]),(b[0]+b[1]+b[2]+b[3])] I tried doing this using a for loop: [CODE] c=[(b[0]+a[0])] for i in range(0,(len(b)-1)): for p in range(i+1,len(b)): if i==0: c.append((b[i]+b[p])) else: c.append((c[i]+b[p]))[/CODE] I am supposed to get [2,12,18,21] but I am getting [2, 12, 12, …

Member Avatar for bharatk
0
97
Member Avatar for bharatk

I have a form in which I can input text through text boxes. How do I make these data go into the db on clicking submit. this is the code of the form in the template. What do I give in form action? [CODE]<form method="post" action="[B]what do I put here??[/B]"> …

Member Avatar for Kruptein
0
159
Member Avatar for bharatk

Hello I have a rails application where I have to subtract 2 time stamps and display the result on the webpage I have used the following sql statement and I am getting the results. [CODE]select (julianday(resolutions.created_at)-julianday(tickets.created_at))*24 from tickets,resolutions[/CODE] the value of tickets.created_at is 2010-04-05 18:59:02 which is a time stamp …

Member Avatar for bharatk
0
201
Member Avatar for bharatk

Hello I am trying to use Visual Tkinter but it's giving an "Invalid procedure call" error each time I try to place something on the form and the program closes. Screenshot of what I'm getting: [url]http://i48.tinypic.com/10zy5br.jpg[/url] I'm not even able to add a simple button to the form & when …

Member Avatar for macroasm
0
282
Member Avatar for bharatk

I have function in my program calls a class which opens a new window [CODE]class TopLevel3: def __init__(self): self.root2 = Toplevel() self.canvas3 = Canvas(self.root2, width=400, height=200) self.canvas3.pack() self.root2.title("ImageDB") r = 0 for c in range(6): Label(relief=RIDGE, width=55).grid(row=r, column=0) Entry(relief=SUNKEN, width=20).grid(row=r, column=1) Button(text='View Image').grid(row=r, column=2) Button(text='Update Tag').grid(row=r, column=3) r = r+1 …

Member Avatar for bharatk
0
113
Member Avatar for Logi.

I'm having trouble combining tkinter windows/functions, i have simplified my problem down to this which i think seems to be the problem. Both these functions will work on their own, but not together. (at least the way i want them to!) What I am after is to be able to …

Member Avatar for bharatk
0
8K
Member Avatar for bharatk

Hello I'm making an GUI app to open a image and zoom it. This function is used to open the image & display it: [CODE] def file_open(self): filename =askopenfilename(filetypes=imageTypes) image1 = ImageTk.PhotoImage(Image.open(filename)) self.canvas.config(height=image1.height(), width=image1.width()) self.canvas.create_image(2, 2, image=image1, anchor=NW) self.image = image1 self.img_zoom(image1) # passing image1 to img_zoom function[/CODE] The image …

Member Avatar for bharatk
0
381
Member Avatar for bharatk

I have opened an image using the PhotoImage method of ImageTk How do I close the image. This is the scenario is I am using it in. I have 2 buttons, one each to open an image from disk & image from url. When I open either of them the …

Member Avatar for bharatk
0
1K
Member Avatar for bharatk

Hello I have a .py file. I am creating a .bat file which when clicked runs the python script & saves the output as a text file in the same directory. I gave this inside the batch file [CODE]%CD%\App1.py > %CD%\op.txt [/CODE] but I am not able to see the …

Member Avatar for bharatk
0
241
Member Avatar for bharatk

Hello I have generated a list of words & their occurrences. Now, how to I filter them based to the starting alphabet. I.e. all words starting with 'a' should be filtered from thos list & put into 1 list along with their occurrences, similarly b,c & d. This is the …

Member Avatar for woooee
0
141
Member Avatar for bharatk

Hello I have created a multidimensional list in python I used the following code: [CODE] r =[(300, 4), (5, 6), (100, 2)][/CODE] I tried sorting it in ascending order using r.sort() and I get [(5, 6), (100, 2), (300, 4)] I want it to get sorted based on each on …

Member Avatar for bharatk
0
96