Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Peter Otten
Sullivan WxPyQtKinter wrote: > I have a huge log file which contains 3,453,299,000 lines with > different lengths. It is not possible to calculate the absolute > position of the beginning of the one billionth line. Are there > efficient way to seek to the beginning of that line in python? > > Thi

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Jay Loden
Paul Rubin wrote: > Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: >> This program: >> for i in range(10): >> f.readline() >> is absolutely every slow > > There are two problems: > > 1) range(10) builds a list of a billion elements in memory, > which is many gig

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread kj7ny
On Aug 7, 10:09 pm, Jay Loden <[EMAIL PROTECTED]> wrote: > kj7ny wrote: > > Is there a way that I can programmatically find the name of a method I > > have created from within that method? I would like to be able to log > > a message from within that method (def) and I would like to include > > th

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread Peter Otten
kj7ny wrote: > What is @checkPrivs (see example copied below from other post)? In > fact... how does the thing work at all? > @checkPrivs > def add(a,b): > return a+b @... is called a decorator and is just a fancy way of writing def add(a, b): return a+b add = checkPrivs(add) Peter -

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread M�ta-MCI (MVP)
Hi! Create a "index" (a file with 3,453,299,000 tuples : line_number + start_byte) ; this file has fix-length lines. slow, OK, but once. Then, for every consult/read a specific line: - direct acces read on index - seek at the fisrt byte of the line desired @+ Michel Claveau -- http://

Re: Heterogeneous lists

2007-08-08 Thread Hendrik van Rooyen
"Gordon Airporte" > This is one of those nice, permissive Python features but I was > wondering how often people actually use lists holding several different > types of objects. I do it all the time - I only use tuples when I _have_ to. > It looks like whenever I need to group different objec

Re: Issues of state (was: Tkinter or wxpython?)

