Re: ConfigParser.items sorting

2009-10-27 Thread Jon Clements
On 28 Oct, 06:21, Dean McClure wrote: > Hi, > > Just wondering how I can get the items() command from ConfigParser to > not resort all the item pairs that it presents. > > I am trying to get it to read some data in order: > > [Relay Info] > relay_name: IPC > relay_current_range: [60, 64, 68, 72, 7

ConfigParser.items sorting

2009-10-27 Thread Dean McClure
Hi, Just wondering how I can get the items() command from ConfigParser to not resort all the item pairs that it presents. I am trying to get it to read some data in order: [Relay Info] relay_name: IPC relay_current_range: [60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116] relay_cu

Re: How would you design scalable solution?

2009-10-27 Thread Jon Clements
On 27 Oct, 17:10, Bryan wrote: > I'm designing a system and wanted to get some feedback on a potential > performance problem down the road while it is still cheap to fix. > > The system is similar to an accounting system where a system tracks > "Things" > which move between different "Buckets".  T

getlocals and getargs

2009-10-27 Thread Lee
Yes, It's actually quite easy to implement getlocals = lambda fn: fn.func_code.co_varnames[:] getargs = lambda fn: getlocals()[:fn.func_code.co_argcount] Of course, this doesn't take into account *args and **kwargs. To figure out if a function have args and kwargs, do a binary and (&) between fun

display of data-figures in histogram

2009-10-27 Thread ankita dutta
hi all, I am working on some graph stuffs and stuck at a point. I am trying to plot a histogram using simple : *import matplotlib.pyplot as plt . . plt.hist(x,bins=10,histtype='bar') plt.show * but i want to know 1) what is the value of a particular bar in histogram and also want to print in on

Re: a simple unicode question

2009-10-27 Thread Chris Jones
On Tue, Oct 27, 2009 at 06:21:11AM EDT, Lie Ryan wrote: > Chris Jones wrote: [..] >> Best part of Unicode is that there are multiple encodings, right? ;-) > > No, the best part about Unicode is there is no encoding! > Unicode does not define any encoding; RFC 3629: "ISO/IEC 10646 and Unicode

Re: unicode and dbf files

2009-10-27 Thread Ethan Furman
John Machin wrote: There may possibly different interpretations of a codepage out there somewhere, but they are all *intended* to be the same, and I advise you to cross the different-cp437s bridge *if* it exists and you ever come to it. Have you got access to files with LDID not in (0, 1) that y

Re: how to get os.system () call to cooperate on Windows

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 23:04:47 -0300, Steven D'Aprano escribió: On Tue, 27 Oct 2009 21:48:36 -0300, Gabriel Genellina wrote: En Tue, 27 Oct 2009 10:55:09 -0300, TerryP escribió: On Oct 26, 10:00 am, Anthra Norell wrote: How can one copy files on the OS level? from ctypes import windll Cop

Re: unicode and dbf files

2009-10-27 Thread John Machin
On Oct 28, 2:51 am, Ethan Furman wrote: > John Machin wrote: > > On Oct 27, 7:15 am, Ethan Furman wrote: > > >>Let me rephrase -- say I get a dbf file with an LDID of \x0f that maps > >>to a cp437, and the file came from a german oem machine... could that > >>file have upper-ascii codes that will

Re: Strange behavior related to value / reference

2009-10-27 Thread Terry Reedy
Lambda wrote: I defined a function to raise a 2x2 matrix to nth power: There is a much faster way to raise x to a count power n than the definitional but naive method of multipling 1 by x n times. It is based on the binary representation of n. Example: x**29 = x**(16+8+4+1) = x**16 * x**8 *

Re: playing mp3

2009-10-27 Thread John O'Hagan
On Mon, 26 Oct 2009, Jabba Laci wrote: > Hi, > > What do you suggest for playing mp3 files with Python? I found a > simple module (http://code.google.com/p/mp3play/) but it only works > with Windows. I'd need Linux support too. [...] If it doesn't need to be pure python, you could use a free-as-i

Re: transpose array

2009-10-27 Thread alex23
On Oct 28, 8:26 am, yoshco wrote: > hello everyone > i have 3 arrays > xVec=[a1,a2,a3,a4,a5] > yVec=[b1.b2.b3.b4.b5] > zVec=[c1,c2,c3,c4,c5] > > and i want to output them to a ascii file like so > > a1,b1,c1 > a2,b2,c2 > a3,b3,c3 > ... I'd probably go with something like the following: all_array

Re: Strange behavior related to value / reference

2009-10-27 Thread Chris Rebert
On Tue, Oct 27, 2009 at 7:15 PM, Lambda wrote: > I defined a function to raise a 2x2 matrix to nth power: > > def matrix_power(m, n): >  result = m[:] Note that this only copies the *outer* list. It does NOT copy any of the inner, nested lists, it just makes fresh *references* to them, which is w

Strange behavior related to value / reference

2009-10-27 Thread Lambda
I defined a function to raise a 2x2 matrix to nth power: def matrix_power(m, n): result = m[:] print result is m for i in range(n - 1): result[0][0] = result[0][0] * m[0][0] + result[0][1] * m[1][0] result[0][1] = result[0][0] * m[0][1] + result[0][1] * m[1][1] result[1][0] = re

Re: how to get os.system () call to cooperate on Windows

2009-10-27 Thread Steven D'Aprano
On Tue, 27 Oct 2009 21:48:36 -0300, Gabriel Genellina wrote: > En Tue, 27 Oct 2009 10:55:09 -0300, TerryP > escribió: > >> On Oct 26, 10:00 am, Anthra Norell wrote: >>> The function "os.system >>> ('copy file_name directory_name')" turns out doesn't do anything >>> except flashing a DOS command

Re: Form Parsing resouces

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 18:16:07 -0300, Tim Johnson escribió: Example=""" This is my form Enter Name """ ## result ["This is my form", {"tagtype":"form","action":"some.cgi","name":"form0"}, "Enter Name ", {"tagtype":"input","type":"text","size":"40","name":"firstname"} {"tagtype":"/form"}] FYI

Re: Problem embedding Python.

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 06:36:18 -0300, Brandon Keown escribió: On Oct 27, 2:47 am, "Gabriel Genellina" wrote: You didn't test for the fopen result; are you sure "test.py" exists in the current directory at the time you run it? Ok, so I assumed that the file, if supplied without a path, would

Re: how to get os.system () call to cooperate on Windows

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 10:55:09 -0300, TerryP escribió: On Oct 26, 10:00 am, Anthra Norell wrote: The function "os.system ('copy file_name directory_name')" turns out doesn't do anything except flashing a DOS command window for half a second. So my question is: How can one copy files on the OS l

Re: ftpilb.FTP.stor...() freeze mystery

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell escribió: I am trying to upload a bunch of web pages to a hosting service. I have a connected ftplib.FTP object and can upload files manually from an IDLE command line using the methods storlines () for html files and storbinary () for th

Re: ftpilb.FTP.stor...() freeze mystery

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell escribió: I am trying to upload a bunch of web pages to a hosting service. I have a connected ftplib.FTP object and can upload files manually from an IDLE command line using the methods storlines () for html files and storbinary () for th

Re: Embedded python on systems without python installed

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 19:31:45 -0300, Stef Mientki escribió: KillSwitch wrote: I have python successfully embedded in a program I wrote. What files do I need and where do I need to put them so that it can run on systems that don't have python installed? I embed python in Delphi apps, and the

Re: transpose array

2009-10-27 Thread Steven D'Aprano
On Tue, 27 Oct 2009 15:26:55 -0700, yoshco wrote: > hello everyone > i have 3 arrays > xVec=[a1,a2,a3,a4,a5] > yVec=[b1.b2.b3.b4.b5] > zVec=[c1,c2,c3,c4,c5] > > and i want to output them to a ascii file like so > > a1,b1,c1 > a2,b2,c2 > a3,b3,c3 > ... f = open('myfile.txt', 'w') for t in zip(xV

Re: Deeper copy than deepcopy

2009-10-27 Thread Steven D'Aprano
On Tue, 27 Oct 2009 15:16:15 -0700, Gary Herron wrote: > Try this: > > > >>> d = [1,2,3] > >>> r = [[x for x in d] for i in range(3)] > >>> r[1][2] = 999 > >>> r > [[1, 2, 3], [1, 2, 999], [1, 2, 3]] [x for x in d] is better written as d[:] -- Steven -- http://mail.python.org/mailman/l

Re: How would you design scalable solution?

2009-10-27 Thread Jonathan Gardner
On Oct 27, 10:10 am, Bryan wrote: > > How else to keep a record of every transaction, but not have the speed > of the > question "How many Things in Bucket x" depend on looking @ every > transaction > record ever made? You can have three different tables in your database: (1) The transaction log

Tkinter scrolling

2009-10-27 Thread Felipe Ochoa
So I've been trying to put Frederik Lundh's ScrolledFrame ( http://effbot.org/zone/tkinter-autoscrollbar.htm ) into a class, and have the frame do more useful things. I tried switching out the references to root to a frame, and moving it into a class. It runs, until you try to make the frame/canvas

Re: transpose array

2009-10-27 Thread Rhodri James
On Tue, 27 Oct 2009 23:09:11 -, Edward A. Falk wrote: In article , yoshco wrote: hello everyone i have 3 arrays xVec=[a1,a2,a3,a4,a5] yVec=[b1.b2.b3.b4.b5] zVec=[c1,c2,c3,c4,c5] and i want to output them to a ascii file like so a1,b1,c1 a2,b2,c2 a3,b3,c3 ... Elegant or obfuscated

Re: transpose array

2009-10-27 Thread Ishwor Gurung
Hi, >> xVec=[a1,a2,a3,a4,a5] >> yVec=[b1.b2.b3.b4.b5] >> zVec=[c1,c2,c3,c4,c5] >> >> and i want to output them to a ascii file like so >> >> a1,b1,c1 >> a2,b2,c2 >> a3,b3,c3 >> ... >> >> now i'm using >> >>    print >>f, str(xVec).replace('[',' ').replace(']', ' ') >>    print >>f, str(yVec).repla

Re: transpose array

2009-10-27 Thread Edward A. Falk
In article , yoshco wrote: >hello everyone >i have 3 arrays >xVec=[a1,a2,a3,a4,a5] >yVec=[b1.b2.b3.b4.b5] >zVec=[c1,c2,c3,c4,c5] > >and i want to output them to a ascii file like so > >a1,b1,c1 >a2,b2,c2 >a3,b3,c3 >... Elegant or obfuscated, you be the judge: vv = [xVec, yVec, zVec] for i

Re: transpose array

2009-10-27 Thread Peter Otten
yoshco wrote: > hello everyone > i have 3 arrays > xVec=[a1,a2,a3,a4,a5] > yVec=[b1.b2.b3.b4.b5] > zVec=[c1,c2,c3,c4,c5] > > and i want to output them to a ascii file like so > > a1,b1,c1 > a2,b2,c2 > a3,b3,c3 > ... > > now i'm using > >print >>f, str(xVec).replace('[',' ').replace(']', '

Re: Embedded python on systems without python installed

2009-10-27 Thread Stef Mientki
KillSwitch wrote: I have python successfully embedded in a program I wrote. What files do I need and where do I need to put them so that it can run on systems that don't have python installed? I embed python in Delphi apps, and the only thing I add is python24.dll, which I put in the same di

Re: Embedded python on systems without python installed

2009-10-27 Thread Stef Mientki
KillSwitch wrote: I have python successfully embedded in a program I wrote. What files do I need and where do I need to put them so that it can run on systems that don't have python installed? I embed python in Delphi apps, and the only thing I add is python24.dll, which I put in the same di

Re: Deeper copy than deepcopy

2009-10-27 Thread Gary Herron
Scott Pakin wrote: copy.deepcopy apparently preserves multiple references to the same object: $ python Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import copy >>> d = [1,

Embedded python on systems without python installed

2009-10-27 Thread KillSwitch
I have python successfully embedded in a program I wrote. What files do I need and where do I need to put them so that it can run on systems that don't have python installed? -- http://mail.python.org/mailman/listinfo/python-list

Re: Deeper copy than deepcopy

2009-10-27 Thread Cameron Simpson
On 28Oct2009 08:23, I wrote: | | I wanted to wind up with r being [[1, 2, 3], [1, 2, 999], [1, 2, 3]]. | | What's the right way to construct r as a list of *independent* d lists? | | Well, you would need to write your own. But consider this: | x = [1, 2] | x.append(x) | Your deepercopy() funct

Re: Form Parsing resouces

2009-10-27 Thread geremy condra
On Tue, Oct 27, 2009 at 5:16 PM, Tim Johnson wrote: > Using python 2.5 on linux. > I am an experienced web programmer. 8 years with python. > I have done the following in other programming languages, but not so far > in python: > > 1)Parse a form into alternating strings and tags. > 2)Convert tags

Re: Web development with Python 3.1

2009-10-27 Thread Diez B. Roggisch
Dotan Cohen schrieb: Well, yes- but it's also DRY, and while DRTW (like the acronym, btw) helps to prevent your code from being unreadable to someone else, DRY helps to ensure that when you have to change something you don't have to worry about changing it in 37 and a half other places at the sam

Re: Web development with Python 3.1

2009-10-27 Thread geremy condra
On Tue, Oct 27, 2009 at 4:52 PM, Dotan Cohen wrote: >> Well, yes- but it's also DRY, and while DRTW (like the acronym, btw) >> helps to prevent your code from being unreadable to someone else, >> DRY helps to ensure that when you have to change something you >> don't have to worry about changing i

Re: Deeper copy than deepcopy

2009-10-27 Thread Cameron Simpson
On 27Oct2009 14:01, Scott Pakin wrote: | copy.deepcopy apparently preserves multiple references to the same object: | | $ python | Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) | [GCC 4.3.2] on linux2 | Type "help", "copyright", "credits" or "license" for more information. |

Form Parsing resouces

2009-10-27 Thread Tim Johnson
Using python 2.5 on linux. I am an experienced web programmer. 8 years with python. I have done the following in other programming languages, but not so far in python: 1)Parse a form into alternating strings and tags. 2)Convert tags into dictionary-like objects. Said process would allow me to the

Re: restriction on sum: intentional bug?

2009-10-27 Thread Steven D'Aprano
On Tue, 27 Oct 2009 05:29:46 -0700, Steve wrote: > To me the current implementation is blatantly correct. sum is an > operation on a list of numeric values, returning a numeric value - this > is why we have the seemingly strange "".join() rather than [].join ("") That is absolutely wrong. sum() w

Re: Inheriting and modifying lots of methods

2009-10-27 Thread Steven D'Aprano
On Tue, 27 Oct 2009 10:43:42 -0700, Felipe Ochoa wrote: > I need to create a subclass from a parent class that has lots of > methods, and need to decorate all of these. Is there pythonic way of > doing this other than: > > def myDecorator (meth): > @wraps(meth) > def newMeth (*args, **kw)

Re: Web development with Python 3.1

2009-10-27 Thread Dotan Cohen
> Well, yes- but it's also DRY, and while DRTW (like the acronym, btw) > helps to prevent your code from being unreadable to someone else, > DRY helps to ensure that when you have to change something you > don't have to worry about changing it in 37 and a half other places > at the same time. Espec

Deeper copy than deepcopy

2009-10-27 Thread Scott Pakin
copy.deepcopy apparently preserves multiple references to the same object: $ python Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import copy >>> d = [1,2,3] >>> r = copy

