15,185 Topics

Member Avatar for
Member Avatar for Blujacker

[code] from Tkinter import* okno=Tk() okno.title('Pomoc please') platno=Canvas() platno.pack() def volana_funkce(event): print event.widget oval1=platno.create_oval(10,20,30,40,fill='red',tags='klik') oval2=platno.create_oval(50,70,80,90,fill='blue',tags='klik') platno.tag_bind('klik','<1>',volana_funkce) mainloop() [/code] how to get a name of widget if click on them?e.g i klik on oval1 and function volana_funkce will return oval1.. thanks

Member Avatar for bumsfeld
0
297
Member Avatar for skanker

I want to use wxpython, but when I installed it python didn't recognise the module. I've looked everywhere for help but gotten nowhere so could someone help me out?

Member Avatar for vegaseat
0
144
Member Avatar for girish_sahani

I want to generate all size 2 strings from a list of size 1 string e.g featureList = ['a','b','c','d'] gives ['ab','ac' etc] I wrote this code [code] def genC(featureList): for i in range(0,len(featureList) - 1,1): for k in range(1,len(featureList) - 1,1): if i+k <= len(featureList)-1: colocn = featureList[i] + featureList[i+k] …

Member Avatar for girish_sahani
0
70
Member Avatar for rubiton

Can someone please write the script for connecting to MySQLdb Also if anyone knows a good tutorial form transfering info from a python module into a MySQL table. Thanks in advance.

Member Avatar for rubiton
0
167
Member Avatar for girish_sahani

I want to generate 'substrings' from a string as follows: for each substring j of string,generate the 2 lists [j,string - j] and [string -j,j] e.g If i have a string 'abc' i want to generate the list [['a','bc'],['bc','a'],['c':'ab'],['ab','c'],['b':ac],['ac':b]] Now i tried the following but its not giving me the …

Member Avatar for girish_sahani
0
206
Member Avatar for ber

Hi, I'm very new to programming and Python. I need to process two separate files, one containing words, the other frquencies of these words. What is the best way to process these files and obtain a new file with frequencies*words in there? Btw i'm afraid the files cannot be read …

Member Avatar for vegaseat
0
94
Member Avatar for flybob

I have developed software a long time, but am new to GUI. For the last 6 weeks, I have been developing a database in MySQL, with mysqldb and controlling it with wxPython GUI code developed in Boa Constructor. Now that I have stuff IN the database, and screens to view …

0
57
Member Avatar for Confucius

Ive looked many places but the answer to this question has eluded me, once a script is executed how can you make it so that it re-starts. Oh, and what is the meaning of life?:cheesy:

Member Avatar for Confucius
0
101
Member Avatar for Ene Uran

I read somewhere that you should avoid using a leading underline in a variable name. It is supposed to have a special meaning in Python. I can't find anything more detailed. Does anybody know?

Member Avatar for vegaseat
0
283
Member Avatar for Ene Uran

Does Python have a static variable like C has? I like to avoid a global variable for the usual reasons. Note: A static variable in a C function will retain its last value.

Member Avatar for vegaseat
0
145
Member Avatar for girish_sahani

I need to map one list onto another.l1 is a list of lists of lists and l2 is a list of numbers.I want elements of l1 to be the keys and elements of l2 as the values.I tried to convert l1 into a tuple and then mapping but it doesnt …

Member Avatar for girish_sahani
0
236
Member Avatar for Blujacker