2007-08-08 Thread Hendrik van Rooyen
"Paul Rubin" wrote: > [EMAIL PROTECTED] (Cameron Laird) writes: > > >application in the web app model (I haven't even touched on the whole > > >stateless HTTP being mapped to a stateful environment issue, or the > > >need to manage the local web server) actually buys you anything. I > > . > > Go

setuptools

2007-08-08 Thread vedrandekovic
Hello, If anybody have experiences with setuptools, I was download bbfreeze-0.95.2-py2.4-win32.egg and when I run installation with cmd: $ easy_install bbfreeze-0.95.2-py2.4-win32.egg Processing bbfreeze-0.95.2-py2.4-win32.egg Removing c:\Python24\lib\site-packages\bbfreeze-0.95.2-py2.4-win32.e

Re: passing vars to py scipts in cron jobs

2007-08-08 Thread Noud Aldenhoven
On 8/7/07, Will Maier <[EMAIL PROTECTED]> wrote: > > On Tue, Aug 07, 2007 at 05:45:46PM -0400, brad wrote: > > What's the proper way to call a py script and pass in variables > > while doing cron jobs? I can run the scripts fine from idle, > > python, etc using raw_input() to prompt users. The scri

Re: Case study: library class inheritance with property declarations

2007-08-08 Thread cdleary
On Aug 2, 7:05 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > (snip) > > > Last post -- I swear. > > > I failed to realize that it's all part of an extremely well defined > > attribute resolution protocol, and handled via the descriptor > > specification. Discuss

Professional Grant Proposal Writing Workshop (September 2007: Simon Fraser University)

2007-08-08 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held at Simon Fraser University at Harbour Centre, September 12 - 14 , 2007. Interested development professionals, researchers, faculty, and graduate students should register as soon as possible, as demand mean

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Bruno Desthuilliers
Jay Loden a écrit : (snip) > If we just want to iterate through the file one line at a time, why not just: > > count = 0 > handle = open('hugelogfile.txt') > for line in handle.xreadlines(): > count = count + 1 > if count == '10': > #do something for count, line in enumera

Re: Compiling PythonD using DJGPP

2007-08-08 Thread -Lost
John Simeon's response: > My problem is that I am getting a compiler error that I do not > understand: > > gcc -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I. -I./Include > -DPy_BUILD_CORE -o Python/compile.o Python/compile.c > Python/compile.c: In function 'optimize_c

twisted - locking threads when deferToThread is used

2007-08-08 Thread Ladislav Andel
Hi, I'm writing an application which will be periodically testing servers. I will have a global list of these servers(domain names) and need to do few tasks. 1) DNS checks - I will use asynchronous twisted-names for it - in case there is a difference comparing to the list it should update the list

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Aug 2007 09:54:26 +0200, Méta-MCI \(MVP\) wrote: > Create a "index" (a file with 3,453,299,000 tuples : > line_number + start_byte) ; this file has fix-length lines. > slow, OK, but once. Why storing the line number? The first start offset is for the first line, the second start offs

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Ben Finney
Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: > On Aug 8, 2:35 am, Paul Rubin wrote: > > Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: > > > This program: > > > for i in range(10): > > > f.readline() > > > is absolutely every slow > > > > There

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Ant
On Aug 8, 11:10 am, Bruno Desthuilliers wrote: > Jay Loden a écrit : > (snip) > > > If we just want to iterate through the file one line at a time, why not > > just: > > > count = 0 > > handle = open('hugelogfile.txt') > > for line in handle.xreadlines(): > > count = count + 1 > > if coun

Re: RTF 2 Tiff

2007-08-08 Thread [EMAIL PROTECTED]
On Aug 7, 4:09 pm, [EMAIL PROTECTED] wrote: > [...] > We are running Windows Operating Systems. I was not able to find > anything that actually would convert the images via command line or > interface. > [...] You could instruct OpenOffice to export the RTF files as PDF files by using the Python-

How to avoid reverse code engineering of a python executable

2007-08-08 Thread NicolasG
Hi guy's, Couple of day's ago I asked for your help on how to create a single file of a python executable. Now I want to proceed a little bit further asking how can I avoid (or at least make it difficult) for some one to extract my code by using reverse code engineer techniques? I came on pyobfusc

KeyError: ... updated type, in planet

2007-08-08 Thread Marc Girod
Hello, I am using Planet 2.0 to generate RSS feeds from wiki pages. On some of my wikis, I get an error such as: ionawikis> sudo python2.5 /root/planet/planet.py -v ./tstconfig.ini DEBUG:planet.runner:Socket timeout set to 20 seconds INFO:planet.runner:Loading cached data Traceback (most recent c

Re: How to avoid reverse code engineering of a python executable

2007-08-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Aug 2007 11:40:28 +, NicolasG wrote: > Couple of day's ago I asked for your help on how to create a single > file of a python executable. Now I want to proceed a little bit > further asking how can I avoid (or at least make it difficult) for > some one to extract my code by using re

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Bjoern Schliessmann
Peter Otten wrote: > n = 10**9 - 1 > assert n < sys.maxint > f = open(filename) > wanted_line = itertools.islice(f, n, None).next() > > should do slightly better than your implementation. It will do vastly better, at least in memory usage terms, because there is no memory eating range call. Reg

Re: Issues of state

2007-08-08 Thread greg
Paul Rubin wrote: > I'm not sure what you're getting at in this context. You can write a > desktop app where the window system communicates with a gui toolkit > through a socket (at least that's how X windows works) An X server connection is *much* more stateful than an HTTP one. It persists thro

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Bruno Desthuilliers
Ant a écrit : > On Aug 8, 11:10 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Jay Loden a écrit : >> (snip) >> >>> If we just want to iterate through the file one line at a time, why not >>> just: >>> count = 0 >>> handle = open('hugelogfile.txt') >>> for line in handle.xreadlines(): >>>

Jython - problem import os

2007-08-08 Thread nmin
Hi. I'm using Jython in combination with Java, webservices and jboss4.0.4. The webservice is implemented in java and creates an PythonInterpreter object which loads the jython scripts. I wrote an jython script which uses a function from another jython file called library.py. So, i wrote: servic

re: mmm-mode, python-mode and doctest-mode?

2007-08-08 Thread Neal Becker
Anyone testing on xemacs? I tried it, and C-c C-c sent xemacs into an infinite loop (apparantly). -- http://mail.python.org/mailman/listinfo/python-list

Re: Issues of state

2007-08-08 Thread Paul Rubin
greg <[EMAIL PROTECTED]> writes: > An X server connection is *much* more stateful than > an HTTP one. It persists throughout the entire use > session of the application, for one thing, and there > is heaps of state being kept on both sides of the > connection. There's also a very high communication

Re: Something in the function tutorial confused me.

2007-08-08 Thread Steve Holden
greg wrote: > Steve Holden wrote: >> OK. The difference is that [] is a mutable value, while None is >> immutable. > > No, it's not. It has nothing to do with mutability > vs immutability. > I beg to differ. That has everything to do with it. > The difference is that in the first version the >

Re: How to avoid reverse code engineering of a python executable

2007-08-08 Thread Diez B. Roggisch
Marc 'BlackJack' Rintsch wrote: > On Wed, 08 Aug 2007 11:40:28 +, NicolasG wrote: > >> Couple of day's ago I asked for your help on how to create a single >> file of a python executable. Now I want to proceed a little bit >> further asking how can I avoid (or at least make it difficult) for >

This bit of code hangs Python Indefinitely

2007-08-08 Thread brad
url_queue = Queue.Queue(256) for subnet in subnets: url_queue.put(subnet) The problem is that I have 512 things to add to the queue, but my limit is half that... whoops. Shouldn't the interpreter tell me that I'm an idiot for trying to do this instead of just hanging? A message such as thi

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Aug 2007 09:38:49 -0400, brad wrote: > url_queue = Queue.Queue(256) > for subnet in subnets: > url_queue.put(subnet) > > The problem is that I have 512 things to add to the queue, but my limit > is half that... whoops. Shouldn't the interpreter tell me that I'm an > idiot for tr

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Istvan Albert
On Aug 8, 9:38 am, brad <[EMAIL PROTECTED]> wrote: > The problem is that I have 512 things to add to the queue, but my limit > is half that... whoops. Shouldn't the interpreter tell me that I'm an > idiot for trying to do this instead of just hanging? A message such as > this would be more appropri

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Chris Mellon
On 8/8/07, brad <[EMAIL PROTECTED]> wrote: > url_queue = Queue.Queue(256) > for subnet in subnets: > url_queue.put(subnet) > > The problem is that I have 512 things to add to the queue, but my limit > is half that... whoops. Shouldn't the interpreter tell me that I'm an > idiot for trying to d

Re: Something in the function tutorial confused me.

2007-08-08 Thread Carsten Haese
On Wed, 2007-08-08 at 08:52 -0400, Steve Holden wrote: > While it's correct that rebinding y will usually cause it to reference a > different object, this need not be true of assignment. The augmented > assignment operations do no necessarily rebind their left-hand operand - > that depends on th

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Chris Mellon
On 8/8/07, Ben Finney <[EMAIL PROTECTED]> wrote: > Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: > > > On Aug 8, 2:35 am, Paul Rubin wrote: > > > Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: > > > > This program: > > > > for i in range(10): > > > >

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread brad
Chris Mellon wrote: > ... the producer is designed to block if > the queue is full. You can use the put_nowait method to have it raise > an exception instead of blocking. I assumed that the behavior would have been the other way around. I should not have made that assumption. -- http://mail.pyt

Re: Web based Reporting tool for Python

2007-08-08 Thread Jon Rosebaugh
On 2007-08-07 23:35:26 -0500, Madhu Alagu <[EMAIL PROTECTED]> said: > Thanking so much for all the informations and links.I would like to > use Mako Templates(www.makotemplates.org).I like to use simple and > python default module... Mako is an excellent template system, but you'll have a lot of

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Bill Scherer
brad wrote: > url_queue = Queue.Queue(256) > for subnet in subnets: > url_queue.put(subnet) > > The problem is that I have 512 things to add to the queue, but my limit > is half that... whoops. Shouldn't the interpreter tell me that I'm an > idiot for trying to do this instead of just hangin

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread brad
Marc 'BlackJack' Rintsch wrote: > Why did you put an upper bound to the queue? For clarity. Explicit is better than implicit, right? In our design, the queue should only have x number of things, so why not show that? Other than that, the limit is arbitrary and is not needed. -- http://mail.pyt

Re: twisted - locking threads when deferToThread is used

2007-08-08 Thread Chris Mellon
On 8/8/07, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hi, > I'm writing an application which will be periodically testing servers. > I will have a global list of these servers(domain names) and need to do > few tasks. > 1) DNS checks - I will use asynchronous twisted-names for it > - in case there

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Istvan Albert
On Aug 6, 6:49 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > Incidentally, from the second link I find it shocking that the > keyword parameter "file" shadows a builtin. It seems to endorse a > bad practice. I believe that the "file" builtin has been removed as well so it won't shadow anything.

Re: twisted - locking threads when deferToThread is used

2007-08-08 Thread Chris Mellon
On 8/8/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > On 8/8/07, Ladislav Andel <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm writing an application which will be periodically testing servers. > > I will have a global list of these servers(domain names) and need to do > > few tasks. > > 1) DNS checks -

Re: making a opc client in Python and use opc server Events

2007-08-08 Thread getgroup
On 7 août, 07:17, [EMAIL PROTECTED] wrote: > On 28 juin, 16:55, [EMAIL PROTECTED] wrote: > > > > > > > On 4 juin, 11:32, [EMAIL PROTECTED] wrote: > > > > Hi all > > > I have a sample code to implementopcclientinPython. i use a > > > file .py making by makepy with pythonwin for Com Interface. > > >

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Istvan Albert
On Aug 6, 6:11 am, Paul Rubin wrote: > Why on earth did they make this change? It just seems gratuitous. Having print a function (with parameters) makes is very easy to modify where the output goes. Say you want to have some prints go to one particular file, today you

Stop a thread on deletion

2007-08-08 Thread Sjoerd Op 't Land
Hello all, I'm using threading for generating video content. The trouble is how to kill the thread, because there are multiple (simultaneous) owners of a thread. Ideally, a flag would be set when the reference count of the thread becomes zero, causing the run() loop to quit. Example: import th

testing

2007-08-08 Thread nikolay marinov
Hi,there.I'm a young tester (4 months,still learning what is "testing > software!?!"). I work on Linux and i write my tests with Python. > Our assignment is to build a module from our 'BIG' program that > have to be able to edit xls files, without using MSExcel, OpenOffice > or something lik

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Duncan Booth
brad <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > >> ... the producer is designed to block if >> the queue is full. You can use the put_nowait method to have it raise >> an exception instead of blocking. > > I assumed that the behavior would have been the other way around. I > should not

SciPy's site is down

2007-08-08 Thread a . harrowell
Can anyone else not reach scipy.org? Am trying to install scipy and numpy. Further, is there an equivalent of numpy that will install correctly on Python 2.5 on WinVista? -- http://mail.python.org/mailman/listinfo/python-list

some import / namespace questions

2007-08-08 Thread stef mientki
hello, I'm working on a rather strange program, that is partially build dynamically, and where users can create plugins, without knowing any of the details of the core program. Of course this leads to some weird bugs, so one of the things I want to view/log is the order (and even better the way)

Re: Stop a thread on deletion

2007-08-08 Thread Chris Mellon
On 8/8/07, Sjoerd Op 't Land <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm using threading for generating video content. The trouble is how to > kill the thread, because there are multiple (simultaneous) owners of a > thread. Ideally, a flag would be set when the reference count of the > thread b

Re: parsing a dbIII file

2007-08-08 Thread korovev76
On 7 Ago, 17:47, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 8/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > I have to parse a file (that is a dbIII file) whose stucture look like > > this: > > |string|, |string|, |string that may contain commas inside|, 1, 2, 3, | > > other string| > >

Re: Tkinter or wxpython?

2007-08-08 Thread Kevin Walzer
Cameron Laird wrote: > > While those with an artistic eye > assure me the simplest Tkinter programs look worse > that corresponding ones built with any other toolkit, > they behave the most coherently in regards to resizing > and so on. > "Look worse" can be addressed through extensive means: th

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Steve Holden
Chris Mellon wrote: > On 8/8/07, Ben Finney <[EMAIL PROTECTED]> wrote: >> Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: >> >>> On Aug 8, 2:35 am, Paul Rubin wrote: Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: > This program: > for i in range(1000

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Chris Mellon
On 8/8/07, Steve Holden <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > On 8/8/07, Ben Finney <[EMAIL PROTECTED]> wrote: > >> Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: > >> > >>> On Aug 8, 2:35 am, Paul Rubin wrote: > Sullivan WxPyQtKinter <[EMAIL PROTEC

Re: Something in the function tutorial confused me.

2007-08-08 Thread Steve Holden
Carsten Haese wrote: > On Wed, 2007-08-08 at 08:52 -0400, Steve Holden wrote: [...] > > The problem is your ambiguous use of the word "assignment." In the sense > of the Language Reference, "any assignment to y" is a simple assignment > that always modifies a namespace and never modifies an object

Re: twisted - locking threads when deferToThread is used

2007-08-08 Thread Ladislav Andel
Chris Mellon wrote: > On 8/8/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > >> On 8/8/07, Ladislav Andel <[EMAIL PROTECTED]> wrote: >> >>> Hi, >>> I'm writing an application which will be periodically testing servers. >>> I will have a global list of these servers(domain names) and need to d

Re: Tkinter or wxpython?

2007-08-08 Thread Chris Mellon
On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Cameron Laird wrote: > > > > While those with an artistic eye > > assure me the simplest Tkinter programs look worse > > that corresponding ones built with any other toolkit, > > they behave the most coherently in regards to resizing > > and so o

Re: twisted - locking threads when deferToThread is used

2007-08-08 Thread Ladislav Andel
And here is the code: from twisted.internet import reactor, defer, threads from siptest import siptest_f from twisted.internet.threads import deferToThread test_opts = {'username':'test','transport':'udp','localport':'5085','password':'test'} domain = ['sip.1und1.de', 'sip.babble.net'] class

'Advanced' list comprehension? query

2007-08-08 Thread pyscottishguy
Hi, I'm playing around with list comprehension, and I'm trying to find the most aesthetic way to do the following: I have two lists: noShowList = ['one', 'two', 'three'] myList = ['item one', 'item four', 'three item'] I want to show all the items from 'myList' that do not contain any of the s

Re: some import / namespace questions

2007-08-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Aug 2007 17:11:19 +0200, stef mientki wrote: > Now it's not possible to import in the existing modules the main plugin, > like >from Main_User import * > because this will start the infinite loop. Which means there's code at the module level. Tell the users to put that into a fun

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Steve Holden
brad wrote: > Marc 'BlackJack' Rintsch wrote: > >> Why did you put an upper bound to the queue? > > For clarity. Explicit is better than implicit, right? In our design, the > queue should only have x number of things, so why not show that? Other > than that, the limit is arbitrary and is not ne

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Paul Boddie
On 8 Aug, 16:26, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Aug 6, 6:11 am, Paul Rubin wrote: > > > Why on earth did they make this change? It just seems gratuitous. > > Having print a function (with parameters) makes is very easy to modify > where the output goes. I

Re: 'Advanced' list comprehension? query

2007-08-08 Thread BartlebyScrivener
On Aug 8, 11:00 am, [EMAIL PROTECTED] wrote: > Hi, > > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to s

Re: 'Advanced' list comprehension? query

2007-08-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to show all the items from

Re: Tkinter or wxpython?

2007-08-08 Thread Kevin Walzer
Chris Mellon wrote: > On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Using Tile, of course, loses you the first major benefit of Tk - that > it's already included in the standard library. So in this sense it's > still "ugly old school look and feel" vs "no external dependencies", > which is

Re: SciPy's site is down

2007-08-08 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Can anyone else not reach scipy.org? It's working for me. Of course, I'm 50 feet away from it. But I can also reach it from elsewhere, too. > Am trying to install scipy and > numpy. Further, is there an equivalent of numpy that will install > correctly on Python 2.5 on

Re: 'Advanced' list comprehension? query

2007-08-08 Thread [EMAIL PROTECTED]
On Aug 8, 10:00 am, [EMAIL PROTECTED] wrote: > Hi, > > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to s

accessing parts of large files with File.seek()

2007-08-08 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I'm having a problem with the File object's seek() method. Specifically, I cannot use it to seek to a location in a binary file that is greater than 2^31 (2147483648). This seems unnecessarily limiting, as it is common these days to have files larger than 2 GB. Is there some LargeFile object out

Re: 'Advanced' list comprehension? query

2007-08-08 Thread Jason
On Aug 8, 10:00 am, [EMAIL PROTECTED] wrote: > Hi, > > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to s

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Istvan Albert
On Aug 8, 12:08 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > However, for every enthusiast of one approach, there > will always be an enthusiast for another (see point #6): True. For example I for one also like the way the current print adds a newline, the vast majority of the time that is exact

Re: Tkinter or wxpython?

2007-08-08 Thread Chris Mellon
On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > > > Using Tile, of course, loses you the first major benefit of Tk - that > > it's already included in the standard library. So in this sense it's > > still "ugly old sc

Removing tags with BeautifulSoup

2007-08-08 Thread sebzzz
Hi, I'm in the process of cleaning some html files with BeautifulSoup and I want to remove all traces of the tables. Here is the bit of the code that deals with tables: def remove(soup, tagname): for tag in soup.findAll(tagname): contents = tag.contents parent = tag.parent

Launch file from Python

2007-08-08 Thread jocago
Good afternoon from someone who is trying to learn Python. I would like to launch an app from within a Python script. From the examples I have found, I should be able to do this with os.system. I use this: os.system("xplanet-1.2.0/xplanet.exe -fontsize 24 -label -target earth -lat 33.65 -lon -84.

Doctest in Python implementations

2007-08-08 Thread Paddy
Hi, I'm wanting to update the Wikipedia entry on doctest with information on which current python implementations support the doctest module. So, does Doctest come with ironpython, jython, python for Nokia phones (what is that called)? Thanks. -- http://mail.python.org/mailman/listinfo/python-li

Re: the one python book

2007-08-08 Thread Dick Moores
At 10:22 AM 8/5/2007, vasudevram wrote: > > On Aug 4, 7:23 am, "dhr" <[EMAIL PROTECTED]> wrote: > > > > > newbie question: > > > > > Is there a 'K&R" type of Python book? The book that you'd better have on > > > your shelf if you are going into Python? > > > >Python in a Nutshell, the Python Cookbo

Re: Launch file from Python

2007-08-08 Thread kyosohma
On Aug 8, 12:28 pm, [EMAIL PROTECTED] wrote: > Good afternoon from someone who is trying to learn Python. > > I would like to launch an app from within a Python script. From the > examples I have found, I should be able to do this with os.system. > > I use this: > os.system("xplanet-1.2.0/xplanet.e

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Paddy
> You could possibly make a case that before Queue.put blocks it should check > whether the program has more than just the one thread and if not it should > raise an RTFMException. Cute :-) -- http://mail.python.org/mailman/listinfo/python-list

RE: 'Advanced' list comprehension? query

2007-08-08 Thread John Krukoff
[EMAIL PROTECTED] wrote: > Hi, > > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to show all the ite

RE: 'Advanced' list comprehension? query

2007-08-08 Thread John Krukoff
John Krukoff wrote: > > [EMAIL PROTECTED] wrote: > > Hi, > > > > I'm playing around with list comprehension, and I'm trying to find the > > most aesthetic way to do the following: > > > > I have two lists: > > > > noShowList = ['one', 'two', 'three'] > > > > myList = ['item one', 'item four', 'thr

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Aug 6, 6:49 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> Incidentally, from the second link I find it shocking that the >> keyword parameter "file" shadows a builtin. It seems to >> endorse a bad practice. > > I believe that the "file"

Re: Something in the function tutorial confused me.

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Steve Holden <[EMAIL PROTECTED]> wrote: > Carsten Haese wrote: >> On Wed, 2007-08-08 at 08:52 -0400, Steve Holden wrote: > [...] >> The problem is your ambiguous use of the word "assignment." In >> the sense of the Language Reference, "any assignment to y" is >> a simple assignment t

Re: Launch file from Python

2007-08-08 Thread jocago
On Aug 8, 1:36 pm, [EMAIL PROTECTED] wrote: > On Aug 8, 12:28 pm, [EMAIL PROTECTED] wrote: > > > Good afternoon from someone who is trying to learn Python. > > > I would like to launch an app from within a Python script. From the > > examples I have found, I should be able to do this with os.system

WinPdb?

2007-08-08 Thread Dick Moores
The only debugging I've done so far is to put in print statements where I want to see what's happening. But it's often "through a glass darkly". However, I just discovered that my excellent (IMO) Python editor, Ulipad, comes with WinPdb, and I'm thinking it's about time I learned how to use a deb

Re: Tkinter or wxpython?

2007-08-08 Thread Kevin Walzer
Chris Mellon wrote: >> What do you mean here? Things like keyboard accelerators, menu >> placement, and so on? Those things are already natively implemented by >> Tk, and the developer just needs to invoke them. Sometimes some >> conditional code is required for stuff like keyboard accelerators (t

Re: Tkinter or wxpython?

2007-08-08 Thread Chris Mellon
On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > >> What do you mean here? Things like keyboard accelerators, menu > >> placement, and so on? Those things are already natively implemented by > >> Tk, and the developer just needs to invoke them. Sometimes some > >> condit

Re: Launch file from Python

2007-08-08 Thread kyosohma
On Aug 8, 1:11 pm, jocago <[EMAIL PROTECTED]> wrote: > The application, however, never runs. I'll give the sub-process a > shot. Thanks. Well, that's a problem. I suppose the best thing to try is use some smaller sets of flags and see if they work. Instead of your long string, try something small

tokenize module after installation

2007-08-08 Thread vedrandekovic
Hi, I have one more question about installation. After installation my program that uses tokenize module,when I run myprogram.exe (vgsveki.exe): Traceback (most recent call last): File "vgsveki.py", line 307, in kompajlati File "vgsveki.py", line 302, in kompajlati_proces File "vgsveki.py"

Google Conspiracy Revealed!

2007-08-08 Thread conspiracy . black3
http://www.nasaconspiracy.net/2007/06/content-generator-recognizing-generated.html - Amazing Google Conspiracies Revealed from CIA, NSA and Government conspiracies and Dr.Kevorkians magic pills. -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Istvan Albert
On Aug 8, 2:00 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > I thought, in fact, that open was on more shaky ground. ;) yeah, that too ... > I can't find any evidence of that in the PEPs. Do you have a reference? here is something: http://svn.python.org/view/python/branches/p3yk/Misc/NEWS?rev=

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Aug 8, 2:00 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > >> I thought, in fact, that open was on more shaky ground. ;) > > yeah, that too ... OK, I had misremembered. The current docs say that open is preferred, and that file should rat

Re: Launch file from Python

2007-08-08 Thread Arnau Sanchez
[EMAIL PROTECTED] escribió: > That's just the exit status or run status, if I recall correctly. I > think 0 (i.e. False) means it didn't run properly and anything else is > True, or ok. Something like that. The other way: 0 means "ok" while everything else means error (at least in UNIX). The re

Re: Launch file from Python

2007-08-08 Thread kyosohma
On Aug 8, 2:35 pm, Arnau Sanchez <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] escribió: > > > That's just the exit status or run status, if I recall correctly. I > > think 0 (i.e. False) means it didn't run properly and anything else is > > True, or ok. Something like that. > > The other way: 0 m

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread Tony
On Aug 8, 8:25 am, Peter Otten <[EMAIL PROTECTED]> wrote: > kj7ny wrote: > > What is @checkPrivs (see example copied below from other post)? In > > fact... how does the thing work at all? > > @checkPrivs > > def add(a,b): > > return a+b > > @... is called a decorator and is just a fancy way of

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Paul Rubin
Istvan Albert <[EMAIL PROTECTED]> writes: > apply(), callable(), coerce(), file(), reduce(), reload() reduce() is really gone? Maybe itertools can get an ireduce function or something like that? -- http://mail.python.org/mailman/listinfo/python-list

Re: Stop a thread on deletion

2007-08-08 Thread Sjoerd Op 't Land
Dear Cris, Thanks a lot. This works! (What you didn't know, there was already such a 'proxy' object in the design, so it isn't the hack it looks ;).) Thanks again, Sjoerd Op 't Land Chris Mellon schreef: > On 8/8/07, Sjoerd Op 't Land <[EMAIL PROTECTED]> wrote: >> Hello all, >> >> I'm using thr

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Paul Rubin wrote: > Istvan Albert <[EMAIL PROTECTED]> writes: >> apply(), callable(), coerce(), file(), reduce(), reload() > > reduce() is really gone? Maybe itertools can get an > ireduce function or something like that? I don't see how file() can be "removed", actually, un

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread Peter Otten
Tony wrote: > Is this cheating? Isn't it harder to calculate the magic indices than just writing down the names twice? > class a: > def square(self, x): > print 'executing:', dir(self)[-1] > print x*x > def cube(self, x): > print '

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Martin v. Löwis
> I don't see how file() can be "removed", actually, unless the > file type itself is getting axed. Indeed, that's the case. Py3k won't use stdio for file input and output, but the io module. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: A question on plugin design

2007-08-08 Thread Grzegorz Słodkowicz
Very insightful, thank you for your replies. I was initially thinking it would be simpler to implement my own system but perhaps using a ready-made one will be more elegant and potential plugin makers would find it more familiar. Cheers, Greg. -- http://mail.python.org/mailman/listinfo/python-

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Terry Reedy
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Wed, 08 Aug 2007 09:54:26 +0200, Méta-MCI \(MVP\) wrote: | | > Create a "index" (a file with 3,453,299,000 tuples : | > line_number + start_byte) ; this file has fix-length lines. | > slow, OK, but once. |

  1   2   >