Say that I have module "spam.py" in "/tmp" which is in PYTHONPATH.
in shell, my current directory is "/tmp",
are line#3 and #4 --- http://paste.pocoo.org/show/166268/ -
"equivalent" --- i.e. yielding the same result ?
Thanks
___
Tutor maillist - Tut
"Robert" wrote
I have read quite a bit in the past 2 months, ( I have also looked at
codes)
At this point, I think I understand well what __init__() is and does -
But, I have yet to see this *specifically* spelled out about the the
__init__ method for a Class;
It is OPTIONAL, correct ?
Yes
"Robert" wrote
in shell, my current directory is "/tmp",
are line#3 and #4 --- http://paste.pocoo.org/show/166268/ -
"equivalent" --- i.e. yielding the same result ?
No need to use pastebin when its only 2 lines!
Since -m runs a module as a script I think the answer is yes.
Where they wo
I have read quite a bit in the past 2 months, ( I have also looked at codes)
At this point, I think I understand well what __init__() is and does -
But, I have yet to see this *specifically* spelled out about the the
__init__ method for a Class;
It is OPTIONAL, correct ?
if I have NO start values
I read that it is advised to subclass object.
Is it really necessary? I mean, everything works, why should I add it to my
code?
Cheers,
Timo
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/ma
"Timo Vanwynsberghe" wrote
I read that it is advised to subclass object.
Is it really necessary? I mean, everything works, why should I add it to
my
code?
In older versions of Python it made a difference whether you used object
or not. Using object gave you a "new style" class which has s
Hi,
I am new to python, and i am trying to make a program that makes like a txt
file database. so i have my whole program in a while True loop, it asks for
information about the person and then writes the information about the person
to a txt file, but i need it to be able to add more entries i
On Sun, Jan 17, 2010 at 6:40 PM, Shizuha Aki wrote:
> Hi,
>
> I am new to python, and i am trying to make a program that makes like a txt
> file database. so i have my whole program in a while True loop, it asks for
> information about the person and then writes the information about the
> person
Hi,
It is the way you open the text file in the beginning.
This is from the python manual:
open() returns a file object, and is most commonly used with two arguments:
"open(filename, mode)".
>>> f=open('/tmp/workfile', 'w')
>>> print f
The first argument is a string containing the filename. T
On Sun, Jan 17, 2010 at 12:47 PM, Robert wrote:
> On Sun, Jan 17, 2010 at 11:25 AM, Alan Gauld
> wrote:
>> In older versions of Python it made a difference whether you used object
>> or not. Using object gave you a "new style" class which has several extra
>> features, without you got an "old st
Magnus Kriel wrote:
> It might be that when you create a file for the first time with 'a',
> that it will through an exception. So you will have to try with 'w', and
> if there is an exception, you know the file does not exist and you will
> have to create the file for the first time with 'w'.
Tha
Thanx, you are correct. And now I know that 'a' will create a file as well.
Magnus
On Sun, Jan 17, 2010 at 10:34 AM, Steve Willoughby wrote:
> Magnus Kriel wrote:
> > It might be that when you create a file for the first time with 'a',
> > that it will through an exception. So you will have to t
In the Python tutorial (highlighted here http://awurl.com/N1XvzIo2Q)
What exactly is "dynamic name resolution" ? specifically what is
"dynamic" about it ?
thanks
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http
I am writing a script that will send an email message. This will
run in a windows XP box. The box does not have a smtp server, so
the script must crete not merely a smtp client to talk to a MTA,
it must BE one for the duration of sending the message- then shut
off, we don't need no bloody op0en
On Sun, Jan 17, 2010 at 12:10 PM, Robert wrote:
> In the Python tutorial (highlighted here http://awurl.com/N1XvzIo2Q)
>
> What exactly is "dynamic name resolution" ? specifically what is
> "dynamic" about it ?
what this means is that as your code is executing and the interpreter
encounters an i
> while True:
> name = raw_input("what is the name ")
> age = raw_input("what is the age ")
>
> out_file = open("persons.txt", "w")
> out_file.write("name: ")
> out_file.write(name)
> out_file.write("\n")
> out_file.write("age: ")
> out_file.w
On Sun, Jan 17, 2010 at 3:45 PM, Kirk Z Bailey wrote:
> I am writing a script that will send an email message. This will run in a
> windows XP box. The box does not have a smtp server, so the script must
> crete not merely a smtp client to talk to a MTA, it must BE one for the
> duration of sendin
Kent Johnson wrote:
> On Sun, Jan 17, 2010 at 3:45 PM, Kirk Z Bailey
> wrote:
>> I am writing a script that will send an email message. This will run in a
>> windows XP box. The box does not have a smtp server, so the script must
>> crete not merely a smtp client to talk to a MTA, it must BE one
On So, 2010-01-17 at 15:45 -0500, Kirk Z Bailey wrote:
> I am writing a script that will send an email message. This will
> run in a windows XP box. The box does not have a smtp server, so
> the script must crete not merely a smtp client to talk to a MTA,
> it must BE one for the duration of sen
"Robert" wrote
I have been wondering about this "New-style Class" subject along this
line:
so, *theoretically speaking*, in EXISTING, pre-P3K code,
if one changes everywhere where it's coded "class someClass()" to
"class someClass(object)",
it should not break the programs, right ?
More co
"Shizuha Aki" wrote
i need it to be able to add more entries instead of just one.
my code is like this:
while True:
name = raw_input("what is the name ")
age = raw_input("what is the age ")
out_file = open("persons.txt", "w")
It would work if you moved the open() call ou
"Magnus Kriel" wrote
It might be that when you create a file for the first time with 'a', that
it
will through an exception. So you will have to try with 'w', and if there
is
an exception, you know the file does not exist and you will have to
create
the file for the first time with 'w'.
T
Hi,
What would be an atexit equivalent for a C extension module? When my
extension module is unloaded, I would like some clean up functions to
be called from an external c library. I've had a look at the C
extension guide but I can't find anything like that,
Thanks in advance,
.S
On 01/17/10 16:42, Robert wrote:
> I have read quite a bit in the past 2 months, ( I have also looked at codes)
> At this point, I think I understand well what __init__() is and does -
> But, I have yet to see this *specifically* spelled out about the the
> __init__ method for a Class;
>
> It is O
Григор, 15.01.2010 08:28:
> Someone to have good E-book for python and XMl
The existing books are rather old. You might find these interesting, though:
http://effbot.org/zone/element.htm
http://codespeak.net/lxml/tutorial.html
http://www.nmt.edu/tcc/help/pubs/pylxml
Stefan
_
Shuying Wang, 18.01.2010 03:13:
> What would be an atexit equivalent for a C extension module? When my
> extension module is unloaded, I would like some clean up functions to
> be called from an external c library. I've had a look at the C
> extension guide but I can't find anything like that,
I'm
26 matches
Mail list logo