473,574 Members | 2,474 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error using tkinter

Hi,

I am making a gui, in which specifiction are taken from user, which are
wriiten to a file. and that file will bw executed.

finalstr is a string

f = open('crossManu al.sh','w')
f.write(finalst r)
f.close()

I am getting the error

Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in __call__
return self.func(*args )
File "gui.py", line 248, in writescript
f = open('crossManu al.sh','w')
TypeError: an integer is required

Couldn't understand what it means
Plz tell me how to correct it.

Thanx in advance

Apr 18 '06 #1
2 1466
"JyotiC" wrote:
I am getting the error

Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in __call__
return self.func(*args )
File "gui.py", line 248, in writescript
f = open('crossManu al.sh','w')
TypeError: an integer is required

Couldn't understand what it means


let me guess: gui.py contains the line "from os import *" ?

this means that "open" refers to os.open, which is not the same thing as the
built-in open function.

the solution? use "import os", and add "os." in front of all functions from
that module. never use from-import in application code, unless you have
very good reasons:

http://effbot.org/zone/import-confus...y-should-i-use

</F>

Apr 18 '06 #2
Thanx a lot, that was the problem

Apr 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1205
by: anuradha.k.r | last post by:
hi, I have a problem with installing tkinter*.rpm file.I am using a redhat linux 8.0 machine.I have python2.2 available in my machine,however tkinter is not present.(i guess it was not checked during pyton installation)I checked up the net and found one of these rpm files which seems can be installed "tkinter-2.2.1-17.i386.rpm". I tried rpm...
2
1360
by: Markus Franke | last post by:
Hi, i have a problem using Tk with python. Here is a simple script: import Tkinter root=Tkinter.Tk() button=Tkinter.Button(root,text="Click") button.pack() I can see a Window with a Button in it. But the problem now
5
10887
by: Otto Krüse | last post by:
Hi everyone, I'm building a GUI in which I want, amongst other things, for people to fill in there postal code. The postal codes of my country (Holland) are in this format: 1234 AB So for the input I use two entry widgets, one of a length of (characters) for the numbers and one of lenght 2 for the letters. What I don't like is that...
5
3548
by: Ben Kovitz | last post by:
Hi, I just tried to run Tkinter on OS X 10.3.9 under Python 2.4.3, and I'm getting a bus error as soon as I call Tk(). Googling has turned up info other Tkinter bus errors, but not this one that occurs right away, before doing anything fancy. Tk/Tcl is definitely installed on my computer, as verified by running "wish" and seeing the window...
2
2094
by: BartlebyScrivener | last post by:
Finally started trying to build a simple gui form for inserting text data into a mysql db of quotations. I found this nice Tkinter tutorial, http://www.ibiblio.org/obp/py4fun/gui/tkPhone.html but midway I'm getting an error. from Tkinter import *
1
2430
by: alivip | last post by:
I integrat program to be GUI using Tkinter I try browser direction as you can see # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, # ctrl+v to paste, and ctrl+/ to select all # count words in a text and show the first ten items
0
1250
by: Guilherme Polo | last post by:
2008/5/10 Kenneth McDonald <kenneth.m.mcdonald@sbcglobal.net>: I will say no to the first question. Now about the second question.. there are these links you may find interesting: "An Introduction to Tkinter" -- http://www.pythonware.com/library/tkinter/introduction/index.htm "Tkinter reference: a GUI for Python" --...
3
211
by: Anish Chapagain | last post by:
from Tkinter import * root=Tk() f=Frame(root,height=200,width=200) b=Button(f,text="quit",command=f.quit) f.pack() root.mainloop() -------------------------------------------------- from Tkinter import * import sys
3
3907
by: J-Burns | last post by:
Hello. Im a bit new to using Tkinter and im not a real pro in programming itself... :P. Need some help here. Problem 1: How do I make something appear on 2 separate windows using Tkinter? By this I mean that the format would be something like this: You have Page1 : This has 2-3 buttons on it. Clicking on each button opens up a new...
0
7710
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8040
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8092
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6437
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3745
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2230
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1051
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.