Re: Writing a Carriage Return in Unicode

2009-11-21 Thread Gregory Ewing
Steve Howell wrote: If you are going to couple character sets to their legacy physical implementations, you should also have a special extra character to dot your i's and cross your t's. No, no, no. For that device you need to output a series of motion vectors for the scribing point. Plus contr

Re: Go versus Brand X

2009-11-21 Thread Gregory Ewing
On Nov 21, 11:20 am, John Roth wrote: > Go is simply C with most (but not all) of the warts removed and some more modern features added. Syntax-wise, I find myself disappointed that they didn't do as good a job of removing the warts as they could have. For example, there are good reasons for

python setup.py build 32-bits on x86_64 machine

2009-11-21 Thread Sérgio Monteiro Basto
Hi, I am in x86_64 arch , but I need compile things on 32 bits. python setup.py build Can't change the fact that distutils creates x86_64 directories: gcc -pthread -shared build/temp.linux-x86_64-2.3/ Also if I try with a python compile in 32bits and installed in system . how I force distuti

Re: parallel class structures for AST-based objects

2009-11-21 Thread Gregory Ewing
Steve Howell wrote: My objection to the interface you describe is that Node defines the type of operations that can be done to it by third-party code, which is something that I cannot predict I think you have the right idea with a mapping from node classes to implementations of operations, but

Re: Imitating "tail -f"

2009-11-21 Thread Matt Nordhoff
Jason Sewall wrote: > FWIW, GNU tail on Linux uses inotify for tail -f: > > http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tail.c > > The wikipedia page for inotify lists several python bindings: > > http://en.wikipedia.org/wiki/Inotify > > Not much help for non-Linux users, but there

Re: plotting arrow in python

2009-11-21 Thread Gregory Ewing
rudra wrote: 0.0 0.0 0.1 0.0 0.1 0.1 0.1 0.0 0.5 like that! the first two column are coordinate and 3rd one is magnitude of moment (say: x y,m)!! so what i want to do is draw an arrow of magnitude(m) in the position (x,y). There seems to be some information missing there. How do you know what

Re: Too Many Values To Unpack

2009-11-21 Thread Steven D'Aprano
On Sat, 21 Nov 2009 21:06:08 -0800, Dennis Lee Bieber wrote: > I apparently thought "for ... in dictionary" would return (key, > value) pairs, but it appears that it only returns the key itself -- and > a single key can't be unpacked. > > Misleading error... too many /targets/ to unpa

Re: Too Many Values To Unpack

2009-11-21 Thread Gregory Ewing
Dennis Lee Bieber wrote: I apparently thought "for ... in dictionary" would return (key, value) pairs, but it appears that it only returns the key itself -- and a single key can't be unpacked. Misleading error... too many /targets/ to unpack... My guess is that the keys are st

Re: Imitating "tail -f"

2009-11-21 Thread Jason Sewall
FWIW, GNU tail on Linux uses inotify for tail -f: http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tail.c The wikipedia page for inotify lists several python bindings: http://en.wikipedia.org/wiki/Inotify Not much help for non-Linux users, but there it is. Too bad, because inotify is pre

Re: Imitating "tail -f"

2009-11-21 Thread exarkun
On 02:43 am, ivo...@gmail.com wrote: I'm trying to simply imitate what "tail -f" does, i.e. read a file, wait until it's appended to and process the new data, but apparently I'm missing something. The code is: 54 f = file(filename, "r", 1) 55 f.seek(-1000, os.SEEK_END) 56 ff = fcnt

Re: How do I create a vanilla object in C?

2009-11-21 Thread Carl Banks
On Nov 21, 12:49 pm, rnich...@mightyheave.com wrote: > I need to create a vanilla object in C, something I can do > PyObject_SetAttr on.  Obviously, I do something somewhat like this every > time I create a minimal python class.  I need to know how to do this in C > though. First of all, if you d

Re: Go versus Brand X

2009-11-21 Thread Mensanator
On Nov 21, 6:11 pm, Steve Howell wrote: > On Nov 21, 11:20 am, John Roth wrote: > > > > > > > On Nov 21, 8:40 am, Duncan Booth wrote: > > > > a...@pythoncraft.com (Aahz) wrote: > > > > Comparing Go to another computer language -- do you recognize it? > > > > >http://www.cowlark.com/2009-11-15-go

Imitating "tail -f"