I have an problem with Python, i am trying to create a game. I did mapeditor for this game. I create map by creating a lot of pictures, like 2000 or more. But if i want to create moore i get an RunTimeError:( [IMG]http://blujacker.wz.cz/omg!.PNG[/IMG]

Member Avatar for Blujacker
0
121
Member Avatar for girish_sahani

When i tried the following in python interpreter,i got a syntax error: [code] d = {[[['a': 1,'b': 2],['a': 4,'b': 3]][['a': 2,'c': 2],['a': 1,'c': 3]]] : 0.4} [/code] Pleeeez help :sad:

Member Avatar for bumsfeld
0
79
Member Avatar for gbs

I was trying to write a simple python script to enable web users to upload files. Here is html [code] <HTML> <HEAD></HEAD> <BODY> <FORM ACTION="[URL="http://some-server.com/test.cgi"]http://some-server.com/test.cgi[/URL]" METHOD="POST" enctype="multipart/form-data"> <INPUT TYPE="text" NAME="words" SIZE=30><br> <INPUT TYPE="file" NAME="infile" SIZE=30><br> <INPUT TYPE="submit" NAME="Submit" VALUE="Submit Form"> </FORM> </BODY> </HTML> [/code] Here is the python script [code] …

0
79
Member Avatar for ejai

I am working on an assignment that involves simulating a volley ball game and I have NO idea. Can anyone help. Here is the question Thanks

Member Avatar for ejai
0
110
Member Avatar for girish_sahani

If i have a list (or list of lists) with elements of size k and i want to generate all higher level elements (of size k + 1) from it,what should i do??Any pointers would be of a great help I tried the following for lists...for list of lists i …

Member Avatar for girish_sahani
0
207
Member Avatar for girish_sahani

this doesnt work when the file is in the same directory as the .py file. [code] def get_colocations(filename): sentences = open(filename).read().split("\n") colocations = [] for sent in sentences: colocations.append(sent) return colocations def main(): get_colocations("colocations.txt") print "Colocations are",colocations [/code] Can anyone help????????

Member Avatar for girish_sahani
0
125
Member Avatar for gbs

Hi, I am having the problem of running ps2pdf from a python script. From the command line, ps2pdf works just fine. However, when I tried the following code: os.chdir("/tmp/test") # file.ps resides in this dir os.system("ps2pdf file.ps file.pdf") The script generated an empty file.pdf with no pages. Does anyone know …

Member Avatar for G-Do
0
2K
Member Avatar for madloch

Hi All I'm new to Python and have created the below little program but would like to be able to print the loop final count (eg. 8 years) rather than every loop. Any hints on how to do this? def main(): print "This program calculates how long it takes for …

Member Avatar for madloch
0
3K
Member Avatar for NumNut

Hello, I am using fedora 5 and installed wxpython in an effort to program in python/wxpython (installed wxPython-2.6.3.2-1.fc5.i386.rpm, wxGTK-2.6.3-2.6.3.2.1.fc5.i386.rpm and wxGTK-gl-2.6.3-2.6.3.2.1.fc5.i386.rpm). When I run my test script to create a frame, a notebook and an image on one of the pages of the notebook, I get a GDK error when …

Member Avatar for NumNut
0
217
Member Avatar for Ene Uran
Member Avatar for bumsfeld
0
5K
Member Avatar for rajashreeshinde

Hello All, I am developing a GUI application in wxPython on linux. I have to provide help menu describing tool's usage. I am not able to get any modules realated to this.Can anybody know how to develope help in wxPython? Thx, rajashree

Member Avatar for rajashreeshinde
0
375
Member Avatar for watrygl

Help, please, I need to configure IIS to use python I have tried the the microsoft link [URL="http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B276494"]http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B276494[/URL] and the netfirms [URL="http://urbanware.netfirms.com/python/pythonIIS.html"]http://urbanware.netfirms.com/python/pythonIIS.html[/URL]. I am running IIS6 on Windows serfver 2003 The site is [URL="http://gw102.coaps.fsu/httpdocs/example.php"]http://gw102.coaps.fsu/httpdocs/example.php[/URL] any help or thoughts

0
63
Member Avatar for whoru

I need to make a high scores list to a game, for class, and it has to be stored using a pickled object. I can only get it to where it stores and prints one score, and then every time you play it the score gets overwritten. How can I …

Member Avatar for G-Do
0
247
Member Avatar for Ene Uran

What is the best way to establish a wxPython event handler for a mouse click, button and so on? I have looked at a number of sample codes and the event handlers differ all over the place.

Member Avatar for Ene Uran
0
367
Member Avatar for EriCartman13

Ok I am confused. I just started python and when I save my program that I edited in the IDE editor as for example helloworld.py I cannot run it when I click it. All it does it come up with a black box, like cmd, and dissappears. Also do you …

Member Avatar for EriCartman13
0
204
Member Avatar for Confucius

Im sort of new to python, and I have been looking at some tutorials, manuals, etc. and I saw how to find prime numbers, so I thought it would be a good place to start, so I added some stuff to hopefully allow for user input, and it doesnt work. …

Member Avatar for Ene Uran
0
307
Member Avatar for swapnamishra

How can we execute the commands on one file in a such a way that the results will get saved in another file? Do we have any such built in method which we can use?

Member Avatar for pythonguy
0
119
Member Avatar for pythonguy

I am using automnation desk to run my python scripts. It supports interpreter ver 2.2 I have some script common for almost all other script files of my application. this common script is saved as CommonCalls.py and is on python search path. I am using some ref. to a file …

Member Avatar for pythonguy
0
136
Member Avatar for Avner .H.

hello everybody, I've started to learn pyGTK and glade for a program i'm doing, and i've run into some problems: 1. Is there no way to change the size of a specific text when using glade? for example, a window title, a label text etc. 2. In the Gnome widgets, …

Member Avatar for JoeM
0
178

The End.