I have v2.5.2 installed and i've composed
a source code i'm sure everybody will be
impressed by. It goes like this.
def bloppA ():
print "a very advanced piece of code"
What i get to work is to make it run from
the the snakes shell. Then, i realised
that such a masterpiece needs storing in
>> I have v2.5.2 installed and i've composed
>> a source code i'm sure everybody will be
>> impressed by. It goes like this.
>>
>> def bloppA ():
>> print "a very advanced piece of code"
>>
>> What i get to work is to make it run from
>> the the snakes shell. Then, i realised
>> that such a mas
>> def bloppA ():
>> print "a very advanced piece of code"
>
> go to File -> Open, open your saved file,
> and use the Run menu (or press F5).
When i try that i get this.
>>> == RESTART ===
>>>
And nothing more. Do i use wrong "print"?!
--
Regards
Konrad Viltersten
>> There will be poking around with %PATH%, i can
>> tell. Never liked to do that under Windows.
>
> No need to do that... Create an "alias.txt" file containing:
> python=c:\path\to\your\python.exe $*
> Execute (once, logged as administrator):
> reg add "HKLM\SOFTWARE\Microsoft\Command Processor"
def bloppA ():
print "a very advanced piece of code"
>>>
>>> go to File -> Open, open your saved file,
>>> and use the Run menu (or press F5).
>>
>> When i try that i get this.
>>
> == RESTART ===
>
>>
>> And nothing more. Do i use wrong "print"?!
>
> You *defined* a
I'm reading the docs and at 5.2 the del
statement is discussed. At first, i thought
i've found a typo but as i tried that
myself, it turns it actually does work so.
a = ["alpha", "beta", "gamma"]
del a[2:2]
a
Now, i expected the result to be that the
"beta" element has been removed. Obviou
>> I'm reading the docs and at 5.2 the del
>> statement is discussed. At first, i thought
>> i've found a typo but as i tried that
>> myself, it turns it actually does work so.
>>
>> a = ["alpha", "beta", "gamma"]
>> del a[2:2]
>> a
>>
>> Now, i expected the result to be that the
>> "beta"
I'm certain there is an API for creating
GUI's but as far i can find it in the
http://docs.python.org/tut/tut.html
the only "gui" is in "Guido".
What do i miss?
--
Regards
Konrad Viltersten
sleep- a substitute for coffee for the poor
ambition - lack of sense t
>>I'm reading the docs and at 5.2 the del
>>statement is discussed. At first, i thought
>>i've found a typo but as i tried that
>>myself, it turns it actually does work so.
>>
>> a = ["alpha", "beta", "gamma"]
>> del a[2:2]
>> a
>>
>>Now, i expected the result to be that the
>>"beta" element ha
>>import tkininter
>>
> When that fails, try without the stutter
>
> import tkinter
I must be doing something wrong because
neither tkinter nor tkininter works.
I tried both with and without stuttering.
I even asked my wife to stutter some but,
sadly, to no avail.
When Tim Chase mentioned
>> When that fails, try without the stutter
>>
>> import tkinter
>
> I must be doing something wrong because
> neither tkinter nor tkininter works.
> I tried both with and without stuttering.
> I even asked my wife to stutter some but,
> sadly, to no avail.
>
> When Tim Chase mentioned "battery
I've proudly connected Notepad++ to edit
and run my fantastic software. When that
started to work, i noticed that all the
printing disappears as the console window
vanishes upon the program completion.
How can i trick Python program to keep on
running even if the actual statements
have been exect
>> You should also take a look at wxGlade:
>>
>> http://wxglade.sourceforge.net/
>>
>> which sits on top of wxPython:
>>
>> http://wxpython.org/
>>
>> which wraps wxWidgets:
>>
>> http://www.wxwindows.org/
>
> I have used wxGlade, and while it worked well
> enough, it didn't see
> You may use python in interactive mode:
>
> $ python -i yourScript.py
>
> Or use a blocking readline:
>
> $ cat yourScript.py
> import sys
> sys.stdin.readline()
Thanks guys!
--
Regards
Konrad Viltersten
sleep- a substitute for coffee for the poor
ambiti
I'm writing a class for rational numbers
and besides the most obvious constructor
def __init__ (self, nomin, denom):
i also wish to have two supporting ones
def __init__ (self, integ):
self.__init__ (integ, 1)
def __init__ (self):
self.__init__ (0, 1)
but for some reason (not know
"Carl Banks" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> On Mar 3, 4:17 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
>> Since Python doesn't support having two methods with the same name,
>> the usual solution is to provide alternative constructors using
>> classmethod():
"Diez B. Roggisch" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
>K Viltersten schrieb:
>> I'm writing a class for rational numbers
>> and besides the most obvious constructor
>>
>> def __init__ (self, nomin, denom):
>>
> What does "SV" in the subject mean?
Probably, it's an abbreviation of
"svar", which means "reply".
--
Regards
Konrad Viltersten
sleep- a substitute for coffee for the poor
ambition - lack of sense to be lazy
--
http://mail.python.org/mailman/listinfo/pyt
I entered the code from tkinter.pdf, section
2 but for reason, the application doesn't
close as i press the quit-button.
The wondow itself vanishes if i click the
cross in the upper-right corner but pressing
the quit-button only makes it "pressed".
Then, the program freezes.
This is the code.
>> The window itself vanishes if i click the
>> cross in the upper-right corner but pressing
>> the quit-button only makes it "pressed".
>> Then, the program freezes.
>
> How did you run it? From inside IDLE? IDLE itself is written
> using Tk, and I think that your mainloop interferes with the
I've been recommended reading of:
http://www.python.org/dev/peps/pep-0008/
and in there i saw two things that i
need to get elaborated.
1. When writing English, Strunk and
White apply.
Where can i download it? Am i actually
expected to read the whole book? How
many people actually do aply it?
>> 2. You should use two spaces after a
>> sentence-ending period.
>>
>> For heavens sake, why? I've always been
>> obstructed by the double blanks but
>> tolerated them. Now, that i read that
>> it actually is a recommendation, i need
>> to ask about the purpose.
>
> (a) It makes the ends of
>> Personally, I dislike double spaces after
>> sentences, but it is not wrong to put them
>> there any more than it is wrong not to put
>> them there.
>
> You're lucky my high school typing teacher
> didn't hear you say that...
I'm unclear if your teacher was a double or
single spacer. It's
I'm disliking the size of my frame and
also i'm disappointed regarding it's
location. So, i wish to change them.
At this link
http://infohost.nmt.edu/tcc/help/pubs/tkinter/frame.html
the frame object is discussed but as
far i can tell, there are only
suggestions regarding what to put in
the cons
> What I really can't stand are the
> pointy-haired comment blocks at the
> beginnings of C/C++ functions that do
> things like tell you the name and return
> type of the function and list the names
> and types of the parameters. Gee, thanks.
> I never could have figured that out from
> looki
Do i need to set a callback to a canvas
in order to "listen" to the root window
being resized in order to make it adjust
its contents?
If so, how? If not, how do i make the
canvas draw a line from one corner to
an other?
from Tkinter import *
class Demo(Frame):
def __init__(self, master =
> If you can't/don't look at the source file,
> then comments aren't going to help (except
> in the case of something like docstrings in
> Python).
I strongly disagree. Now, perhaps we're
talking about different things, here?
Usually, in the header file (C++), there
won't be any source code, e
"Gabriel Genellina" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> En Fri, 07 Mar 2008 13:56:45 -0200, K Viltersten <[EMAIL PROTECTED]>
> escribi�:
>
>>>> The window itself vanishes if i click the
>>>> cross in the upper-ri
>>> If you can't/don't look at the source file,
>>> then comments aren't going to help (except
>>> in the case of something like docstrings in
>>> Python).
>>
>> I strongly disagree. Now, perhaps we're
>> talking about different things, here?
>> Usually, in the header file (C++), there
>> won't
>> /** Projects an object from 3D to 2D using
>> the method of Alexander The Great.
>> \param 3D structure to be projected
>> \returns 2D projection
>> */
>> public Proj2D get2Dfrom3D(Proj3D param);
>>
>> The above is, to me, very clear and
>> consistent. Not to mention, easily
>> handl
How do i change the size of a Button
(using Tkinter), other than to set it
during construction?
I've found methods for getting the
size but not applying them.
I've been laborating with .setvar(*)
but i've been unsuccessful.
--
Regards
Konrad Viltersten
sleep
>> How do i change the size of a Button
>> (using Tkinter), other than to set it
>> during construction?
> In Tkinter, usually the geometry managers
> (such as pack) are the ones who size the
> widgets. If you run something like:
>import Tkinter as tk
>
>root = tk.Tk()
>def change_si
>> What i wish to do is to affect the size
>> of the button but not due to change of
>> text but due to resize of the frame it
>> resides in.
>
> This is done by the layout manager, too:
>
> import Tkinter as tk
>
> root = tk.Tk()
> button = tk.Button(root, text="42")
> button.pack(fill=tk.BOTH,
>> Do i need to set a callback to a canvas
>> in order to "listen" to the root window
>> being resized in order to make it adjust
>> its contents?
>>
>> If so, how? If not, how do i make the
>> canvas draw a line from one corner to
>> an other?
>
> import Tkinter as tk
>
> root = tk.Tk()
> canva
34 matches
Mail list logo