2009-11-21 Thread Ivan Voras
I'm trying to simply imitate what "tail -f" does, i.e. read a file, wait until it's appended to and process the new data, but apparently I'm missing something. The code is: 54 f = file(filename, "r", 1) 55 f.seek(-1000, os.SEEK_END) 56 ff = fcntl.fcntl(f.fileno(), fcntl.F_GETFL) 5

Re: python bijection

2009-11-21 Thread Raymond Hettinger
On Nov 19, 3:24 pm, Joshua Bronson wrote: > I couldn't find a library providing a bijective map data structure > (allowing for constant-time lookups by value) in the few minutes I > looked, so I took a few more minutes to code one > up:http://bitbucket.org/jab/toys/src/tip/bijection.py > > Is thi

Re: plotting arrow in python

2009-11-21 Thread r
On Nov 21, 7:36 pm, Lie Ryan wrote: (..snip..) > If you want to avoid 3rd party modules, take a look at turtle and > Tkinter in the standard library. Just to add to Ryans words... If you want to avoid 3rd party modules, take a look at turtle and the Tkinter *Canvas* widget in the standard library

Re: pythonpath

2009-11-21 Thread Dave Angel
Ray Holt wrote: Is there a way to make python point to a different directory for modules. I don't like to keep my modules in the program directory, but I can't figure out from the shell how to get the program to look in another directory. I am using XP Pro as an operating system and python2.6

Re: Writing a Carriage Return in Unicode

2009-11-21 Thread Steve Howell
On Nov 21, 12:12 am, Steven D'Aprano wrote: > On Thu, 19 Nov 2009 23:22:22 -0800, Scott David Daniels wrote: > > > If you've actually typed on a physical typewriter, you know that moving > > the carriage back is a distinct operation from rolling the platen > > forward; > > I haven't typed on a phy

Re: plotting arrow in python

2009-11-21 Thread Lie Ryan
rudra wrote: Dear friends, I am very new in python. Actually, I think I will not do much python then using it to plotting data. I have not done any "real" thing in python, so plz be easy. Now , the problem I have a data set: 0.0 0.0 0.1 0.0 0.1 0.1 0.1 0.0 0.5 like that! the first two column are

Re: parallel class structures for AST-based objects

2009-11-21 Thread Steve Howell
On Nov 21, 4:33 pm, Richard Thomas wrote: > > This looks more structurally sound: > > class Node(object): >    def eval(self): >       raise NotImplementedError >    def pprint(self): >       raise NotImplementedError > My objection to the interface you describe is that Node defines the type of o

Re: parallel class structures for AST-based objects

2009-11-21 Thread Richard Thomas
On 22 Nov, 00:07, MRAB wrote: > Steve Howell wrote: > > I have been writing some code that parses a mini-language, and I am > > running into what I know is a pretty common design pattern problem, > > but I am wondering the most Pythonic way to solve it. > > > Basically, I have a bunch of really si

Re: How do I create a vanilla object in C?

2009-11-21 Thread Daniel Fetchinson
> I need to create a vanilla object in C, something I can do > PyObject_SetAttr on. Obviously, I do something somewhat like this every > time I create a minimal python class. I need to know how to do this in C > though. Please see http://docs.python.org/extending/index.html http://docs.python.o

Re: parallel class structures for AST-based objects

2009-11-21 Thread Steve Howell
On Nov 21, 4:07 pm, MRAB wrote: > > I don't see the point of EvalNode and PrettyPrintNode. Why don't you > just give Integer, Sum and Product 'eval' and 'pprint' methods? That's a good question, and it's the crux of my design dilemma. If ALL I ever wanted to to with Integer/Sum/Product was to ev

Re: Go versus Brand X

2009-11-21 Thread Steve Howell
On Nov 21, 11:20 am, John Roth wrote: > On Nov 21, 8:40 am, Duncan Booth wrote: > > > a...@pythoncraft.com (Aahz) wrote: > > > Comparing Go to another computer language -- do you recognize it? > > > >http://www.cowlark.com/2009-11-15-go/ > > > Yes, spotted it at the first 'fi'. > > This isn't the

Re: parallel class structures for AST-based objects

2009-11-21 Thread MRAB
Steve Howell wrote: I have been writing some code that parses a mini-language, and I am running into what I know is a pretty common design pattern problem, but I am wondering the most Pythonic way to solve it. Basically, I have a bunch of really simple classes that work together to define an exp

parallel class structures for AST-based objects