Re: Pause a thread/ execfile()

2009-10-27 Thread Aahz
In article <352fe298-75b1-4bc3-aca0-ecd0165f5...@h40g2000prf.googlegroups.com>, Babloo wrote: > >i have a small python application with GUI (frontend) which has >various functions. I have a "RUN" button which runs python scripts in >the background . It basically calls execfile() function internal

Re: Web development with Python 3.1

2009-10-27 Thread geremy condra
On Tue, Oct 27, 2009 at 3:11 PM, Dotan Cohen wrote: >> Using a framework helps to ensure that your code is easy to maintain. > > I see, that is a good point. With someone else (the framework > maintainers) worrying about maintaining function such as HTTP request > parsers, a lot of work won't have

Re: What IDE has good git and python support?

2009-10-27 Thread geremy condra
On Tue, Oct 27, 2009 at 11:56 AM, Aweks wrote: > what do you use? > -- > http://mail.python.org/mailman/listinfo/python-list > On console only: vim + screen On X: (vim or gedit) + terminator Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-27 Thread Aaron Watters
On Oct 27, 10:26 am, "Diez B. Roggisch" wrote: ... > Yes, in the end of the day, it's all python. For me, in the end of the day, it's all java or PHP. But I'm working on that. For my purposes the "frameworks" don't really help much. That's why I built WHIFF :). http://aaron.oirt.rutgers.edu/my

Re: What IDE has good git and python support?

2009-10-27 Thread Ryan Lynch
On Tue, Oct 27, 2009 at 12:04, Mick Krippendorf wrote: > Aweks schrieb: >> what do you use? > > Either of the following: > -> Vim + Eclim + Rope + pylint + PyDev + Eclipse + cygwin + WindowsXP > -> Vim + Linux A word of praise/warning about Eclipse: The Python integration is pretty good--I especi

