Re: web frameworks that support Python 3

2009-08-23 Thread Sebastian Wiesner
At Sunday 23 August 2009 22:13:16 you wrote: > I use Chinese and therefore Unicode very heavily, and so Python 3 is > an unavoidable choice for me. Python 2.x supports Unicode just as well as Python 3. Every common web framework works perfectly with unicode. In any case, there is bottle [1], whi

Re: Once again, comparison wxpython with PyQt

2009-06-18 Thread Sebastian Wiesner
> On Jun 18, 3:49 pm, "Diez B. Roggisch" wrote: >> Hans Müller wrote: >> > Here we have to select between wxPython and PyQt for a medium size >> > project. In this project several hundred dialogs are to be created. >> > This work will be done by a program generator which has to re-written. >> >>

Re: exit() or sys.exit()

2009-06-17 Thread Sebastian Wiesner
> What is the difference on exit() and sys.exit() when called in the > main body of a script? From the command line they seem to have the > same effect. As of Python 2.5 there is no difference, however documentation [1] says about exit() and quit(): > They are useful for the interactive interp

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-02 Thread Sebastian Wiesner
> Diez B. Roggisch wrote: >> Joseph Garvin schrieb: >> > So I was curious whether it's possible to use the ctypes module with >> > C++ and if so how difficult it is. I figure in principal it's possible >> > if ctypes knows about each compiler's name mangling scheme. So I >> > searched for "ctyp

Re: newbie: popen question

2009-05-28 Thread Sebastian Wiesner
> Your best bet is to make sudo not ask for a password. :) If you > don't have the rights, then you can use pexpect to do what you want to > do. http://pexpect.sourceforge.net/pexpect.html > > See the second example on that page. > > child = pexpect.spawn('scp foo myn...@host.example.com:.')

Re: LaTeXing python programs

2009-05-24 Thread Sebastian Wiesner
> On May 20, 10:10 pm, John Reid wrote: >> Alan G Isaac wrote: >> > The listings package is great and highly configurable. >> > Note that you can also input entire files of Python code >> > or pieces of them based on markers. Really quite great. >> >> I tried listings. I believe pygments makes

Re: Question about the wording in the python documents.

2009-05-02 Thread Sebastian Wiesner
> On May 2, 4:14 am, Sebastian Wiesner wrote: >> > >> > In either case, I think you're picking a nit so small that it isn't >> > actually there. All objects are instances (in Python), and all >> > instances are objects. >> >> Exactl

Re: Question about the wording in the python documents.

2009-05-02 Thread Sebastian Wiesner
> I don't understand your objection. Is it that the documentation calls it > Request instead of urllib2.Request? Or that it calls it an object instead > of an instance? I guess the latter ... > In either case, I think you're picking a nit so small that it isn't > actually there. All objects are i

Re: getting linux distro used...

2009-04-27 Thread Sebastian Wiesner
> In message a88b-2ded6f8af...@y33g2000prg.googlegroups.com>, deostroll wrote: > >> I just found that you could use platform.system() to get the >> underlying os used. But is there a way to get the distro used...? > > Mostly the differences will not be important. But if you want to know, I > h

Re: Presentation software for Python code

2009-04-24 Thread Sebastian Wiesner
> I'm willing to consider TeX- and HTML-based approaches. I can recommend latex with the beamer package. It doesn't directly support formatting of code snippets, but the pygments syntax highlighter comes with a Latex formatter. -- Freedom is always the freedom of dissenters.

Re: pyqt4 qTableWidget add items help

2009-04-19 Thread Sebastian Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > from PyQt4 import ?? QtGui? QtCore? Those are already loaded other > options are pyqtconfig and uic and those don't sound correct... from PyQt4 import QtGui QtGui.QTableWidgetItem See [1] for an example. [1] http://hg.lunaryorn.de/snippets/fi

Re: pyqt4 qTableWidget add items help

2009-04-18 Thread Sebastian Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [...] > I've been trying > > while(len(orders)> i): > ui.tb1_tblOrders.setCurrentCell(i,0,orders[i][1]) > i+=1 > > which to me, says go add in the first column row with the first order, > and it makes sense to me Rea

Re: Automatically generating arithmetic operations for a subclass

2009-04-14 Thread Sebastian Wiesner
> I have a subclass of int where I want all the standard arithmetic > operators to return my subclass, but with no other differences: > > class MyInt(int): > def __add__(self, other): > return self.__class__(super(MyInt, self).__add__(other)) > # and so on for __mul__, __sub__, e

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-17 Thread Sebastian Wiesner
At Thu, 16 Oct 2008 18:21:38 +0200 wrote Bruno Desthuilliers <[EMAIL PROTECTED]>: >> It doesn't look like there's >> any way to browse the subversion any more, though. > > Doh :( > > Is there any way to get this version then ??? svn co https://python-mode.svn.sourceforge.net/svnroot/python-mode/

Re: The file executing

2007-07-03 Thread Sebastian Wiesner
[ Benjamin <[EMAIL PROTECTED]> ] > On Jul 2, 9:47 pm, Justin Ezequiel <[EMAIL PROTECTED]> > > wrote: > > On Jul 3, 9:40 am, Benjamin <[EMAIL PROTECTED]> wrote: > > > How does one get the path to the file currently executing (not the > > > cwd). Thank you > > > > os.path.dirname(sys.argv[0]) > > The

Re: Building a Python app with Mozilla

2007-06-30 Thread Sebastian Wiesner
[ "Diez B. Roggisch" <[EMAIL PROTECTED]> ] > > I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor > > PyQT are actually what I want (because the lack of GUI builders and > > they don't really look good on Windows and Linux). > > The latter statement is bogus. Qt is THE native look

Re: linecache and comparison with input

2007-06-30 Thread Sebastian Wiesner
[ Ross Hetherington <[EMAIL PROTECTED]> ] > #!/usr/bin/env python > > import random > import sys > import linecache > > rnd = random.randint(1,3) > line = linecache.getline('testfile', rnd) > > print line Try print repr(line) ... > > gss = raw_input('Enter line: ',) and print repr(gss) ;) > if gss

Re: Building a Python app with Mozilla

2007-06-30 Thread Sebastian Wiesner
[ "Diez B. Roggisch" <[EMAIL PROTECTED]> ] > And as it has been said in this thread already, Qt has an excellent free > GUI-builder. Free as long as you develop free software. Development of proprietary, non-gpl software with Qt requires a commercial licence from Trolltech. -- Freedom is always

Re: try/except/else/finally problem

2007-06-28 Thread Sebastian Wiesner
[ Ed Jensen <[EMAIL PROTECTED]> ] > try: > f = file('test.txt', 'r') > except IOError: > print 'except' > else: > print 'else' > finally: > print 'finally' > > > And the results are: > > File "./test.py", line 9 > finally: > ^ > SyntaxError: invalid syntax A finally

Re: sqlite3 bug??

2007-06-17 Thread Sebastian Wiesner
[ Carsten Haese <[EMAIL PROTECTED]> ] > On Sun, 2007-06-17 at 07:43 -0700, 7stud wrote: > > Please report the whole docs as a bug. > > Calling the entire docs a bug is not helpful. ... unless he also comes up with the "bugfix". ;) -- Freedom is always the freedom of dissenters.

Re: Output of HTML parsing

2007-06-15 Thread Sebastian Wiesner
[ Jackie <[EMAIL PROTECTED]> ] > 1.The code above assume that each Prof has a tilte. If any one of them > does not, the name and title will be mismatched. How to program to > allow that title can be empty? > > 2.Is there any easier way to get the data I want other than using > list? Use BeautifulS