2009-11-21 Thread Steve Howell
I have been writing some code that parses a mini-language, and I am running into what I know is a pretty common design pattern problem, but I am wondering the most Pythonic way to solve it. Basically, I have a bunch of really simple classes that work together to define an expression--in my oversim

Re: Problem combining Scientific (leastSquaresFit) and scipy (odeint)

2009-11-21 Thread Colin W.
Harold Fellermann wrote: Hi, I need to perform leastSquaresFit of a model that is given by a differential equation for which there seems to be no analytic solution. So, I am trying to solve the ODE numerically (using scipy.integrate.odeint) within the function I provide to leastSquaresFit as a m

Re: ANN: PyGUI Mailing List

2009-11-21 Thread Terry Reedy
Gregory Ewing wrote: There is now a mailing list for discussion of PyGUI: http://mail.python.org/mailman/listinfo/pygui Having it mirrored to news.gmane,org, if you have not yet, like other python.org lists, would make it easier to follow or join. Perhaps it will happen automatically, I do

Re: plotting arrow in python

2009-11-21 Thread Stef Mientki
rudra wrote: Dear friends, I am very new in python. Actually, I think I will not do much python then using it to plotting data. I have not done any "real" thing in python, so plz be easy. Now , the problem I have a data set: 0.0 0.0 0.1 0.0 0.1 0.1 0.1 0.0 0.5 like that! the first two column are

extending dictonary

2009-11-21 Thread nospam
Is there any way to extend the dictonary in such manner that I can insert muliplay value to each keys and return one of the value as the default value. I would like to have similar syste that I drawed out below. tree[nucelotide_postionc][nucleotide]=default(value subtree) This should be retur

Are you happy with the current web deployment options?

2009-11-21 Thread Antonio Cangiano
Phusion is a Dutch company that vastly improved the status quo of Ruby and Rails deployment through their open source module for Apache and nginx. Now they are publicly asking whether Pythonistas would be interested in a similar solution for Python (and Django of course). Not many Pythonistas rea

Re: Too Many Values To Unpack

2009-11-21 Thread Carsten Haese
Victor Subervi wrote: > File "/var/www/html/angrynates.com/cart/catTree.py > ", line 25, in getChildren > for (nm, dt) in levelDict: > ValueError: too many values to unpack > > Please advise. I already explained what's causing this error. Read my first

plotting arrow in python

2009-11-21 Thread rudra
Dear friends, I am very new in python. Actually, I think I will not do much python then using it to plotting data. I have not done any "real" thing in python, so plz be easy. Now , the problem I have a data set: 0.0 0.0 0.1 0.0 0.1 0.1 0.1 0.0 0.5 like that! the first two column are coordinate and

How do I create a vanilla object in C?

2009-11-21 Thread rnichols
I need to create a vanilla object in C, something I can do PyObject_SetAttr on. Obviously, I do something somewhat like this every time I create a minimal python class. I need to know how to do this in C though. -- http://mail.python.org/mailman/listinfo/python-list

pythonpath

2009-11-21 Thread Ray Holt
Is there a way to make python point to a different directory for modules. I don't like to keep my modules in the program directory, but I can't figure out from the shell how to get the program to look in another directory. I am using XP Pro as an operating system and python2.6 -- http://mail.pytho

memoize again

2009-11-21 Thread yota.n...@gmail.com
I spent a lot of time looking for tips on how to properly write cache / memoize function. Testing, merging and fixing contributed but half finished pieces of code. Here is the summary of what I learned through a clean example, might it be useful for beginners. #!/usr/bin/env python3.1 (should work

Re: Go versus Brand X

2009-11-21 Thread Nobody
On Fri, 20 Nov 2009 17:12:36 -0800, Aahz wrote: > Comparing Go to another computer language -- do you recognize it? "Here is a language so far ahead of its time that it was not only an improvement on its predecessors but also on nearly all its successors." - C. A. R. Hoare (although he was actu

Re: python simply not scaleable enough for google?

2009-11-21 Thread Nobody
On Fri, 20 Nov 2009 09:51:49 -0800, sturlamolden wrote: > You can make a user-space scheduler and run a 10 tasklets on a > threadpool. But there is a GIL in stackless as well. > > Nobody wants 10 OS threads, not with Python, not with Go, not with > C. > > Also note that Windows has nativ

Re: Go versus Brand X

2009-11-21 Thread John Roth
On Nov 21, 8:40 am, Duncan Booth wrote: > a...@pythoncraft.com (Aahz) wrote: > > Comparing Go to another computer language -- do you recognize it? > > >http://www.cowlark.com/2009-11-15-go/ > > Yes, spotted it at the first 'fi'. This isn't the first time anyone has criticized Go. The interesting,

Problem combining Scientific (leastSquaresFit) and scipy (odeint)

2009-11-21 Thread Harold Fellermann
Hi, I need to perform leastSquaresFit of a model that is given by a differential equation for which there seems to be no analytic solution. So, I am trying to solve the ODE numerically (using scipy.integrate.odeint) within the function I provide to leastSquaresFit as a model: def func(L, t, a, k)

Re: Newbie question about scrapy tutorial

2009-11-21 Thread Cousin Stanley
> i have no idea what scrapy is > http://scrapy.org/ Scrapy is a fast high-level screen scraping and web crawling framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring

Re: Newbie question about scrapy tutorial

2009-11-21 Thread Zeynel
Now I use EditpadPro and IDLE which appears to be adequate for beginning level. But PyDev looks fun, I'll try it. By the way, I realized that the spider sends the scraped data to the pipelines.py. Now everything is working. On Nov 21, 11:21 am, DreiJane wrote: > Sorry, > > i have no idea what sc

Re: Problem w/ smtplib

2009-11-21 Thread Victor Subervi
On Sat, Nov 21, 2009 at 1:16 PM, Kev Dwyer wrote: > > 2009/11/21 Victor Subervi > > On Sat, Nov 21, 2009 at 12:04 PM, Kev Dwyer wrote: >> >>> On Sat, 21 Nov 2009 08:19:52 -0500, Victor Subervi wrote: >>> >>> Hello Victor, >>> >>> The information that you have sent comes from the client side of t

Re: Problem w/ smtplib

2009-11-21 Thread Kev Dwyer
2009/11/21 Victor Subervi > On Sat, Nov 21, 2009 at 12:04 PM, Kev Dwyer wrote: > >> On Sat, 21 Nov 2009 08:19:52 -0500, Victor Subervi wrote: >> >> Hello Victor, >> >> The information that you have sent comes from the client side of the >> transaction, so it isn't possible to tell why the server

Re: Problem w/ smtplib

2009-11-21 Thread Victor Subervi
On Sat, Nov 21, 2009 at 12:04 PM, Kev Dwyer wrote: > On Sat, 21 Nov 2009 08:19:52 -0500, Victor Subervi wrote: > > Hello Victor, > > The information that you have sent comes from the client side of the > transaction, so it isn't possible to tell why the server disconnected. > Assuming that there

Re: Problem w/ smtplib

2009-11-21 Thread Kev Dwyer
On Sat, 21 Nov 2009 08:19:52 -0500, Victor Subervi wrote: Hello Victor, The information that you have sent comes from the client side of the transaction, so it isn't possible to tell why the server disconnected. Assuming that there is an SMTP server listening on port 25, you need to check the

Re: python server developer

2009-11-21 Thread garabik-news-2005-05
Bobby wrote: > Hello, > We are looking for Python server developer > location : Hyderabad > Experience : 3 years . > Send me your updated resume with availability for Telephonic interview Hyderabad, India or Hyderabad, Pakistan? (no, I am not going to apply in either case, even if I think I do qu

Re: Newbie question about scrapy tutorial

2009-11-21 Thread DreiJane
Sorry, i have no idea what scrapy is - but i see, that you try to use idle with pipes or anything like that. That cannot work. idle doesn't even handle __file__ correctly. Use a full-fledged python IDE (PyDev under Eclipse leaves very few wishes open) or test in a python interpreter shell. Good l

ANN: PyGUI Mailing List

2009-11-21 Thread Gregory Ewing
There is now a mailing list for discussion of PyGUI: http://mail.python.org/mailman/listinfo/pygui What is PyGUI? -- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly Pythonic API. http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ -- Gre

Re: Too Many Values To Unpack

2009-11-21 Thread Victor Subervi
On Sat, Nov 21, 2009 at 2:10 AM, Dennis Lee Bieber wrote: >And my follow-up to that original thread stated that it /was/ > pseudo-code, not something tested. My goal was to illustrate the > general concepts of processing a recursive/nested data set stored in a > flat/relational table. >

Re: crontab problem

2009-11-21 Thread Victor Subervi
On Sat, Nov 21, 2009 at 8:59 AM, Chris Rebert wrote: > > And this is germane to Python (and not instead say, *nix) how exactly? > Oops! Wrong list! -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with pyqt.. help please...

2009-11-21 Thread Benjamin Kaplan
On Sat, Nov 21, 2009 at 8:47 AM, Jebagnana Das wrote: > Hi friends, > I've recently changed to ubuntu 9.04.. I've not had any > problem with the installation of pyqt as it is available from the ubuntu > repositories with umpteen number of packages.. Anyhow i've to download > tarball f

Re: crontab problem

2009-11-21 Thread Chris Rebert
On Sat, Nov 21, 2009 at 5:47 AM, Victor Subervi wrote: > Hi; > I have the following in crontab -eu root: > @daily /usr/local/bin/mysql-backup-daily.sh > @weekly /usr/local/bin/mysql-backup-weekly.sh > @monthly /usr/local/bin/mysql-backup-monthly.sh > > [r...@13gems globalsolutionsgroup.vi]# ls /us

problem with pyqt.. help please...

2009-11-21 Thread Jebagnana Das
Hi friends, I've recently changed to ubuntu 9.04.. I've not had any problem with the installation of pyqt as it is available from the ubuntu repositories with umpteen number of packages.. Anyhow i've to download tarball file for python 3.1 and installed it.. I found that PyQt4 supports

crontab problem

2009-11-21 Thread Victor Subervi
Hi; I have the following in crontab -eu root: @daily /usr/local/bin/mysql-backup-daily.sh @weekly /usr/local/bin/mysql-backup-weekly.sh @monthly /usr/local/bin/mysql-backup-monthly.sh [r...@13gems globalsolutionsgroup.vi]# ls /usr/local/bin/mysql-* /usr/local/bin/mysql-daily.sh /usr/local/bin/mys

python server developer

2009-11-21 Thread Bobby
Hello, We are looking for Python server developer location : Hyderabad Experience : 3 years . Send me your updated resume with availability for Telephonic interview -- http://mail.python.org/mailman/listinfo/python-list

Problem w/ smtplib

2009-11-21 Thread Victor Subervi
Hi; I get the following error: /var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py52 session.sendmail(clientEmail, ourEmail1, header+msg) 53 # session.sendmail(clientEmail, ourEmail2, header+msg) 54 55 mailSpreadsheet() 56 *mailSpreadsheet* = /var/www/html/globalsol

How do I print to text browser with Qthread? (in PyQt)

2009-11-21 Thread someone
Hello, I wrote Qthread that gets in the constructor a textBrowser from PyQt application and I tryed to print in this widget text that is updated each 5 seconds (Like application that counts numbers of the text brouser) Is anyone can explain me how to do this? I would glad if you can attach a code

Re: DOM related question and problem

2009-11-21 Thread elca
Stefan Behnel-3 wrote: > > elca, 18.11.2009 19:04: >> these day im making python script related with DOM. >> >> problem is these day many website structure is very complicate . >> [...] >> what is best method to check can extract such like following info >> quickly? > > This should help: >

Re: Writing a Carriage Return in Unicode

2009-11-21 Thread sturlamolden
On 21 Nov, 08:10, Dennis Lee Bieber wrote: >         Of course, if you are describing a /real/ /manual/ typewriter, you > would rapidly discover that the sequence is -- since pushing > the bar would often trigger the line feed before it would slide the > carriage to the right. > >         But on

Re: extending dictonary

2009-11-21 Thread Steven D'Aprano
On Sat, 21 Nov 2009 09:25:38 +0100, nospam wrote: > Is there any way to extend the dictonary in such manner that I can > insert muliplay value to each keys and return one of the value as the > default value. I would like to have similar syste that I drawed out > below. > > > tree[nucelotide_post

Re: Writing a Carriage Return in Unicode

2009-11-21 Thread sturlamolden
On 21 Nov, 09:12, Steven D'Aprano wrote: > Oh please, that's historical revisionism -- \r\n wasn't invented by > Microsoft. Microsoft didn't "get it right", they simply copied what CP/M > did, on account of the original MS-DOS being essentially a clone of CP/M. Actyually \r\n goes back to early

Re: Writing a Carriage Return in Unicode

2009-11-21 Thread Steven D'Aprano
On Thu, 19 Nov 2009 23:22:22 -0800, Scott David Daniels wrote: > MRAB wrote: >> u'\u240D' isn't a carriage return (that's u'\r') but a symbol (a >> visible "CR" graphic) for carriage return. Windows programs normally >> expect lines to end with '\r\n'; just use u'\n' in programs and open >> the te