Re: How to know locals of script without running it

2009-10-26 Thread Gabriel Genellina
En Mon, 26 Oct 2009 14:06:22 -0300, Nadav Chernin escribió: Is there a way to know locals of the script without running it? I don't quite understand the question, could you explain it? A concrete example would help. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python

Re: why python cache the string > 256?

2009-10-26 Thread Gabriel Genellina
En Mon, 26 Oct 2009 23:42:54 -0300, s7v7nislands escribió: On Oct 27, 4:03 am, "Diez B. Roggisch" wrote: s7v7nislands schrieb: > test.py > #!/usr/bin/python > a = [] > for i in xrange(100): > a.append('a'*500) > $python -i test.py #virt mem 514m in top output >>> del a

Problem embedding Python.

2009-10-26 Thread Brandon Keown
I am going to try to embed python in an application, but in simple testing, I could not get it to work. The following code seems like it should work, but it crashes, and I have tried several things. What could I be doing wrong? #include int main(int argc, char* argv[]) { FILE* fp = fop

Re: Surprising timeit result

2009-10-26 Thread Steven D'Aprano
On Tue, 27 Oct 2009 04:36:12 +, John O'Hagan wrote: > I sometimes use timeit to see if it's better to check if something needs > doing, or to just do it anyway. This result was surprising: > > setup = 'd1 = {"a":0, "b":0}; d2 = {"a":0, "b":1}' > > Timer('d1.update(d2)', setup).timeit() 2.64

Re: Surprising timeit result

2009-10-26 Thread John O'Hagan
On Tue, 27 Oct 2009, Paul Rubin wrote: > "John O'Hagan" writes: > > Timer('d1.update(d2)', setup).timeit() > > 2.6499271392822266 > > > > Timer('if d1 != d2: d1.update(d2)', setup).timeit() > > 1.0235211849212646 > > > > In other words, in this case it's substantially quicker to check for > > some

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

2009-10-26 Thread Kushal Kumaran
On Tue, Oct 27, 2009 at 2:04 AM, Anthra Norell wrote: > > > No, I didn't. There's a number of modules I know by name only and shutils > was one of them. A quick peek confirmed that it is exactly what I am looking > for. Thank you very much for the advice. > Then Doug Hellmann's PyMOTW is for you

Re: Surprising timeit result

2009-10-26 Thread Paul Rubin
"John O'Hagan" writes: > Timer('d1.update(d2)', setup).timeit() > 2.6499271392822266 > > Timer('if d1 != d2: d1.update(d2)', setup).timeit() > 1.0235211849212646 > > In other words, in this case it's substantially quicker to check for > something and then proceed, than it is to just proceed! I'm

Re: python web service or Apache?

2009-10-26 Thread Gabriel Genellina
En Sun, 25 Oct 2009 17:47:43 -0300, Peng Yu escribió: Although, python can be used to provide web service. The following webpage also mentioned, "Apache the best and most widely used web server on the Internet today, check it out. If you want to run your own web server this is the one to get, y

Surprising timeit result

2009-10-26 Thread John O'Hagan
I sometimes use timeit to see if it's better to check if something needs doing, or to just do it anyway. This result was surprising: setup = 'd1 = {"a":0, "b":0}; d2 = {"a":0, "b":1}' Timer('d1.update(d2)', setup).timeit() 2.6499271392822266 Timer('if d1 != d2: d1.update(d2)', setup).timeit()

Re: quit button

2009-10-26 Thread Gabriel Genellina
En Sat, 24 Oct 2009 23:59:06 -0300, linda.s escribió: When I click "quit" button, why the following code has problem? [...] if __name__ == '__main__': root = Tk() gridbox(Toplevel()) packbox(Toplevel()) Button(root, text='Quit', command=root.quit).pack() mainloop() If

Re: Problem with urllib2.urlopen() opening a local file

