John O'Hagan wrote:
> action="callback",
> callback=my_callback
it works perfect. You made my day and thank you both ^^)
--
http://mail.python.org/mailman/listinfo/python-list
Hi All,
I have a problem with OptParse.
I want to define such an arugument. It can accept additional value or no
value.
"myscript.py --unittest File1,File2"
"myscript.py --unittest"
Is it possible in OptParse? I have tried several combination. But ...
Best regar
,
1. go ahead, if a failure is occurred.
2. stop, if an error is occurred?
Best regards,
Qian Xu
--
http://mail.python.org/mailman/listinfo/python-list
Gerhard Häring wrote:
> What are you testing, really? "Normal" Python code should use a
> PostgreSQL DB-API module or a wrapper on top of it, like SQLAlchemy.
>
> Generally, you shouldn't have to drop down to protocol-level functions,
> unless you're developing a PostgreSQL adapter yourself.
>
>
Steve Holden wrote:
> Without knowing the full details of that particular module I would
> hazard a guess that any database errors will raise exceptions in Python.
> No exceptions means your database operation worked fine.
result status is not an exception.
It means the information of frontend/bac
Qian Xu wrote:
> Hi All,
>
> why the code
> print len(u"»test«")
> returns 8 instead of 6?
>
> Best regards
> Qian
I have solved the problem myself.
# -*- coding: utf-8 -*-
print len(u"»test«")
--- or ---
s = "»test«"
print len(s.deco
Hi All,
why the code
print len(u"»test«")
returns 8 instead of 6?
Best regards
Qian
--
http://mail.python.org/mailman/listinfo/python-list
)
How can I do the same thing in python (2.5)?
Thanks in advance
--
Qian Xu
--
http://mail.python.org/mailman/listinfo/python-list
Lie Ryan wrote:
> If you don't mind an extra space, you can use this:
>
> print 'Testing something ...',
> # note the trailing comma
Thanks. However, the contents will be saved in buffer and will not be shown
until print "(last piece)"
sys.stdout.flush() can solve this problem :-)
--
http://ma
Albert Hopkins wrote:
> On Tue, 2008-12-23 at 13:18 +, Lie Ryan wrote:
>
> Probably because your stdout is line-buffered. Try:
>
> sys.stdout.write("Testing something...")
> sys.stout.flush() # flush the stdout buffer
Thanks. This works for me ^^)
--
http://mail.python.org/mailman/listinfo/
Qian Xu wrote:
> Hello All,
>
> Is it possible to print something to console without a line break?
>
> I tried:
> sys.stdout.write("Testing something ...") // nothing will be printed
> time.sleep(1)
> sys.stdout.write("done\n") // now, the whole
e "Testing something ..." first.
And after 1 second, to see "done" (with a line break)
The only one solution I have found is to call "echo -n 'my_string'".
But it is not nice. Because I have to escape all special chars in the string
manually.
Any advice?
Best r
can I do the same thing in python (2.5)?
Thanks in advance
--
Qian Xu
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo