Re: Python evolution: Unease

2005-01-05 Thread huy

The Python advocates who claim that Python is well-documented and take
exception to when someone say it isn't.  Their idea of "it's
well-documented" seems to be "if there's parts that you think are
poorly documented, feel free to document it".  What kind of nonsense
is that?  
I'm not sure which planet you come from but open source is open source 
for a reason. IMO gratitude is the only thing which can be given back to 
the contributors of open source projects not "what you've given me for 
FREE is not good enough, go back and do a better job (and by the way I 
don't really know how you can do a better job) so I can make money off 
your free time". I don't even expect this much from software I pay for.

Being a python user (not contributer) for the past few years I 
personally think the Python docs are GREAT. If it's not in the 
reference, it can be found in the source (again thank god for open 
source), if it's not in the source you have google, then google groups 
then ASPN python cookbook. If you're not smart enough to do this, well 
learn. It'll help you become a better programmer.

Anyone who thinks Python docs suck haven't browsed javadocs lately, or MSDN.
Software advocacy, which Python has an awful lot of, involves
extolling the virtues of a program as it exists in the present.  Not
as it could potentially exist if someone hypothetically added a bunch
of work that hasn't yet been done.  Python is good software, but its
advocates are making claims that Python itself doesnt live up to.
You should be more accurate. Quote "Python is good software, but its
advocates are making claims that [you think it] doesnt live up to". I 
guess everyone is allowed to have their own opinion.

And no, I don't feel a responsibility to do the missing work, since
I'm not the one making those advocacy claims.
Good on ya.
Huy
--
http://mail.python.org/mailman/listinfo/python-list


Re: Next step after pychecker

2005-02-01 Thread huy
Paul Rubin wrote:
Philippe Fremy <[EMAIL PROTECTED]> writes:
I would like to develop a tool that goes one step further than
pychecker to ensure python program validity. The idea would be to get
close to what people get on ocaml: a static verification of all types
of the program, without any kind of variable declaration. This would
definitely brings a lot of power to python.

You know, I've always thought that ML-style type inference is an
impressive technical feat, but why is it so important to not use
declarations?  This is an aspect I've never really understood.
You know, I think I agree ;-). Just because you don't declare the types, 
doesn't mean you can change the implicit type willy nilly anyway; at 
least for more complex programs anyway. In fact, it would be safer to 
have type checking when you want to do something like this. I currently 
needed to change a number parameter to a string parameter (found out 
order_no wasn't just numbers as specs had specified). Of course this 
parameter was being used in a great many places. Changing it was a bit 
scary because we had to make sure it wasn't being treated as a number 
anywhere throughout the code. Yes good coverage with unit tests would 
have helped but unfortunately we do not yet have good coverage. TDD is a 
quite hard to practice as a beginner.

Cheers,
Huy
--
http://mail.python.org/mailman/listinfo/python-list


Re: Big development in the GUI realm

2005-02-07 Thread huy
RM wrote:
For all you GUI developers, things just got a little more interesting.
Trolltech will soon be offering the QT GUI toolkit for Windows under
the GPL license.  That means that PyQt may become a much more popular
option in the near future.  Unfortunately, some things available for
the commercial customers of Trolltech are not available to the GPL
users.  For example, from their FAQ, it seems that no precompiled
binaries will be provided.  Support for comercial compilers will not be
built in, only for gcc (through Cygwin?). 
Isn't this just the same thing with a different spin. There was always 
an available distribution for linux for non-commercial use. Windows was 
always the problem. You still can't use it for windows without knowing 
how to compile the thing on windows.

huy
--
http://mail.python.org/mailman/listinfo/python-list


Re: pre-PEP: Print Without Intervening Space

2005-03-12 Thread huy
Marcin Ciura wrote:
Duncan Booth wrote:
import sys
def nospace(value, stream=None):
'''Suppress output of space before printing value'''
stream = stream or sys.stdout
stream.softspace = 0
return str(value)

I'm teaching Python as the first programming language to non-computer
scientists. Many of the toy programs would be simpler with the double
comma syntax. Presently, having a choice whether to teach my students
the result += fn(x) way or your way, I would still opt for the former.
Best regards,
  Marcin

Since you're teaching python, why not teach the python way instead of 
inventing a new way.

print 'The phone number is (%s) %s' % (extension, number)
IMO is by far the superior and clearest way for string concatenation for 
any purpose eg. printing or assignment. This would mean you are making 
your students lives easier by showing them one good method of doing 
string concatenation which can be applied to printing as well.

Huy
--
http://mail.python.org/mailman/listinfo/python-list


Re: Best GUI for small-scale accounting app?

2004-12-22 Thread huy
Dave Cook wrote:
On 2004-12-20, Paul Rubin  wrote:

I think I can put together a useable (but not visually stunning) web
interface faster than I can put together any pure client-side
interface.  

Web browser "widgets" seem pretty limited to me, though.  You don't even
have something as simple as a combo box (i.e. an editable entry with a drop
down), let alone the rich set of widgets something like wxwidgets offers.
Also web development doesn't seem as coherent to me as development with a
good GUI framework.
I think it depends on your target audience. Many people love simplicity. 
 Many people hate multiple tabs, tree structures, deep nested menus etc 
etc. If you wanted to make a web program as complex as a rich client 
program then it's probably a bad idea to do as a web program. But If you 
wanted to keep it simple, then I'd go with a web program any day.

Huy
--
http://mail.python.org/mailman/listinfo/python-list


Re: PHP vs. Python

2004-12-22 Thread huy
[EMAIL PROTECTED] wrote:
Anyone know which is faster?  I'm a PHP programmer but considering
getting into Python ... did searches on Google but didn't turn much up
on this.
Thanks!
Stephen
Is PHP too slow for your needs ? Is that the reason for changing ? If it 
is, then Python might not satisfy your need. If it isn't, have you 
thought about why you want to use Python ? If you have, are there 
greater benefits in total over PHP from what you understand of both PHP 
and PYthon.

Not sure where you are currently at with your evaluation of Python so if 
you could outline a few more points on your needs, wants, and 
expectations it would help when answering your questions about Python.

Huy
--
http://mail.python.org/mailman/listinfo/python-list


apostrophe or double quote?

2006-02-07 Thread Huy
I've been unable to find information clarifying this but.  What is the
difference between 'somestring' and "somestring"?  When I use type() it
still reports as string.  If there is a difference could someone point
me to documentation or explain when to use and when not to?  Hope I
sound clear.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: apostrophe or double quote?

2006-02-08 Thread Huy
Thank you for all your help; it makes perfect sense now.

-- 
http://mail.python.org/mailman/listinfo/python-list


PyGTK

2006-02-08 Thread Huy
Hi, I'm new to Python, and GUI development, but am no novice to backend
programming.  Aside from mastering the standard language, I will
eventually be developing applications dealing with images and controls.
 Thus forth I have been testing out PyGTK & it appears to be quite
robust (that and I like the fact of cross-platform compatibility).

What I am curious to know is whether anyone has come across any
noteworthy gui development platforms.  Cross compatibility is not a
must, but a bonus.  Good documentation and clarity is essential for me.
 Also, I imagine I can use modules for image manipulation in tandem
with the GUI interface?  Any comments or speculations are looked
forward to.  Just thought I'd see if there's anything out there the
community knows I may not be currently aware of.

-- 
http://mail.python.org/mailman/listinfo/python-list


Strange socket problem

2005-06-15 Thread huy
Hi,

I'm using cherrypy to provide a user interface for users to start a 
linux server program eg. os.system("nohup myserver.py &"). The problem 
is that if I stop cherrypy server and restart, I get the "Address 
Already In Use" problem until I stop myserver.py. Can someone shed some 
light on why this happens ? Why would the socket be held up in the other 
process ?

Thanks

Huy
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Strange socket problem

2005-06-15 Thread huy
Hi Jeff,

Thanks for your help. Although I haven't confirmed this, I think you 
just hit my nail on the head. I thought os.system was like a totally 
separate process though, i.e nothing is shared. not the usual fork() 
call within the program.

Regards,

Huy

Jeff Epler wrote:
> When using os.system(), files that are open in the parent are available
> in the child, as you can see here in Linux' listing of the files open by
> the child program:
> 
> [EMAIL PROTECTED] jepler]$ python -c 'f = open("/tmp/test", "w"); print 
> f.fileno(); import os; os.system("ls -l /proc/self/fd")'
> 3
> total 5
> lrwx--  1 jepler jepler 64 Jun 15 07:25 0 -> /dev/pts/2
> lrwx--  1 jepler jepler 64 Jun 15 07:25 1 -> /dev/pts/2
> lrwx--  1 jepler jepler 64 Jun 15 07:25 2 -> /dev/pts/2
> l-wx--  1 jepler jepler 64 Jun 15 07:25 3 -> /tmp/test
> lr-x--  1 jepler jepler 64 Jun 15 07:25 4 -> /proc/3108/fd
> 
> You may be able to set the FD_CLOEXEC flag on the files that should not
> be passed to children, something like this:
> old = fcntl.fcntl(fd, fcntl.F_GETFD)
> fcntl.fcntl(fd, fcntl.F_SETFD, old | fcntl.FD_CLOEXEC)
> Refer to a real Unix reference for more information on what FD_CLOEXEC
> does.
> 
> You may want to replace the use of os.system() with fork + close files
> + exec.  Then "myserver.py" will no longer have the listening socket
> descriptor of your cherrypy server.
> 
> Python 2.4's 'subprocess' module may work better in this respect than
> os.system.  It seems to include support for requesting that fds be
> closed in the child (the close_fds parameter to subprocess.Popen)
> 
> Jeff

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Deviation from object-relational mapping (pySQLFace)