Re: RELEASED Python 2.6.4

2009-10-27 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Barry Warsaw wrote: > On behalf of the Python community, I'm happy to announce the > availability of Python 2.6.4. This is the latest production-ready > version in the Python 2.6 series. > > We had a little trouble with the Python 2.6.3 release;

Re: What IDE has good git and python support?

2009-10-27 Thread TerryP
The best IDE for git and python is bash :-P. I use a mixture of FreeBSD, rxvt-unicode, GNU screen, zsh, vim, git, Python, and Exuberant Ctags. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-27 Thread Dotan Cohen
> Using a framework helps to ensure that your code is easy to maintain. I see, that is a good point. With someone else (the framework maintainers) worrying about maintaining function such as HTTP request parsers, a lot of work won't have to be [re]done. > DRY isn't about saving time now, its abo

Re: Web development with Python 3.1

2009-10-27 Thread geremy condra
On Tue, Oct 27, 2009 at 2:36 PM, Dotan Cohen wrote: >> declarative mapping of urls to code > > Apache does this, unless I am misunderstanding you. > > >> of code to templates > > Those who code in HTML don't need this. In any case it's not hard to > call a function in a class that writes the HTML

Re: What IDE has good git and python support?

2009-10-27 Thread Chris Colbert
it depends on what i'm doing. quick and dirty test script: ipython a larger problem with code I am likely to use later: spyder a multi-module large project (like wrapping opencv): Wing Chris On Tue, Oct 27, 2009 at 5:04 PM, Mick Krippendorf wrote: > Aweks schrieb: >> what do you use? > > Eith

Re: What IDE has good git and python support?

