Hi,
Where I can find a module supporting that?
A.
--
http://mail.python.org/mailman/listinfo/python-list
This a mm.py module:
_all__=('getsize1',)
size=85
def getsize1():
return size
def getsize2():
return 2*size
I do not know why but getsize2 is not kept priviate?
$ python
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credi
[EMAIL PROTECTED] wrote:
> Andy> This a mm.py module:
> Andy> _all__=('getsize1',)
>
> Andy> size=85
>
> Andy> def getsize1():
> Andy> return size
>
> Andy> def getsize2():
> Andy> return 2*size
>
>
> Andy> I do not know why but getsize2 is not kept pr
Hi,
Can I redirect print output, so it is send to a file, not stdout.
I have a large program and would like to avoid touching hundreds of print's.
Thx, Andy
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
What would by a python equivalent of following shell program:
#!/bin/sh
prog1 > file1 &
prog2 > file2 &
As you see, I need to spawn a few processes and redirect stdout to some
files.
Thx,
A.
--
http://mail.python.org/mailman/listinfo/python-list
Harold Fellermann wrote:
import sys
sys.stdout = file("output","w")
print "here you go"
>
>
And what if I want to still send the output to stdout and just a log it
in the file as well?
A.
--
http://mail.python.org/mailman/listinfo/python-list
Sybren Stuvel wrote:
>>I have a large program and would like to avoid touching hundreds of
>>print's.
>
>
> I can suggest using the logging module instead of print. It's much
> more flexible than prints, and well suited for large programs.
>
Thx for the hint. I will look into that.
A.
--
http
Sybren Stuvel wrote:
> AndyL enlightened us with:
>
>>And what if I want to still send the output to stdout and just a log
>>it in the file as well?
>
>
> $ python some_program.py | tee output.log
>
> Or write a class that has a write() function and output
Edward Elliott wrote:
> Steven Bethard wrote:
>
>>import subprocess
>>
>>file1 = open('file1', 'w')
>>prog1 = subprocess.Popen(['prog1'], stdout=file1)
>
>
> And if the script runs somewhere that stderr is likely to disappear:
>
> prog1 = subprocess.Popen(['prog1'], stdout=file1, stderr=subproc
Brian Ray wrote:
> This will be our best meeting yet! ChiPy's Monthly meeting this Thurs.
> May 11, 2006. 7pm.
>
I will miss it. When the next is planed?
--
http://mail.python.org/mailman/listinfo/python-list
Edward Elliott wrote:
> AndyL wrote:
>
>>Edward Elliott wrote:
>>
>>>And if the script runs somewhere that stderr is likely to disappear:
>>>
>>>prog1 = subprocess.Popen(['prog1'], stdout=file1,
>>>stderr=subprocess.STDOUT)
>&
Iain King wrote:
> http://compoundthinking.com/blog/index.php/2006/03/10/framework-comparison-video/
>
> Thought this might be interesting to y'all. (I can't watch it 'cos I'm
> at work, so any comments about it would be appreciated :)
Indeed it was. The headache factor is 1, for some reason my
Hi,
I have a lot of sources with mixed indentation typically 2 or 4 or 8
spaces. Is there any way to automatically convert them in let's say 4
spaces?
Thx, A.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
let me describe how I do that today. There is standard python taken from
python.org installed in a c:\python23 with at least dozen different
additional python packages (e.g. SOAPpy, Twisted, wx, many smaller ones
etc) included. Also python23.dll moved from c:\windows to c:\python23.
This
John Machin wrote:
> On 25/05/2006 12:00 PM, AndyL wrote:
>
>> Hi,
>>
>> I have a lot of sources with mixed indentation typically 2 or 4 or 8
>> spaces. Is there any way to automatically convert them in let's say 4
>> spaces?
>>
>
> Yup
Hi,
is there any way to specify the path to modules within import statement
(like in Java)?
For instance: "import my.path.module" would load module from
./my/path/module.py?
Thx,
A.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>>For instance: "import my.path.module" would load module from
>>./my/path/module.py?
>
>
> Yeah, just do that. I don't understand the question, it works just like
> this today.
>
I work on rather big set of Python applications: something like 100 .py
files divided int
if type(key).__name__ == "int" or type(key).__name__ == "long":
abc()
elif type(key).__name__ == "str":
efg()
elif type(key).__name__ == "tuple" or type(key).__name__ == "list":
ijk()
In other words I need to determinie intiger type or string or []/() in
elegant way, possibly with
James Stroud wrote:
> Here is a suggestion
>
> todo = {(int, long):abc, (str,):afg, (tuple, list):ijk}
> todo[type(key)]()
Is not that a shortcut? I have got "KeyError" exception ...
--
http://mail.python.org/mailman/listinfo/python-list
Paul McGuire wrote:
> "AndyL" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
>>if type(key).__name__ == "int" or type(key).__name__ == "long":
>> abc()
>>elif type(key).__name__ == "str":
>>
Paul Rubin wrote:
> Normally you'd use range or xrange. range builds a complete list in
> memory so can be expensive if the number is large. xrange just counts
> up to that number.
so when range would be used instead of xrange. if xrange is more
efficient, why range was not reimplemented?
--
21 matches
Mail list logo