Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~11.9K People Reached
Member Avatar for Hawkeye Python

Hi! The following Tkinter buttons should call [I]opt_def[/I] with [I]opt[/I] as 1 or 2 depending on which button is pressed (see code). [CODE]from Tkinter import * class App: def __init__(self, master): frame = Frame(master) frame.pack() self.opt1 = Button(frame, text="Opt1", command=self.opt_def(1)) self.opt1.pack(side=TOP) self.opt2 = Button(frame, text="Opt2", command=self.opt_def(2)) self.opt2.pack(side=BOTTOM) def opt_def(self, opt): …

Member Avatar for Hawkeye Python
0
3K
Member Avatar for Hawkeye Python

Hello! I've made a drop-down menu using the hover sub-class in CSS: [CODE].ddmenu{ display:none; } .box:hover .ddmenu{ padding:0px; display:block; }[/CODE] Is it possible to make the "ddmenu" object appear when the user clicks on the object with the "box" class instead of when he hovers the mouse over it using …

Member Avatar for shaya4207
0
127
Member Avatar for Hawkeye Python

Hi! I don't know much about Java and I'm new to JQuery. I want to replace "+ Table" for "- Table" when the user clicks on it. For that I've used: [CODE]$(document).ready(function () { $('#table1_head').click(function () { $('#button1 a').replaceWith('- Table1'); }); });[/CODE] It worked. But I want to replace "- …

Member Avatar for Hawkeye Python
0
190
Member Avatar for Hawkeye Python

Hi! I'm starting HTML/CSS and I'm having this problem with positioning of elements... I've used this to position a text: HTML [CODE]<center> (...) <p id="txt_principal">lorem ipsum (...)</p> (...) </center>[/CODE] CSS [CODE]#txt_principal{ font: italic normal 14px Verdana, sans-serif; color: #DDD; text-align:justify; position:absolute; margin-top: 25px; margin-left: 205px; margin-right: 400px; }[/CODE] But whenever …

Member Avatar for Arkinder
0
200
Member Avatar for Hawkeye Python

Hi! I've just started with HTML and I'm creating my first page. Really simple. How can I print a tag? I mean, I'm trying to do this: [CODE]<p id="test">This is a test using the <p> tag</p>[/CODE] But it doesn't print the "<p>" in "using the <p> tag"...

Member Avatar for jalarie
0
86
Member Avatar for Hawkeye Python

Hello :) I'm from Brazil, so sorry about my english. This is the first code I post here - I'm a begginer in Python. It is a function to calculate determinants of matrices. You can attach it to a class if you wish. Please leave a comment if you wish …

Member Avatar for Gribouillis
0
3K
Member Avatar for Hawkeye Python

Hi! I'm new at python and I don't get the while statement. I'm trying to make a simple function that returns each term of a geometric progression 'til 'n'. [CODE]def gp(a1,r,n): while not n == 0: n = n - 1 an = a1 * (r ** n) return an[/CODE] …

Member Avatar for Hawkeye Python
0
146
Member Avatar for Hawkeye Python

When realising the following operation: [CODE]do = 1.0 - 2.718281828**(-(23**2)/730) print do[/CODE] Python returns 0.632120558766 When you do it on the calculator or when google it, it returns 0.515509538 :-O

Member Avatar for vegaseat
0
255
Member Avatar for musicalsailor

Can anyone give me an example of a DOS BAT file (script) that could FTP a file (variable)? I've got the Linux problem solved, but I need to do it in a DOS environment. Thanks, John

Member Avatar for Hawkeye Python
0
141
Member Avatar for Hawkeye Python

Is this possible with pyhton? If it is, how can you do it? [CODE]def raise(): raise = raw_input('Do you really want to raise? y/n') if raise == 'y': bet = bet+1 return # Should RETURN to play(), after raise() # Like "goto LABEL" else: return def play(): bet = 1 …

Member Avatar for lllllIllIlllI
0
82
Member Avatar for rudasi

Hi, Im trying to make a batch script which can go through a directory and pick all the .txt files and copy the name in a file. Ive been able to make a script which can do this in a particular folder but if there is a folder in the …

Member Avatar for rudasi
0
110
Member Avatar for Hawkeye Python

I'm trying to create a python cards game (a Brazilian cards game). But when I try to print some values (the cards played) it returns the following error: [QUOTE]Traceback (most recent call last): File "<pyshell#16>", line 1, in <module> play() File "C:\Documents and Settings\Terminal\Desktop\Truco.py", line 71, in play print "You …

Member Avatar for Hawkeye Python
0
230
Member Avatar for Hawkeye Python

I've read the documentation, but I still can't creat my own packages. How should the __init__.py look like? Cause i've tried to let it blank and some stuff like [CODE] my_package/ __init.py__ sub_pack/ __init.py__ test.py [/CODE] but it pointed syntax error If I don't write anything on it, no error …

Member Avatar for Ene Uran
0
93
Member Avatar for sri1230

Hello guys - Need help with a windows batch script that would kill processes by the memory usage but leave the last one. For example if i have 10 java.exe processes running i want to kill the top 9 by memory usage and leave the last one alone. Help appreciated! …

Member Avatar for Hawkeye Python
0
104
Member Avatar for Hawkeye Python

I'm new at Python coding and in DaniWeb. Really nice forum :icon_cheesygrin: Need some help w/ the following code: the content of saldo.txt is the following [CODE]1000[/CODE] The code I was talkin' about: [CODE] # [...] f = open('C:/saldo.txt') print f saldo = f.readline() f.close() if saldo <= 100: a …

Member Avatar for snippsat
0
117
Member Avatar for Hawkeye Python

Incomplete dice game function, dunno why does'nt works... If you're not using windows, change the dir. "C:/" [CODE] def bet(Bet): try: f = open('C:/money.txt') print f money = f.readline() f.close() print ('You have', money, 'Dollars. Wanna play dice(y/n)?') v = raw_input() if v == 'y': # here i'm printing those …

Member Avatar for The_Kernel
0
170
Member Avatar for Hawkeye Python

Well, I'm a begginer in Python coding, and at DaniWeb. My problem is: I can't open any files! I tried: [CODE] >>> f = open('C:\teste.txt', 'w') Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> f = open('C:\teste.txt', 'w') IOError: [Errno 22] invalid mode ('w') or filename: 'C:\teste.txt'[/CODE] …

Member Avatar for Hawkeye Python
0
4K