Hey folks!
What's the difference between these commands?
print "%02d" % (12)
print "%d" % (12)
I know that "d" stands for decimal. What does "02" mean?
Cheers!
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
ht
Hey there!
How to set it right?
Cheers!
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
> Please clarify, or expand, or tell us what problem you are having or
> trying to solve.
Hi!
I want to have a possibility to import modules from the folder, which
is not included in the load path.
Example:
module.py
-
def testfunc(name):
file = open(name)
return len(file.readlines(
Hey there!
I'm reading Lutz's Learning Python.
Here is some code from the book.
There is a module called lcclient_lutz.py:
from lengthcounter_lutz import countLines, countChars
print countLines('lengthcounter_lutz.py'), countChars('lengthcounter_lutz.py')
And there is another one called length
>Simply that python is saying it cannot find the file.
>So it is probably in a different folder to the one in which the program is
>running. You need to provide a valid path to the file,
Those files are in the same folder:
/Users/Username/Python_modules/
I don't want to write a full path here:
i
>You don't have any option.
>You either type in the full path or you get the user to tell you
>in some way - either with a prompt or via an input argument.
OK, now I get it.
How can I tell this to the end-user?
Should I write a README file or what?
I've tried to run lengthcounter_lutz from the f
Hey there!
I want to write a program that can draw a figure using the coordinates
specified by the user and calculate its area. An output should be
saved in tiff or png.
What should I use for this?
Cheers.
___
Tutor maillist - Tutor@python.org
To uns
I think I'll stick with PyGTK.
How to install it?
This FAQ looks outdated:
http://faq.pygtk.org/index.py?req=show&file=faq01.019.htp
I've also tried to compile it from source:
PyGTK asked for pkg-config and pygobject.
Pygobject asked for pkg-config.
Pkg-config asked for pkg-config and glib:
conf
Hi there!
>>> class Sample:
>>> def method(self): pass
>>> Sample().method()
What's the difference between class __main__.Sample and
__main__.Sample instance?
Why should I write "Sample().method" instead of "Sample.method"?
Cheers!
___
Tutor mail
Thanks.
I totally get it now.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hello!
Here is another one.
class A:
def __init__(self, data):
self.data = data
print self.data
I'm trying to understand this function-like syntax:
A('foo').__init__(42)
A(12).data
What are we actually calling this way?
Are there any other ways to get the
Hi!
Could you provide some examples (easy and hard ones) and comments on the topic?
I'm trying to understand how this thing works.
Cheers.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mai
12 matches
Mail list logo