Hi all,
Does python has any function to get a system tempdir of an OS?
Thanks,
Phon
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> > prefix = os.path.commonprefix(filter( bool, lines ))
that is an interesting and yes, not very optimal way of saving the set
of non-blank lines. the commonprefix() function takes a list of
pathnames and returns the longest prefix that all strings have in
common, presumably for disk filena
Andre Roberge wrote:
> On 4/25/06, Hugo González Monteverde <[EMAIL PROTECTED]> wrote:
>
>> Remember duck typing. An object just needs to look like a file in order
>> to be used like one.
>>
>> Guido's time machine has already forseen your problem. Take a look at
>> the StringIO module. It allo
Don Taylor wrote:
> I am trying to get some existing CPython 2.4 code working under Jython
> (2.1) and I am puzzled by a line in the following function. It seems to
> be a Python 2.4 idiom that is opaque to me.
>
> The line is:
> prefix = os.path.commonprefix(filter( bool, lines ))
>
> an
I am trying to get some existing CPython 2.4 code working under Jython
(2.1) and I am puzzled by a line in the following function. It seems to
be a Python 2.4 idiom that is opaque to me.
The line is:
prefix = os.path.commonprefix(filter( bool, lines ))
and I don't understand what that 'bo
On 4/25/06, Hugo González Monteverde <[EMAIL PROTECTED]> wrote:
> Remember duck typing. An object just needs to look like a file in order
> to be used like one.
>
> Guido's time machine has already forseen your problem. Take a look at
> the StringIO module. It allows you to use a string where you
I have a loop that process each item in a sequence and after each item
some updating is done to some variables. However i don't what these
variable updated if we are processing the last item in the list. i
could put in a conditional and test if the list is now empty after
popping items from the
Right think I've got the idea now. Thanks for all contributions on this.
Paul
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Karl "Pflästerer"
Sent: 25 April 2006 22:28
To: tutor@python.org
Subject: Re: [Tutor] Dictionaries and aggregation
On 25 Apr
On 25 Apr 2006, [EMAIL PROTECTED] wrote:
[...]
> Here's the list I'm starting with:
>
for i in rLst:
print i, type(i)
>
> server001 alive 17.1% 2 requests/s 14805416 total
> server001 alive 27.2% 7 requests/s 14851125 total
> server002 alive 22.9% 6 requ
Kent Johnson writes:
>> However here's what I'm now trying to do:
>>
>> 1) Not have to rely on using awk at all.
>>
>>
>> 2) Create a dictionary with server names for keys e.g. server001,
>> server002 etc and the aggregate of the request for that server as the value
>> part of t
Peter Jessop wrote:
> I am looking at generating static web pages.
> What I wish to do is periodically regenerate a WEB site form HTML, text
> and MySQL data.
>
> I have been experimenting with HTMLgen and this seems to be adequate for
> what I need.
>
> However HTMLgen does not seem to have be
Kent Johnson wrote:
> Peter Jessop wrote:
>> I am running Python 2.4.3, MySQL 5.0.
>> On trying to install MySQLdb 1.2.1 I ran into the following problem.
>> "
>> D:\Python24\Lib\site-packages\MySQLdb>setup.py build
>> running build
>> running build_py
>> copying MySQLdb\release.py -> build\lib.win
I am looking at generating static web pages.What I wish to do is periodically regenerate a WEB site form HTML, text and MySQL data.I have been experimenting with HTMLgen and this seems to be adequate for what I need.
However HTMLgen does not seem to have been updated for a while and I was wondering
Thanks Liam and Kent.Problem is now sorted.Which brings me on to my next question...
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Peter Jessop wrote:
> I am running Python 2.4.3, MySQL 5.0.
> On trying to install MySQLdb 1.2.1 I ran into the following problem.
> "
> D:\Python24\Lib\site-packages\MySQLdb>setup.py build
> running build
> running build_py
> copying MySQLdb\release.py -> build\lib.win32- 2.4\MySQLdb
> running bui
Hi Peter, you can use a different compiler if you have one, such as
mingw32, but I find compiling extensions on Windows is very
problematic.
Any particular features of MySQLdb 1.2.1 you need? 1.2.0 has a Windows
version precompiled -
http://prdownloads.sourceforge.net/mysql-python/MySQL-python.ex
I am running Python 2.4.3, MySQL 5.0.On trying to install MySQLdb 1.2.1 I ran into the following problem."D:\Python24\Lib\site-packages\MySQLdb>setup.py buildrunning buildrunning build_pycopying MySQLdb\release.py -> build\lib.win32-
2.4\MySQLdbrunning build_exterror: The .NET Framework SDK needs t
Payal Rathod wrote:
> On Tue, Apr 25, 2006 at 06:59:29PM +1200, Liam Clarke wrote:
>> Hi Payal,
>>
>> I see you're connecting to an smtp server Any particular reason yoou
>> can't use smtplib?
>> http://www.python.org/doc/current/lib/module-smtplib.html
>
> Because I don't know it exists :)
>
> B
Payal Rathod wrote:
> On Tue, Apr 25, 2006 at 06:59:29PM +1200, Liam Clarke wrote:
>
>>Hi Payal,
>>
>>I see you're connecting to an smtp server Any particular reason yoou
>>can't use smtplib?
>>http://www.python.org/doc/current/lib/module-smtplib.html
>
>
> Because I don't know it exists :)
>
>
G'day John,
There is a problem with a recent python update and fedora, if you go to
http://forums.fedoraforum.org/ and do a search in the forum for tkinter
and/or idle you will find the fix.
I'm running Fedora Core 5 and found I had to install tkinter, I had to do a
yum install tkinter.
Jo
On Tue, Apr 25, 2006 at 06:59:29PM +1200, Liam Clarke wrote:
> Hi Payal,
>
> I see you're connecting to an smtp server Any particular reason yoou
> can't use smtplib?
> http://www.python.org/doc/current/lib/module-smtplib.html
Because I don't know it exists :)
But I don't want to send any mail.
> However here's what I'm now trying to do:
>
> 1) Not have to rely on using awk at all.
>
>
> 2) Create a dictionary with server names for keys e.g. server001,
> server002 etc and the aggregate of the request for that server as the value
> part of the pairing.
>
>
> I got thi
Hi
I'd very much appreciate your help if you can advise me how to compile
_tkinter in Fedora 4. I installed Fedora core 4 in my machine recently,
but struggled to get Tk working for me.
The Tcl/Tk is working O.K. because I can run demo programs from
/usr/share/tk8.4/demos. The error is caused
John Connors wrote:
> G'day,
>
> I'm having trouble understanding the difference between,
>
> import sys
> and
> from sys import *
The second style is strongly discouraged. As Alan pointed out, it can
lead to surprises when you import more than you expect. I was once
surprised to find out that
Hi Arun et al,
Google says - http://support.microsoft.com/default.aspx?scid=kb;en-us;210684
"This problem can occur when you give the workbook a defined name and
then copy the worksheet several times without first saving and closing
the workbook, as in the following sample code..." (code is in ab
Hi Payal,
I see you're connecting to an smtp server Any particular reason yoou
can't use smtplib?
http://www.python.org/doc/current/lib/module-smtplib.html
Here's a sample script using smtplib to send an email -
import smtplib
ip = "127.0.0.1"
txt = "This is an email message"
c = smtplib.SMTP(
26 matches
Mail list logo