2009-10-27 Thread Joshua Kugler
Aweks wrote: > what do you use? WingIDE has excellent Python support (it's a Python IDE, after all), and the latest version has full support for git. j -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-27 Thread Dotan Cohen
> declarative mapping of urls to code Apache does this, unless I am misunderstanding you. > of code to templates Those who code in HTML don't need this. In any case it's not hard to call a function in a class that writes the HTML before the content, then write the content, then call another fun

Re: Web development with Python 3.1

2009-10-27 Thread Martin v. Löwis
> I am very much new to Python, and one of my first projects is a simple > data-based website. I am starting with Python 3.1 (I can hear many of > you shouting "don't - start with 2.6"), but as far as I can see, none of > the popular python-to-web frameworks (Django, CherryPy, web.py, etc.) > are P

Python + twisted = Raindrop (in part)

2009-10-27 Thread Terry Reedy
Rrom: First look: inside Mozilla's Raindrop messaging platform http://arstechnica.com/open-source/news/2009/10/first-look-inside-mozillas-raindrop-messaging-platform.ars "The backend components that are responsible for retrieving and processing messages are coded in Python on top of the Twisted

Re: IDLE python shell freezes after running show() of matplotlib

2009-10-27 Thread Donny
I have this problem as well. I'm on Windows XP (32-bit x86 processor) using Python 2.6.4 and matplotlib 0.99.1 (installed with matplotlib-0.99.1.win32-py2.6.exe). The IDLE version is 2.6.4. The difficulty occurs for me during the first example of the (official?) Pyplot tutorial at

Re: Inheriting and modifying lots of methods

2009-10-27 Thread Diez B. Roggisch
Felipe Ochoa wrote: > I need to create a subclass from a parent class that has lots of > methods, and need to decorate all of these. Is there pythonic way of > doing this other than: > > def myDecorator (meth): > @wraps(meth) > def newMeth (*args, **kw): > print("Changing some arg

Inheriting and modifying lots of methods

2009-10-27 Thread Felipe Ochoa
I need to create a subclass from a parent class that has lots of methods, and need to decorate all of these. Is there pythonic way of doing this other than: def myDecorator (meth): @wraps(meth) def newMeth (*args, **kw): print("Changing some arguments here.") return meth(ne

Re: ANN: WHIFF += Mako & treeview & url rewrites

2009-10-27 Thread Aaron Watters
On Oct 27, 8:16 am, Aaron Watters wrote: > On Oct 27, 8:02 am, alex23 wrote: > > > If you need a full traceback, let me know. > > Well, yes, the bottom of the traceback would be more useful :). > >    -- Aaron Watters Alex sent me the traceback (thanks!) and after consulting the logs and the pag

ANN: Python course, San Francisco, Nov 9-11

2009-10-27 Thread wesley chun
*FINAL REMINDER* come join us for another hardcore Python training course in San Francisco coming up in a few weeks! we have a few more slots available. bring your co-workers to take advantage of our multiple registration discount. we also feature a steeper discount for those who are primary/secon

Re: What IDE has good git and python support?

2009-10-27 Thread Mick Krippendorf
Aweks schrieb: > what do you use? Either of the following: -> Vim + Eclim + Rope + pylint + PyDev + Eclipse + cygwin + WindowsXP -> Vim + Linux Mick. -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-27 Thread Ethan Furman
Steve wrote: On Oct 17, 8:28 pm, Tim Chase wrote: Christian Heimes wrote: Alan G Isaac wrote: On 10/16/2009 5:03 PM, Christian Heimes wrote: It's not going to happen. That's a prediction, not a justification. It's not a prediction, it's a statement. It's not going to happend because

What IDE has good git and python support?

2009-10-27 Thread Aweks
what do you use? -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and dbf files

2009-10-27 Thread Ethan Furman
John Machin wrote: On Oct 27, 7:15 am, Ethan Furman wrote: > Let me rephrase -- say I get a dbf file with an LDID of \x0f that maps to a cp437, and the file came from a german oem machine... could that file have upper-ascii codes that will not map to anything reasonable on my \x01 cp437 machin

Hide imports from a module

2009-10-27 Thread Jorge
Hi, I'm making an executable fiel (win32) with py2exe. The application is in python 2.6 and uses the firebird driver kinterbasdb. It make the exe but when the application try to use the kinterbasdb module gives this error: No Module named typeconv_24plus in this post http://groups.google.com/group/

Re: restriction on sum: intentional bug?

2009-10-27 Thread Luis Zarrabeitia
On Tuesday 27 October 2009 07:29:46 am Steve wrote: > To me the current implementation is blatantly correct. sum is an > operation on a list of numeric values, returning a numeric value - > this is why we have the seemingly strange "".join() rather than [].join > ("") But then, why does sum() acce

Tryton 1.4 is available

2009-10-27 Thread ced
Tryton is a three-tiers high-level general purpose application platform under the license GPL-3 written in Python and using PostgreSQL as database engine. It is the core base of a complete business solution providing modularity, scalability and security. This new series comes up with new modules,

urllib.FTP.stor...() freeze mystery

2009-10-27 Thread Anthra Norell
Hi, I made a bunch of web pages and am now trying to upload them to a hosting service. I have an ftplib.FTP object that connects just fine. It calls storbinary () and storlines () (as appropriate) inside a loop iterating through my html and jpg files. Calling either of the stor... methods fr

Apologies.. please disregard, delete desktop dating

2009-10-27 Thread Robert LaMarca
Hi... thought i was simply accepting an invitation from a friend on a social network (yes, desktop dating.. no i did no think i was going to date the person.. just thought it was a regular social network thing with an annoying cute name and i was just going to be nice and accept) .. turns

Re: anydbm, gdbm, dbm

2009-10-27 Thread Tim Chase
Lacrima wrote: I want to store some data, using anydbm module. According to docs the object returned by anydbm.open() supports most of the same functionality as dictionaries; keys and their corresponding values can be stored, retrieved, and deleted... I don't understand how I can make a table in

Re: Web development with Python 3.1

2009-10-27 Thread Diez B. Roggisch
Dotan Cohen wrote: > Why the push to use a framework, and why the resistance from the OP? > > Does the OP need to work with cookies or other http-specific features? > In fact, other than cookies, what http-specific features exist? declarative mapping of urls to code, of code to templates, abstra

Re: Web development with Python 3.1

2009-10-27 Thread Dotan Cohen
Why the push to use a framework, and why the resistance from the OP? Does the OP need to work with cookies or other http-specific features? In fact, other than cookies, what http-specific features exist? Does Python have a built-in framework for making available GET and POST variables? Database q

anydbm, gdbm, dbm

2009-10-27 Thread Lacrima
Hello! I want to store some data, using anydbm module. According to docs the object returned by anydbm.open() supports most of the same functionality as dictionaries; keys and their corresponding values can be stored, retrieved, and deleted... I don't understand how I can make a table in DBM data

Re: : yappi v0.2 beta

2009-10-27 Thread Oktaka Com
On Oct 27, 3:51 pm, Oktaka Com wrote: > Hi, > > yappi(Yet Another Python Profiler) is a C extension that have > multithreading profiling capability. Profiler can be started from any > thread at any time. All threads in the attached interpreter will be > profiled. > > Changes: > - 8 multithreading

Re: how to get os.system () call to cooperate on Windows

2009-10-27 Thread TerryP
On Oct 26, 10:00 am, Anthra Norell wrote: > The function "os.system > ('copy file_name directory_name')" turns out doesn't do anything except > flashing a DOS command window for half a second. So my question is: How > can one copy files on the OS level? Under a Windows system the built in command

[ANN]: yappi v0.2 beta

2009-10-27 Thread Oktaka Com
Hi, yappi(Yet Another Python Profiler) is a C extension that have multithreading profiling capability. Profiler can be started from any thread at any time. All threads in the attached interpreter will be profiled. Changes: - 8 multithreading related issues/bugs are fixed. - 1 memory leak(referenc

Re: how to modify row content of file in python?

2009-10-27 Thread Simon Hibbs
On 27 Oct, 07:55, holmes86 wrote: > hi,everyone > > Is there function of modify row content in python? just like 'sed' in > shell,thanks You would do something like this, which acepts a CSV file from stdin and sends the first column to stdout (prints it), which you could redirect to a file or pip

Re: Why is python so sad?

2009-10-27 Thread Donn
> > def ...(...(: > > ... > > class ...(...(: > I disagree. It looks like one smiley is drooling into the other smiley's > mouth. Two smileys, one function? Yuk! That *def*initely has no *class* ... :P \d -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-27 Thread Steve
On Oct 17, 8:28 pm, Tim Chase wrote: > Christian Heimes wrote: > > Alan G Isaac wrote: > >> On 10/16/2009 5:03 PM, Christian Heimes wrote: > >>> It's not going to happen. > >> That's a prediction, not a justification. > > > It's not a prediction, it's a statement. It's not going to happend > > bec

RE: Web development with Python 3.1

2009-10-27 Thread Billy Earney
I would agree with Alan. Most of the libraries you should use are compatible with the 2.x series.. I still use versions 2.5 and 2.6 for all development. From: python-list-bounces+billy.earney=gmail@python.org [mailto:python-list-bounces+billy.earney=gmail@python.org] On Behalf Of Alan

Re: ANN: WHIFF += Mako & treeview & url rewrites

2009-10-27 Thread Aaron Watters
On Oct 27, 8:02 am, alex23 wrote: > If you need a full traceback, let me know. Well, yes, the bottom of the traceback would be more useful :). -- Aaron Watters -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: WHIFF += Mako & treeview & url rewrites

2009-10-27 Thread alex23
Aaron Watters wrote: > I just tried it.  How do you get a traceback?  For me none of the > javascript links work: they just do nothing. I'm getting the same as Paul in Firefox 3.5.3 with javascript disabled: Python 2.5: / usr/local/apache2/bin/httpd Tue Oct 27 07:56:50 2009 A problem occurred

Re: ANN: WHIFF += Mako & treeview & url rewrites

2009-10-27 Thread Aaron Watters
Paul Boddie wrote: > On 27 Okt, 03:49, Aaron Watters wrote: ... > > http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index > > This looks interesting, but when I have JavaScript switched off, I get > a big traceback ... I just tried it. How do you get a traceback? For me none of the javascript l

Re: ANN: WHIFF += Mako & treeview & url rewrites

2009-10-27 Thread Aaron Watters
On Oct 27, 7:04 am, Paul Boddie wrote: > On 27 Okt, 03:49, Aaron Watters wrote: > > > > > WHIFF now includes components for > > implementing "tree views" for web navigation panes > > or other purposes, either using AJAX or frame > > reloads.  Try the GenBank demo at > > >http://aaron.oirt.rutgers

Re: Web development with Python 3.1

2009-10-27 Thread Alan Harris-Reid
Aaron Watters wrote: On Oct 25, 7:52 pm, Alan Harris-Reid wrote: I am very much new to Python, and one of my first projects is a simple data-based website. I am starting with Python 3.1 (I can hear many of you shouting "don't - start with 2.6"), but as far as I can see, none of the popular p

Re: ANN: WHIFF += Mako & treeview & url rewrites

2009-10-27 Thread Paul Boddie
On 27 Okt, 03:49, Aaron Watters wrote: > > WHIFF now includes components for > implementing "tree views" for web navigation panes > or other purposes, either using AJAX or frame > reloads.  Try the GenBank demo at > > http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index This looks interesting, b

Re: Why is python so sad?

2009-10-27 Thread Dotan Cohen
> Maybe we should change it to > > def ...(...(: >     ... > > class ...(...(: I disagree. It looks like one smiley is drooling into the other smiley's mouth. Two smileys, one function? Yuk! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinf

ftpilb.FTP.stor...() freeze mystery

2009-10-27 Thread Anthra Norell
Hi, I am trying to upload a bunch of web pages to a hosting service. I have a connected ftplib.FTP object and can upload files manually from an IDLE command line using the methods storlines () for html files and storbinary () for the pictures. So far no problem. In order to upload the whole s

Re: SQL user function returning list for IN clause

2009-10-27 Thread Lawrence D'Oliveiro
In message , Felix wrote: > I want to run a query like > > select * from table a, table b where a.foo IN foobar(b.bar) > > where foobar is a user function (registered by create_function in > pysqlite3) returning a list of integers. However such functions can > only return basic data types so the

Re: best vi / emacs python features

2009-10-27 Thread Lawrence D'Oliveiro
In message , Jean-Michel Pichavant wrote: > Being a vi fan, I can just tell you that emacs is for loosers, and no > one will dare to challenge this. Is it better to be loose or tight? -- http://mail.python.org/mailman/listinfo/python-list

Re: PSP problem showing images

2009-10-27 Thread Alfons Nonell-Canals
Hi Lawrence, Yes, I've tried it! I've saw the code, copyed the src path ans pasted into the browser and it works. I think it not works only unther a psp hostname/directory, for this reason I thought the problem is in the apache2 (site) configuration pasted in my mail... Thanks! Alfons. Lawrence

Re: PSP problem showing images

2009-10-27 Thread Lawrence D'Oliveiro
In message , Alfons Nonell-Canals wrote: > I developed a script which generates some images (is a work about > Chemistry) and returns a page with some results and these images. When I > run the script from the web browser, "all" works fine: the images are > created, some other staff is calculated

Re: a simple unicode question

2009-10-27 Thread Lie Ryan
Chris Jones wrote: On Wed, Oct 21, 2009 at 12:35:11PM EDT, Nobody wrote: [..] Characters outside the 16-bit range aren't supported on all builds. They won't be supported on most Windows builds, as Windows uses 16-bit Unicode extensively: I knew nothing about UTF-16 & friends before this thre

Re: lmlx & & caracter

2009-10-27 Thread Stefan Behnel
Toff, 27.10.2009 10:14: > o = open("output.txt","w") > data = open(filename).read() > o.write( re.sub('&(?!amp;|quot;|nbsp;|gt;|lt;|laquo;| > raquo;|copy;|reg;|bul;|rsquo;)', '&', data) ) > o.close() > shutil.move > ("o

Re: Problem embedding Python.

2009-10-27 Thread Brandon Keown
I found the problem. Evidently as posted on a few other areas of the internet, this is a common problem when trying to use compilers that may have different type definitions for (FILE*). Here is workable solution: #include int main(int argc, char* argv[]) { PyObject* PyFileObject;

PSP problem showing images

2009-10-27 Thread Alfons Nonell-Canals
Hello, I have experience working with Python an dnow I would like to use it for web development. I worked with php from several years ago and I'm trying to move to PSP. I have no problem runing some tests, implement an small project with psp is pretty easy. But I have only one problem, me scrips do

Re: how to modify row content of file in python?

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 05:50:47 -0300, Lutz Horn escribió: * holmes86 [Tue, 27 Oct 2009 00:55:36 -0700]: Is there function of modify row content in python? just like 'sed' in shell,thanks Sed doesn't actually modify the contents of a file. In normal operation mode it reads from STDIN and writ

Re: Problem embedding Python.

2009-10-27 Thread Brandon Keown
On Oct 27, 2:47 am, "Gabriel Genellina" wrote: > > Crashes, how? Try running inside a debugger to see where it crashes, or at   > least put a few printf. > You didn't test for the fopen result; are you sure "test.py" exists in the   > current directory at the time you run it? > > -- > Gabriel Gene

  1   2   >