2008-10-21 Thread huy
On Oct 12, 11:19 am, [EMAIL PROTECTED] wrote:
> I have made a simple python module to handle SQL 
> databases:https://fedorahosted.org/pySQLFace/wiki
> Its goal to separate relational database stuff (SQL) from algorythmic
> code (python). A SQLFace is a facade initialized with a configuration
> file (XML). It provides callable command objects for each sql query.
> The call substitutes template variables with its parameters, and
> returns the result of the query.
> I would like to get some opinions on this approach.
> Thanks.

Best use of XML for SQL generation/use I have seen is Ibatis SQLMAPS.

This focuses on the right things i.e queries and mapping values to/
from objects.

It would be great if python had such a tool.

Huy
--
http://mail.python.org/mailman/listinfo/python-list


Uninstall old python version(Python 3.9.7)

2021-12-25 Thread Công Huy
   I had uninstalled Python 3.9.7 before but it wasn't uninstalled
   completely. I found it still in my computer and when I click "uninstall",
   it sent me a board "No Python 3.9 installation was detected". Of course,
   it won't be an issue if it defaulted my main Python version on my computer
   and I can't use some libraries I installed like numpy, matplotlib,
   networkx,... To solve my python homework. I found some help on the
   internet but it wasn't improved. I don't know how to fix it. Please help
   me.



   Thanks and Regards,

   Cong Huy



   Sent from [1]Mail for Windows



References

   Visible links
   1. https://go.microsoft.com/fwlink/?LinkId=550986
-- 
https://mail.python.org/mailman/listinfo/python-list


Uninstall old python version(Python 3.9.7)

2021-12-25 Thread Công Huy
   I uninstalled Python 3.9.7 but I can't delete completely. And I received a
   notification "no Python 3.9 was detected". Of course, it won't be an issue
   if it defaulted my python version on my computer and it makes me can't use
   some libraries I installed before like numpy, matplotlib and network to
   solve my homework. I don't know how to fix it. Help me, please.



   Sent from [1]Mail for Windows



References

   Visible links
   1. https://go.microsoft.com/fwlink/?LinkId=550986
-- 
https://mail.python.org/mailman/listinfo/python-list