2009-10-26 Thread Gabriel Genellina
En Sat, 24 Oct 2009 20:10:21 -0300, deja user escribió: I want to use urlopen() to open either a http://... file or a local file File:C:/... I don't have problems opening and reading the file either way. But when I run the script on a server (ArcGIS server), the request won't complete if it

Re: Adding a menu to Tkinter

2009-10-26 Thread John Posner
Ronn Ross wrote: I'm attempting to add a menu bar to my Tkinter app. I can't figure out the correct syntax. Can someone help? I get this error when I run the app: Traceback (most recent call last): File "tkgrid.py", line 26, in app = App(root) File "tkgrid.py", line 10, in __init__

Re: Web development with Python 3.1

2009-10-26 Thread Aaron Watters
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 python-to-web framew

ANN: WHIFF += Mako & treeview & url rewrites

2009-10-26 Thread Aaron Watters
WHIFF 0.6 RELEASED WHIFF += Mako & treeview & url rewrites WHIFF is a collection of support services for Python/WSGI Web applications which allows applications to be composed by "dropping" dynamic pages into container directories. This mode of development will be familiar to developers who have

Re: why python cache the string > 256?

2009-10-26 Thread s7v7nislands
On Oct 27, 4:03 am, "Diez B. Roggisch" wrote: > s7v7nislands schrieb: > > > > > hi all: > > > test.py > > #!/usr/bin/python > > a = [] > > for i in xrange(100): > >     a.append('a'*500) > > > $python -i test.py     #virt mem 514m in top output > >>> del a                   #virt mem 510m > >

Re: Adding a menu to Tkinter

2009-10-26 Thread MRAB
Ronn Ross wrote: I'm attempting to add a menu bar to my Tkinter app. I can't figure out the correct syntax. Can someone help? I get this error when I run the app: Traceback (most recent call last): File "tkgrid.py", line 26, in app = App(root) File "tkgrid.py", line 10, in __init__

Adding a menu to Tkinter

2009-10-26 Thread Ronn Ross
I'm attempting to add a menu bar to my Tkinter app. I can't figure out the correct syntax. Can someone help? I get this error when I run the app: Traceback (most recent call last): File "tkgrid.py", line 26, in app = App(root) File "tkgrid.py", line 10, in __init__ menubar = Menu(mas

Re: Web development with Python 3.1

2009-10-26 Thread Alan Harris-Reid
Hi Paul, thanks for the reply (despite the sarcasm ;-) ), >Does it occur to you that the unavailability of those frameworks is part of the REASON they say to use 2.x? Of course, but that doesn't mean that there isn't someone out there who may know of a framework that is already Python3 compati

Re: Is there a command that returns the number of substrings in a string?

2009-10-26 Thread alex23
Gerard Flanagan wrote: > def count(text, *args): Other than the ability to handle multiple substrings, you do realise you've effectively duplicated str.count()? -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-26 Thread Alan Harris-Reid
Anyway, for simple web programming, frameworks are not worth the hassle. Just use the cgi module. I can vouch for what Paul says. I started in Python 3 years ago, and I did so with a web application (still working on it!). I'm using the cgi approach, and it certainly teaches you th

Re: Web development with Python 3.1

2009-10-26 Thread Alan Harris-Reid
Exarkun - thanks for the reply > don't - start with 2.6 Thought you might say that ;-) Regards, Alan On 25 Oct, 11:52 pm, a...@baselinedata.co.uk 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

Re: Does someone has a 5-line working example of SOAP server request ?

2009-10-26 Thread Dan Sommers
On Tue, 27 Oct 2009 01:45:09 +0100, Stef Mientki wrote: > So could someone tell me what libraries I need to perform a SOAP > query ? ... Check out suds (https://fedorahosted.org/suds/). > Is there a 5-line (Dive into Python had a 4-line example ;-) that can > show the SOAP query is working ? My

Does someone has a 5-line working example of SOAP server request ?

2009-10-26 Thread Stef Mientki
hello, I want to ask some simple queries to a SOAP server ( through wdsl). The ICT department advised me to use a dot-net environment, because that should be able to handle wdsl automatically. As I have a quite large Python desktop application and I still don't understand what a "dot-net prog

Re: unicode and dbf files

2009-10-26 Thread John Machin
On Oct 27, 7:15 am, Ethan Furman wrote: > John Machin wrote: > > On Oct 27, 3:22 am, Ethan Furman wrote: > > >>John Machin wrote: > > >>>Try this: > >>>http://webhelp.esri.com/arcpad/8.0/referenceguide/ > > >>Wow.  Question, though:  all those codepages mapping to 437 and 850 -- > >>are they real

Re: Socket logic problem

2009-10-26 Thread John O'Hagan
On Sun, 25 Oct 2009, Gabriel Genellina wrote: > En Sat, 24 Oct 2009 06:40:08 -0300, John O'Hagan > > escribió: > > I have several instances of the same generator function running > > simultaneously, some within the same process, others in separate > > processes. I > > want them to be able to shar

playing mp3

2009-10-26 Thread Jabba Laci
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. Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/python-list

Re: a splitting headache

2009-10-26 Thread Mensanator
On Oct 26, 7:28 am, Vlastimil Brom wrote: > 2009/10/26 jhermann : > > > > > > > On 16 Okt., 02:18, Mensanator wrote: > >> All I wanted to do is split a binary number into two lists, > >> a list of blocks of consecutive ones and another list of > >> blocks of consecutive zeroes. > > > Back to the

RELEASED Python 2.6.4

2009-10-26 Thread Barry Warsaw
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; a number of unfortunate regressions were introduced. I take responsibilit

Re: Read any function in runtime

2009-10-26 Thread Jack Norton
Matt McCredie wrote: Rhodri James wildebst.demon.co.uk> writes: On Fri, 23 Oct 2009 17:39:40 +0100, Matt McCredie gmail.com> wrote: joao abrantes gmail.com> writes: Hey. I want to make a program like this:print "Complete the function f(x)="then the user would en

Re: handling PAMIE and lxml

2009-10-26 Thread elca
Simon Forman-2 wrote: > > On Mon, Oct 26, 2009 at 3:05 AM, elca wrote: >> >> Hello, >> i was open anther new thread ,old thread is too long. > > Too long for what? > >> first of all,i really appreciate other many people's help in this >> newsgroup. >> im making webscraper now. >> but still p

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

2009-10-26 Thread Anthra Norell
Diez B. Roggisch wrote: Anthra Norell wrote: I have a Python program that needs to copy files around. I could read and write which would be inefficient and would time-stamp the copy. The module "os" has lots of operating system functions, but none that copies files I could make out reading t

Re: Please help with regular expression finding multiple floats

2009-10-26 Thread Jeremy
On Oct 24, 12:00 am, Edward Dolan wrote: > No, you're not missing a thing. I am ;) Something was happening with > the triple-quoted > strings when I pasted them. Here is hopefully, the correct > code.http://codepad.org/OIazr9lA > The output is shown on that page as well. > > Sorry for the line no

Re: virtualenv under Win7: easy_install fails in virtual environments

2009-10-26 Thread Michel Claveau - MVP
Hi! Try to unactive UAC... @+ -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and dbf files

2009-10-26 Thread Ethan Furman
John Machin wrote: On Oct 27, 3:22 am, Ethan Furman wrote: John Machin wrote: Try this: http://webhelp.esri.com/arcpad/8.0/referenceguide/ Wow. Question, though: all those codepages mapping to 437 and 850 -- are they really all the same? 437 and 850 *are* codepages. You mean "all those

Re: why python cache the string > 256?

2009-10-26 Thread Diez B. Roggisch
s7v7nislands schrieb: hi all: test.py #!/usr/bin/python a = [] for i in xrange(100): a.append('a'*500) $python -i test.py #virt mem 514m in top output del a #virt mem 510m why python cache these string? In source, I see when object size > SMALL_REQUEST_THRESHOL

Re: Python 3.1.1 bytes decode with replace bug

2009-10-26 Thread Joe
Thanks Mark, that is a great suggestion! > You can also replace the Unicode replacement character U+FFFD with a valid > cp437 character before displaying it: > > >>> b'\x80abc'.decode('utf8','replace').replace('\ufffd','?') > > '?abc' > -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.1.1 bytes decode with replace bug

2009-10-26 Thread Joe
Thanks Benjamin for solving the mystery of where the cp437 usage was coming from. So b'\x80abc'.decode("utf-8", "replace") was working properly but then when the interactive prompt tried to print it, it was basically taking the results and doing a encode('cp437', 'strict') which failed because of

Re: Why is python so sad?

2009-10-26 Thread Matias Ribecky
On Wed, Oct 14, 2009 at 2:16 PM, Chris Withers wrote: > Zac Burns wrote: > >> There are 10741 occurences of ): or :( in our source code and only 2 >> occurrences of :) or (:. Not what you would expect from a language >> named after a comedian. >> > > def ...(...): > ... > > class ...(...): > ...

Re: unicode and dbf files

2009-10-26 Thread John Machin
On Oct 27, 3:22 am, Ethan Furman wrote: > John Machin wrote: > > On Oct 24, 4:14 am, Ethan Furman wrote: > > >>John Machin wrote: > > >>>On Oct 23, 3:03 pm, Ethan Furman wrote: > > John Machin wrote: > > >On Oct 23, 7:28 am, Ethan Furman wrote: > > > Try this: > >http://webhelp.esri.com

Re: Python IDE

2009-10-26 Thread TerryP
On Oct 26, 11:57 am, Girish wrote: > Hello, Which is the best software to create GUI other then Boa. > > Thanks, > Girish. Any editor can be used to create a "GUI" program in Python. Beyond that it depends on what you are using; since you stated Boa, I assume WxPython - so take a look at WxGlade.

Re: python web service or Apache?

2009-10-26 Thread Paul Rubin
ru...@yahoo.com writes: > Apache requires root access to the server machine, Only to access the privileged ports. > A small simple custom web server built with Python will likely... > You can run it on a non-privileged port if you do not have > root access to your server machine. You can do that

Re: python web service or Apache?

2009-10-26 Thread rurpy
On 10/26/2009 08:00 AM, Peng Yu wrote: > On Sun, Oct 25, 2009 at 11:09 PM, Simon Forman wrote: >> On Sun, Oct 25, 2009 at 4:47 PM, Peng Yu wrote: >>> Although, python can be used to provide web service. The following >>> webpage also mentioned, "Apache the best and most widely used web >>> server

Re: handling PAMIE and lxml

2009-10-26 Thread Simon Forman
On Mon, Oct 26, 2009 at 3:05 AM, elca wrote: > > Hello, > i was open anther new thread ,old thread is too long. Too long for what? > first of all,i really appreciate other many people's help in this newsgroup. > im making webscraper now. > but still problem with my script source. > http://elca.p

Re: Strangeness: Cannot write to a file from a process created by Windows Task Scheduler ...

2009-10-26 Thread MRAB
Sandy Walsh wrote: Yes it seems to be a flush problem. Strange how it doesn't require the explicit flush() when the console window appears, but does otherwise. Either way, it gives me a good direction to chase after. [snip] It buffers for efficiency reasons, but if it can detect that it's con

Re: Strangeness: Cannot write to a file from a process created by Windows Task Scheduler ...

2009-10-26 Thread Sandy Walsh
Thanks Marco & Al, Yes it seems to be a flush problem. Strange how it doesn't require the explicit flush() when the console window appears, but does otherwise. Either way, it gives me a good direction to chase after. Thanks again for your quick help guys! -Sandy Marco Bizzarri wrote: You c

Re: Python 2.6 Deprecation Warnings with __new__ — Can someone explain why?

2009-10-26 Thread Simon Forman
On Mon, Oct 26, 2009 at 12:04 AM, rh0dium wrote: [snip] > > > Now the real question I have on this is scalability.  The real What you're describing isn't "scalability". It could be called "extensibility". > advantage to using *args and **kwargs is that down the road (through > inheritance/polym

Re: Strangeness: Cannot write to a file from a process created by Windows Task Scheduler ...

2009-10-26 Thread MRAB
Sandy Walsh wrote: Hi there, Seeing some really weird behavior and perhaps someone has seen something similar: I have a python script that launches as a Windows Scheduled Task. The program simply opens a disk file and writes some text to it: --- f = open("waiting.txt", "w") x = 0 while 1:

Re: Strangeness: Cannot write to a file from a process created by Windows Task Scheduler ...

2009-10-26 Thread Marco Bizzarri
You could try to flush the file? Maybe it would flush once you close, which never happens; did you try to limit the amount of times it run inside the 'while' loop? Regards Marco On Mon, Oct 26, 2009 at 6:17 PM, Sandy Walsh wrote: > Hi there, > > Seeing some really weird behavior and perhaps so

Re: Strangeness: Cannot write to a file from a process created by Windows Task Scheduler ...

2009-10-26 Thread Al Fansome
Do you "import time"? Sandy Walsh wrote: Hi there, Seeing some really weird behavior and perhaps someone has seen something similar: I have a python script that launches as a Windows Scheduled Task. The program simply opens a disk file and writes some text to it: --- f = open("waiting.txt

Re: python web service or Apache?

2009-10-26 Thread Simon Forman
On Mon, Oct 26, 2009 at 10:00 AM, Peng Yu wrote: > On Sun, Oct 25, 2009 at 11:09 PM, Simon Forman wrote: >> On Sun, Oct 25, 2009 at 4:47 PM, Peng Yu wrote: >>> Although, python can be used to provide web service. The following >>> webpage also mentioned, "Apache the best and most widely used web

Re: C++: Py_CompileString crash

2009-10-26 Thread KillSwitch
On Oct 26, 10:06 am, Christian Heimes wrote: > KillSwitch wrote: > > int main(int argc, char *argv[]) > > { > >    Py_Initialize(); > > >    const char* filename = "asdf.py"; > > >    const char* str = "print('lol')"; > > >    Py_CompileString(str, filename, 0); > > >    Py_Finalize(); > >    syst

Strangeness: Cannot write to a file from a process created by Windows Task Scheduler ...

2009-10-26 Thread Sandy Walsh
Hi there, Seeing some really weird behavior and perhaps someone has seen something similar: I have a python script that launches as a Windows Scheduled Task. The program simply opens a disk file and writes some text to it: --- f = open("waiting.txt", "w") x = 0 while 1: f.write("Sleeping

"(8)Exec format error: exec of" a java script file

2009-10-26 Thread Bhanu Mangipudi
Hi all, When I am trying to access a javascript file I am getting an error like this "(8)Exec format error: exec of '/var/www/cgi-bin/website/js/layout.js' failed, referer: http://localhost/cgi-bin/website/index.py";. Can any one please help me how to fix this error ?? Thanks Bhanu -- http://ma

Re: C++: Py_CompileString crash

2009-10-26 Thread Christian Heimes
KillSwitch wrote: > int main(int argc, char *argv[]) > { > Py_Initialize(); > > const char* filename = "asdf.py"; > > const char* str = "print('lol')"; > > Py_CompileString(str, filename, 0); > > Py_Finalize(); > system("PAUSE"); > return 0; > } > > On

How to know locals of script without running it

2009-10-26 Thread Nadav Chernin
Hi, all Is there a way to know locals of the script without running it? Thanks, Nadav -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding slice notation to iterators/generators?

2009-10-26 Thread Anh Hai Trinh
I've written something that is better than you could've imagine. Get it here: It works with anything iterable, no need to alter anything. from itertools import count from stream import item c = count() c >> item[1:10:2] ->[1, 3, 5, 7, 9] c >> item[:5]

C++: Py_CompileString crash

2009-10-26 Thread KillSwitch
I run this code in VC++: #include #include #include using namespace std; int main(int argc, char *argv[]) { Py_Initialize(); const char* filename = "asdf.py"; const char* str = "print('lol')"; Py_CompileString(str, filename, 0); Py_Finalize();

Re: unicode and dbf files

2009-10-26 Thread Ethan Furman
John Machin wrote: On Oct 24, 4:14 am, Ethan Furman wrote: John Machin wrote: On Oct 23, 3:03 pm, Ethan Furman wrote: John Machin wrote: On Oct 23, 7:28 am, Ethan Furman wrote: Greetings, all! I would like to add unicode support to my dbf project. The dbf header has a one-byte

Re: Read any function in runtime

2009-10-26 Thread Matt McCredie
Rhodri James wildebst.demon.co.uk> writes: > > On Fri, 23 Oct 2009 17:39:40 +0100, Matt McCredie gmail.com> > wrote: > > > joao abrantes gmail.com> writes: > > > >> > >> Hey. I want to make a program like this:print "Complete the function > > f(x)="then the user would enter x+2 or 1/x or an

Re: Building static Python binary

2009-10-26 Thread mk
P.S. If I add -static to LDFLAGS in Makefile, I get this: gcc -pthread -static -Xlinker -export-dynamic -o python \ Modules/python.o \ libpython2.6.a -lpthread -ldl -lutil -L/usr/local/ssl/lib -lssl -lcrypto -lm libpython2.6.a(dynload_shlib.o

Re: Pause a thread/ execfile()

2009-10-26 Thread Terry Reedy
Babloo wrote: Any ideas how to pause execfile()? As far as the calling instance of the Python interpreter is concerned, calling execfile (or any C function) is an atomic action. You need to rewrite the code in the file executed to have it monitor a semaphore. -- http://mail.python.org/mai

Re: Pause a thread/ execfile()

2009-10-26 Thread Sean DiZazzo
On Oct 26, 1:25 am, Babloo wrote: > On Oct 26, 1:01 pm, Sean DiZazzo wrote: > > > > > On Oct 25, 11:58 pm, 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 b

Re: Python 2.6 Deprecation Warnings with __new__ — Can someone expla in why?

2009-10-26 Thread Terry Reedy
Carl Banks wrote: So what is the point of using __new__? .__new__ creates new objects. It also inializes 'immutable' objects. It's mostly for types written in C, or for subclassing types written in C. Specifically, for subclassing immutable classes where one wants initialization behavior

Building static Python binary

2009-10-26 Thread mk
Hello, I have trouble building Python static binary (for use with 'freeze.py', as frozen Python programs do not include dynamically linked libs). Anybody? ./configure --disable-shared --with-ldflags=-ldl And yet after compiling the resulting binary is linked with following dynamic libraries:

Re: OT Virtual Server Host

2009-10-26 Thread Victor Subervi
You're saving my neck, man. Thanks!!! V On Mon, Oct 26, 2009 at 11:10 AM, Ryan Lynch wrote: > On Mon, Oct 26, 2009 at 10:56, Victor Subervi > wrote: > > YES, that is what I want! How do I google this service? Or just flat-out > > recommend one for me (or both). Googling "high-end virtual dedica

Re: efficient running median

2009-10-26 Thread denis
Based on Perreault + Hebert, here's python code for a rather different algorithm: - for quantized e.g. 8-bit data - runs faster for wider windows / slowly changing medians - no heaps, no trees: the only import is numpy, and even that's not essential http://stackoverflow.com/questions/1309263/rolli

Re: Why is python so sad?

2009-10-26 Thread Erez
That statistics may seem slightly more optimistic if you also count [: and :] -- http://mail.python.org/mailman/listinfo/python-list

Re: OT Virtual Server Host

2009-10-26 Thread Ryan Lynch
On Mon, Oct 26, 2009 at 10:56, Victor Subervi wrote: > YES, that is what I want! How do I google this service? Or just flat-out > recommend one for me (or both). Googling "high-end virtual dedicated > servers" gave me *one* company...in England. I'd prefer the states (or > Caribbean, where I resid

Re: OT Virtual Server Host

2009-10-26 Thread Victor Subervi
YES, that is what I want! How do I google this service? Or just flat-out recommend one for me (or both). Googling "high-end virtual dedicated servers" gave me *one* company...in England. I'd prefer the states (or Caribbean, where I reside). Thanks, V On Sun, Oct 25, 2009 at 10:55 PM, geremy condra

RE: Copying a ZipExtFile

2009-10-26 Thread Moore, Mathew L
> En Fri, 23 Oct 2009 14:15:33 -0300, Moore, Mathew L > > escribió: > > > with io.BytesIO() as memio: > > shutil.copyfileobj(f, memio) > > zip = zipfile.ZipFile(file=memio) > > # Can't use zip.extract(), because I want to ignore paths > > # within archive. > >

Re: Web development with Python 3.1

2009-10-26 Thread Echo
bottle (http://bottle.paws.de/) can run on python 3.1 after running the 2to3 tool on it. It is a very lightweight framework. CherryPy 3.2 also runs on python 3.x I don't know if there are any others. On Sun, Oct 25, 2009 at 7:52 PM, Alan Harris-Reid wrote: > > I am very much new to Python, and o

Re: python web service or Apache?

2009-10-26 Thread Peng Yu
On Sun, Oct 25, 2009 at 11:09 PM, Simon Forman wrote: > On Sun, Oct 25, 2009 at 4:47 PM, Peng Yu wrote: >> Although, python can be used to provide web service. The following >> webpage also mentioned, "Apache the best and most widely used web >> server on the Internet today, check it out. If you

Re: a splitting headache

2009-10-26 Thread Vlastimil Brom
2009/10/26 jhermann : > On 16 Okt., 02:18, Mensanator wrote: >> All I wanted to do is split a binary number into two lists, >> a list of blocks of consecutive ones and another list of >> blocks of consecutive zeroes. > > Back to the OP's problem, the obvious (if you know the std lib) and > easy so

Python IDE

2009-10-26 Thread Girish
Hello, Which is the best software to create GUI other then Boa. Thanks, Girish. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-26 Thread Chris Withers
Brendon Wickham wrote: I can vouch for what Paul says. I started in Python 3 years ago, and I did so with a web application (still working on it!). I'm using the cgi approach, and it certainly teaches you the concepts. I fail to see how starting with a framework is a good idea if you don't know

Re: Read any function in runtime

2009-10-26 Thread Rhodri James
On Fri, 23 Oct 2009 17:39:40 +0100, Matt McCredie wrote: joao abrantes gmail.com> writes: Hey. I want to make a program like this:print "Complete the function f(x)="then the user would enter x+2 or 1/x or any other function that only uses the variable x. Then my python program would cal

Re: Is there a command that returns the number of substrings in a string?

2009-10-26 Thread Gerard Flanagan
Peng Yu wrote: For example, the long string is 'abcabc' and the given string is 'abc', then 'abc' appears 2 times in 'abcabc'. Currently, I am calling 'find()' multiple times to figure out how many times a given string appears in a long string. I'm wondering if there is a function in python which

Re: a splitting headache

2009-10-26 Thread jhermann
On 16 Okt., 02:18, Mensanator wrote: > All I wanted to do is split a binary number into two lists, > a list of blocks of consecutive ones and another list of > blocks of consecutive zeroes. Back to the OP's problem, the obvious (if you know the std lib) and easy solution is: >>> c = '0010100

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

2009-10-26 Thread Diez B. Roggisch
Anthra Norell wrote: > I have a Python program that needs to copy files around. I could read > and write which would be inefficient and would time-stamp the copy. The > module "os" has lots of operating system functions, but none that copies > files I could make out reading the doc twice. The func

Problem while using xml.dom.minidom

2009-10-26 Thread bhaskar jain
Hello all, I am using xml.dom.minidom for creating a SAML metadata file which is an xml file. Code - import xml.dom.minidom as md doc = md.Document() entity_descr = doc.createElement("EntityDescriptor") doc.appendChild(entity_descr) entity_descr.setAttribute('xmlns', 'u

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

2009-10-26 Thread Anthra Norell
I have a Python program that needs to copy files around. I could read and write which would be inefficient and would time-stamp the copy. The module "os" has lots of operating system functions, but none that copies files I could make out reading the doc twice. The function "os.system ('copy fil

Re: Python GUI

2009-10-26 Thread eb303
On Oct 26, 3:53 am, Grant Edwards wrote: > On 2009-10-26, Philip Semanchuk wrote: > > > > > On Oct 25, 2009, at 8:39 PM, Ronn Ross wrote: > > >> I need to create a gui for python. I'm looking for something that is > >> easy to > >> learn and cross platform. Any suggestions? If you have any good >

why python cache the string > 256?

2009-10-26 Thread s7v7nislands
hi all: test.py #!/usr/bin/python a = [] for i in xrange(100): a.append('a'*500) $python -i test.py #virt mem 514m in top output >>del a #virt mem 510m why python cache these string? In source, I see when object size > SMALL_REQUEST_THRESHOLD, python would use mall

Best way to configure a logger hierarchy (was Re: A new way to configure Python logging)

2009-10-26 Thread Jean-Michel Pichavant
Vinay Sajip wrote: Wolodja Wentland cl.uni-heidelberg.de> writes: -- I usually register a logger 'foo' within the application and one logger for each module in the package, so the resulting logger hierarchy will look like this: foo |__bar |__baz |__n

Re: Pause a thread/ execfile()

2009-10-26 Thread Babloo
On Oct 26, 1:01 pm, Sean DiZazzo wrote: > On Oct 25, 11:58 pm, 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 internally >

Re: Pause a thread/ execfile()

2009-10-26 Thread Babloo
On Oct 26, 1:11 pm, Saju Pillai wrote: > On 26/10/09 12:28 PM, 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 internally > > wh

Re: Pause a thread/ execfile()

2009-10-26 Thread Saju Pillai
On 26/10/09 12:28 PM, 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 internally which runs in a thread , to run the python script . I want

Re: Pause a thread/ execfile()

2009-10-26 Thread Sean DiZazzo
On Oct 25, 11:58 pm, 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 internally > which runs in a thread ,  to run the python script . >

Pause a thread/ execfile()

2009-10-26 Thread Babloo
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 internally which runs in a thread , to run the python script . I want to implement a "PAUSE" feature which

handling PAMIE and lxml

2009-10-26 Thread elca
Hello, i was open anther new thread ,old thread is too long. first of all,i really appreciate other many people's help in this newsgroup. im making webscraper now. but still problem with my script source. http://elca.pastebin.com/m52e7d8e0 i was upload my script in here. so anybody can modify it.

Re: how can i use lxml with win32com?

2009-10-26 Thread elca
motoom wrote: > > elca wrote: > >> http://news.search.naver.com/search.naver?sm=tab_hty&where=news&query=korea+times&x=0&y=0 >> that is korea portal site and i was search keyword using 'korea times' >> and i want to scrap resulted to text name with 'blogscrap_save.txt' > > Aha, now we're gett