Jython 2.5 Beta1 Released!

2009-01-09 Thread Frank Wierzbicki
On behalf of the Jython development team, I'm pleased to announce that Jython 2.5b1 is available for download: http://downloads.sourceforge.net/jython/jython_installer-2.5b1.jar. See the installation instructions here: http://www.jython.org/Project/installation.html. Jython 2.5 Beta1 continues a

Open Technology Group, Inc. announces Django GeoDjango MVC Framework Training

2009-01-09 Thread Chander Ganesan
Morrisville, NC (PRWEB) January 9, 2009 -- Open Technology Group, Inc. announces Django GeoDjango MVC Framework Training The Open Technology Group (OTG), a leader in the development and delivery of training solutions centered about Open Source technologies, released the latest in its set of

[ANNOUNCE] MyHDL 0.6 released

2009-01-09 Thread Jan Decaluwe
I'm happy to announce the release of MyHDL 0.6. MyHDL is a Python package for using Python as a hardware description language. The highlight of this release is conversion to VHDL, in addition to the existing Verilog capability. Furthermore, the convertible subset has been broadened

Re: BadZipfile file is not a zip file

2009-01-09 Thread Steven D'Aprano
On Thu, 08 Jan 2009 16:47:39 -0800, webcomm wrote: The error... ... BadZipfile: File is not a zip file When I look at data.zip in Windows, it appears to be a valid zip file. I am able to uncompress it in Windows XP, and can also uncompress it with 7-Zip. It looks like zipfile is not able

Re: ulimit stack size and python threads

2009-01-09 Thread Martin v. Löwis
Always crashing because I asked the OS to please not allow a process to grow too big is what I call overloading the meaning of ulimit -s. Please trust that there is no explicit code in the Python interpreter that tests whether the stack size is 4GB, and then produces an explicit crash. It's

Re: ulimit stack size and python threads

2009-01-09 Thread Martin v. Löwis
I see. I should be blaming the default behavior of pthreads. You shouldn't blame anybody. Instead, you should sit down and study the problem in detail, until you fully understand it. Then you should start contributing fixes. Never ever should you spread blame. Regards, Martin --

Encrypted Logging in python

2009-01-09 Thread koranthala
I was wondering if there is a mechanism to encrypt logging automatically in python. The issue is as follows: (a) An application (after py2exe) will go as executable and there is no need for the user to know that it is written in python. If an exception occurs and it is logged, then the

Re: threading in PyQt vs threading in standard library

2009-01-09 Thread Phil Thompson
On Fri, 9 Jan 2009 15:15:28 +0800, Steven Woody narkewo...@gmail.com wrote: Hi, I am considering using PyQt for GUI programs, and I notices that both of them include threading supports, so which one should I pick up? Similar also applies 'socket'. I'd recommend using the PyQt versions of

Re: BadZipfile file is not a zip file

2009-01-09 Thread Martin v. Löwis
What would cause a zip file to not have a table of contents? AFAICT, _EndRecData is failing to find the end of zipfile structure in the file. You might want debug through it to see where it looks, and how it decides that this structure is not present in the file. Towards 22 bytes before the end

Re: Replying to list messages

2009-01-09 Thread Steven D'Aprano
On Thu, 08 Jan 2009 10:42:13 -0800, Paul McNett wrote: Ben Finney wrote: Paul McNett p...@ulmcnett.com writes: But arguing about this here isn't going to change anything: opinions differ just like tabs/spaces and bottom-post/top-post. In cases like this, one side can simply be wrong :-)

Re: BadZipfile file is not a zip file

2009-01-09 Thread Carl Banks
On Jan 9, 2:16 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 08 Jan 2009 16:47:39 -0800, webcomm wrote: The error... ... BadZipfile: File is not a zip file When I look at data.zip in Windows, it appears to be a valid zip file. I am able to uncompress it in

Re: drive a desktop app from python?

2009-01-09 Thread James Stroud
Tim Arnold wrote: Hi, I don't even know what to google for on this one. I need to drive a commercial desktop app (on windows xp) since the app doesn't have a batch interface. It's intended to analyze one file at a time and display a report. I can get the thing to write out the report an

Re: Best practice in organize classes into modules

2009-01-09 Thread Bruno Desthuilliers
Steven Woody a écrit : On Fri, Jan 9, 2009 at 1:02 PM, James Mills prolo...@shortcircuit.net.au wrote: On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody narkewo...@gmail.com wrote: In C++/Java, people usually put one class into one file. What's the suggestion on this topic in Python? I so much

Re: Best practice in organize classes into modules

2009-01-09 Thread Steven Woody
On Fri, Jan 9, 2009 at 4:54 PM, Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid wrote: Steven Woody a écrit : On Fri, Jan 9, 2009 at 1:02 PM, James Mills prolo...@shortcircuit.net.au wrote: On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody narkewo...@gmail.com wrote: In

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
On Fri, 09 Jan 2009 04:04:41 +0100, Johannes Bauer wrote: I've first tried Python. Please don't beat me, it's slow as hell and probably a horrible solution: #!/usr/bin/python import sys import os f = open(sys.argv[1], r) Mode should be 'rb'. filesize = os.stat(sys.argv[1])[6]

Re: Default __nonzero__ impl doesn't throw a TypeError exception

2009-01-09 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : Sergey Kishchenko a écrit : (snip) #prints Ouch! f=Foo() if f: print Ouch! So, default __nonzero__ impl is to return True. Yes. It's clearly documented FWIW. To be more exact: there's no default __nonzero__. The boolean value of an object is eval'd this

Re: Python 2.6 fails on compiling Bug report

2009-01-09 Thread googler . 1 . webmaster
hm... any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6 fails on compiling Bug report

2009-01-09 Thread David Cournapeau
On Fri, Jan 9, 2009 at 6:18 PM, googler.1.webmas...@spamgourmet.com wrote: hm... any ideas? Posting the config.log file would be a first step to give more information, David -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-09 Thread James Mills
On Fri, Jan 9, 2009 at 7:15 PM, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: print(Filesize : %d % (filesize)) print(Image size : %dx%d % (width, height)) print(Bytes per Pixel: %d % (blocksize)) Why parentheses around ``print``\s argument? In Python 3 ``print`` is a statement

Re: BadZipfile file is not a zip file

2009-01-09 Thread John Machin
On Jan 9, 7:16 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 08 Jan 2009 16:47:39 -0800, webcomm wrote: The error... ... BadZipfile: File is not a zip file When I look at data.zip in Windows, it appears to be a valid zip file. I am able to uncompress it in

Re: drive a desktop app from python?

2009-01-09 Thread Ant
On Jan 8, 9:06 pm, Tim Arnold tim.arn...@sas.com wrote: Is there any lib or recipe(s) for doing something like this via python? Look into the PyWin32 extension module. It gives access to Windows internals including the COM interface. You'll need to do some research into how to automate the GUI

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
On Fri, 09 Jan 2009 19:33:53 +1000, James Mills wrote: On Fri, Jan 9, 2009 at 7:15 PM, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: Why parentheses around ``print``\s argument? In Python 3 ``print`` is a statement and not a function. Not true as of 2.6+ and 3.0+ print is now a

Re: Implementing file reading in C/Python

2009-01-09 Thread James Mills
On Fri, Jan 9, 2009 at 7:41 PM, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: Please read again what I wrote. Lol I thought 3 was a smiley! :) Sorry! cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
On Fri, 09 Jan 2009 04:04:41 +0100, Johannes Bauer wrote: datamap = { } for i in range(len(data)): datamap[ord(data[i])] = datamap.get(data[i], 0) + 1 Here is an error by the way: You call `ord()` just on the left side of the ``=``, so all keys in the dictionary

Re: why cannot assign to function call

2009-01-09 Thread Steven D'Aprano
On Thu, 08 Jan 2009 18:33:50 +, Mark Wooding wrote: [Steven's message hasn't reached my server, so I'll reply to it here. Sorry if this is confusing.] Aaron Brady castiro...@gmail.com wrote: On Jan 8, 1:45 am, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 07

Re: BadZipfile file is not a zip file

2009-01-09 Thread Steven D'Aprano
On Fri, 09 Jan 2009 00:46:27 -0800, Carl Banks wrote: On Jan 9, 2:16 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 08 Jan 2009 16:47:39 -0800, webcomm wrote: The error... ... BadZipfile: File is not a zip file When I look at data.zip in Windows, it appears to

Fatal Python error: ceval: tstate mix-up

2009-01-09 Thread Laszlo Nagy
After upgrading my system, a program started to throw this error, and make a core dump: Fatal Python error: ceval: tstate mix-up Kernel log says: Jan 9 05:06:49 shopzeus kernel: pid 89184 (python), uid 1024: exited on signal 6 (core dumped) I found out that this can happen only when

Re: Implementing file reading in C/Python

2009-01-09 Thread Steven D'Aprano
On Fri, 09 Jan 2009 19:33:53 +1000, James Mills wrote: On Fri, Jan 9, 2009 at 7:15 PM, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: print(Filesize : %d % (filesize)) print(Image size : %dx%d % (width, height)) print(Bytes per Pixel: %d % (blocksize)) Why parentheses around

Re: Implementing file reading in C/Python

2009-01-09 Thread Steven D'Aprano
On Fri, 09 Jan 2009 09:15:20 +, Marc 'BlackJack' Rintsch wrote: picture = { } havepixels = 0 while True: data = f.read(blocksize) if len(data) = 0: break if data: break is enough. You've reversed the sense of the test. The OP exits the loop when data is

Re: Encrypted Logging in python

2009-01-09 Thread Steven D'Aprano
On Fri, 09 Jan 2009 00:21:09 -0800, koranthala wrote: I was wondering if there is a mechanism to encrypt logging automatically in python. The issue is as follows: (a) An application (after py2exe) will go as executable and there is no need for the user to know that it is written in

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
On Fri, 09 Jan 2009 04:04:41 +0100, Johannes Bauer wrote: As this was horribly slow (20 Minutes for a 2GB file) I coded the whole thing in C also: Yours took ~37 minutes for 2 GiB here. This just ~15 minutes: #!/usr/bin/env python from __future__ import division, with_statement import os

Re: Best practice in organize classes into modules

2009-01-09 Thread Bruno Desthuilliers
Steven Woody a écrit : On Fri, Jan 9, 2009 at 4:54 PM, Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid wrote: Steven Woody a écrit : On Fri, Jan 9, 2009 at 1:02 PM, James Mills prolo...@shortcircuit.net.au wrote: On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody narkewo...@gmail.com

Re: Implementing file reading in C/Python

2009-01-09 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: On Fri, 09 Jan 2009 04:04:41 +0100, Johannes Bauer wrote: [...] print(Filesize : %d % (filesize)) print(Image size : %dx%d % (width, height)) print(Bytes per Pixel: %d % (blocksize)) Why parentheses around ``print``\s argument? In Python 3 ``print``

Re: BadZipfile file is not a zip file

2009-01-09 Thread John Machin
On Jan 9, 7:46 pm, Carl Banks pavlovevide...@gmail.com wrote: On Jan 9, 2:16 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 08 Jan 2009 16:47:39 -0800, webcomm wrote: The error... ... BadZipfile: File is not a zip file When I look at data.zip in

Re: Implementing file reading in C/Python

2009-01-09 Thread Steve Holden
Steven D'Aprano wrote: On Fri, 09 Jan 2009 19:33:53 +1000, James Mills wrote: On Fri, Jan 9, 2009 at 7:15 PM, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: print(Filesize : %d % (filesize)) print(Image size : %dx%d % (width, height)) print(Bytes per Pixel: %d % (blocksize)) Why

Line completion with custom commands

2009-01-09 Thread gu
Hi, my Python program can be launched with a range of different options (or subcommands) like: $ myProgram doSomething $ myProgram doSomethingElse $ myProgram nowDoSomethingDifferent I want it to use auto-completion with so that if i type myProgram d it returns myProgram doSomething and if

Re: [Python-Dev] compiling python2.5 on linux under wine

2009-01-09 Thread Luke Kenneth Casson Leighton
On Thu, Jan 8, 2009 at 9:07 PM, Martin v. Löwis mar...@v.loewis.de wrote: i'd just ... much rather be completely independent of proprietary software when it comes to building free software. I guess my question is then: why do you want to use Windows in the first place? ha ha :) the same

Re: Implementing file reading in C/Python

2009-01-09 Thread mk
Johannes Bauer wrote: Which takes about 40 seconds. I want the niceness of Python but a little more speed than I'm getting (I'd settle for factor 2 or 3 slower, but factor 30 is just too much). This probably doesn't contribute much, but have you tried using Python profiler? You might have

Re: Line completion with custom commands

2009-01-09 Thread Steve Holden
gu wrote: Hi, my Python program can be launched with a range of different options (or subcommands) like: $ myProgram doSomething $ myProgram doSomethingElse $ myProgram nowDoSomethingDifferent I want it to use auto-completion with so that if i type myProgram d it returns myProgram

Re: figuring week of the day....

2009-01-09 Thread Tim Chase
Tim Chase wrote: tekion wrote: Is there a module where you could figure week of the day, like where it starts and end. I need to do this for a whole year. Thanks. the monthcalendar() call returns the whole month's calendar which may be more what you want for the big-picture. And if you

Re: Line completion with custom commands

2009-01-09 Thread gu
Steve Holden wrote: gu wrote: Hi, my Python program can be launched with a range of different options (or subcommands) like: $ myProgram doSomething $ myProgram doSomethingElse $ myProgram nowDoSomethingDifferent I want it to use auto-completion with so that if i type myProgram d it returns

Re: Line completion with custom commands

2009-01-09 Thread Marco Mariani
gu wrote: I see, but how does django-admin work, then? from bash: complete -W doSomething doSomethingElse doSomethingDifferent myProgram -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-09 Thread Aaron Brady
On Jan 9, 4:01 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 08 Jan 2009 18:33:50 +, Mark Wooding wrote: [Steven's message hasn't reached my server, so I'll reply to it here. Sorry if this is confusing.] Aaron Brady castiro...@gmail.com wrote: On Jan 8,

Re: Line completion with custom commands

2009-01-09 Thread Steve Holden
gu wrote: Steve Holden wrote: gu wrote: Hi, my Python program can be launched with a range of different options (or subcommands) like: $ myProgram doSomething $ myProgram doSomethingElse $ myProgram nowDoSomethingDifferent I want it to use auto-completion with so that if i type myProgram

Re: Line completion with custom commands

2009-01-09 Thread gu
Marco Mariani wrote: gu wrote: I see, but how does django-admin work, then? from bash: complete -W doSomething doSomethingElse doSomethingDifferent myProgram This worked like a charm, thank you so much. Is this available for bash only or any shell? --

Re: [Help] The pywinauto Can't select the MDI's menu using the MenuItems() which return [].

2009-01-09 Thread Korobase
2008/12/22 Simon Brunning si...@brunningonline.net 2008/12/21 gagsl-...@yahoo.com.ar: The code below opens the Choose Font dialog on my Spanish Windows version: py from pywinauto.application import Application py app = Application.start(Notepad.exe) Notepad's menus are build with

Re: drive a desktop app from python?

2009-01-09 Thread zugn...@gmail.com
Is there any lib or recipe(s) for doing something like this via python? I've used pywinauto to do something similar, and found it good. http://pywinauto.openqa.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected scientific notation

2009-01-09 Thread Mark Dickinson
On Jan 8, 1:00 am, Paul McNett p...@ulmcnett.com wrote: It displays '3E+1' instead of '30.0'. As I can't reproduce I'm looking for an idea brainstorm of what could be causing this. What would be choosing to display such a normal number in scientific notation? Ideas? [I thought I replied

Re: Fatal Python error: ceval: tstate mix-up

2009-01-09 Thread Laszlo Nagy
I could start gdb python python.core but don't know what it means. Unfortunately, there are no debugging symbols. %gdb /usr/local/bin/python python.core GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you

pySerial - accessing GSM module failed

2009-01-09 Thread Dave Dave
Hello all, I'm newbie in the serial buissness and I beed some Help. I'm a student at my last year and I got final assaignment. My goal is to comunicate with SIM free, GSM Module through computer. I want to simulate SIM card by receiving and transferring data from my code. In order to understand

Re: Implementing file reading in C/Python

2009-01-09 Thread Johannes Bauer
Marc 'BlackJack' Rintsch schrieb: f = open(sys.argv[1], r) Mode should be 'rb'. Check. filesize = os.stat(sys.argv[1])[6] `os.path.getsize()` is a little bit more readable. Check. print(Filesize : %d % (filesize)) print(Image size : %dx%d % (width, height)) print(Bytes per

Re: Implementing file reading in C/Python

2009-01-09 Thread Johannes Bauer
James Mills schrieb: What does this little tool do anyway ? It's very interesting the images it creates out of files. What is this called ? It has no particular name. I was toying around with the Princeton Cold Boot Attack (http://citp.princeton.edu/memory/). In particular I was interested in

Re: Implementing file reading in C/Python

2009-01-09 Thread Johannes Bauer
Marc 'BlackJack' Rintsch schrieb: On Fri, 09 Jan 2009 04:04:41 +0100, Johannes Bauer wrote: As this was horribly slow (20 Minutes for a 2GB file) I coded the whole thing in C also: Yours took ~37 minutes for 2 GiB here. This just ~15 minutes: Ah, ok... when implementing your suggestions

Re: Implementing file reading in C/Python

2009-01-09 Thread Johannes Bauer
mk schrieb: Johannes Bauer wrote: Which takes about 40 seconds. I want the niceness of Python but a little more speed than I'm getting (I'd settle for factor 2 or 3 slower, but factor 30 is just too much). This probably doesn't contribute much, but have you tried using Python profiler?

Re: Force exception on attribute write access only one object

2009-01-09 Thread Thomas Guettler
Hi Peter and others, your idea was good, but it does not work with Django ORM Models: Traceback (most recent call last): File /localhome/modw/django/core/handlers/base.py, line 87, in get_response response = callback(request, *callback_args, **callback_kwargs) File

Re: Encrypted Logging in python

2009-01-09 Thread koranthala
On Jan 9, 3:16 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 09 Jan 2009 00:21:09 -0800, koranthala wrote: I was wondering if there is a mechanism to encrypt logging automatically in python.    The issue is as follows:     (a) An application (after py2exe) will

Re: Fatal Python error: ceval: tstate mix-up

2009-01-09 Thread Laszlo Nagy
Meanwhile I'm trying to turn off threads in that program one by one. I just got this new type of error: Fatal Python error: PyThreadState_Delete: invalid tstate -- http://mail.python.org/mailman/listinfo/python-list

win32gui

2009-01-09 Thread Gandalf
Hi, everyone I'm searching the win32gui lib to find a way to get the text under the user cursor. so far I managed to find only the controller ID which under the cursor this way cursorID = win32gui.WindowFromPoint(win32gui.GetCursorPos()) their is function called GetWindowText I tried to use but

Re: win32gui

2009-01-09 Thread TheSeeker
On Jan 9, 7:34 am, Gandalf goldn...@gmail.com wrote: Hi, everyone I'm searching the win32gui lib to find a way to get the text under the user cursor. so far I managed to find only the controller ID which under the cursor this way cursorID = win32gui.WindowFromPoint(win32gui.GetCursorPos())

Re: Encrypted Logging in python

2009-01-09 Thread pruebauno
On Jan 9, 8:02 am, koranth...@gmail.com wrote: Also, what I am asking is a generic option in logging - which can help the adoption of the logging framework in even closed source systems. It is not just about security - just that a closed source company might be much more comfortable in using

Python Apache Handler

2009-01-09 Thread Scooter
Does anyone have any good examples, or links thereto for using python as an Apache handler? And I should qualify all of this by saying I'm a python newbie, and while having experience with Apache, I've never done anything outside whats in the box . What I'm looking for is how one might use Python

Re: Python Imaging Library and textmate

2009-01-09 Thread Philip Semanchuk
On Jan 9, 2009, at 2:49 AM, bilgin arslan wrote: Hello, I am a beginner in python and I am trying to create image files that contain lines from a text file. I am trying to do this with PIL, which seems like a suitable tool. I have a copy of TextMate(1.5.8) and I run Macosx 10.5.6 The

Re: win32gui

2009-01-09 Thread Gandalf
thank you I'm checking autoit documentation... -- http://mail.python.org/mailman/listinfo/python-list

Re: BadZipfile file is not a zip file

2009-01-09 Thread webcomm
On Jan 9, 3:16 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: The full signature of ZipFile is: ZipFile(file, mode=r, compression=ZIP_STORED, allowZip64=True) Try passing compression=zipfile.ZIP_DEFLATED and/or allowZip64=False and see if that makes any difference. Those

Re: BadZipfile file is not a zip file

2009-01-09 Thread webcomm
On Jan 9, 3:46 am, Carl Banks pavlovevide...@gmail.com wrote: The zipfile format is kind of brain dead, you can't tell where the end of the file is supposed to be by looking at the header.  If the end of file hasn't yet been reached there could be more data.  To make matters worse, somehow zip

struct unpack to pre-allocated array?

2009-01-09 Thread Rich Henry
Is there any way to struct.unpack or struct.unpack_from into an existing array.array or similar structure? I am unpacking file data in a loop and i was hoping to find something that performs better than simply unpacking into a new tuple each iteration. Thanks in advance, Rich --

Re: BadZipfile file is not a zip file

2009-01-09 Thread Chris Mellon
On Fri, Jan 9, 2009 at 9:05 AM, webcomm rya...@gmail.com wrote: On Jan 9, 3:46 am, Carl Banks pavlovevide...@gmail.com wrote: The zipfile format is kind of brain dead, you can't tell where the end of the file is supposed to be by looking at the header. If the end of file hasn't yet been

Re: Implementing file reading in C/Python

2009-01-09 Thread pruebauno
On Jan 9, 8:48 am, Johannes Bauer dfnsonfsdu...@gmx.de wrote: No - and I've not known there was a profiler yet have found anything meaningful (there seems to be an profiling C interface, but that won't get me anywhere). Is that a seperate tool or something? Could you provide a link? Thanks,

Re: why cannot assign to function call

2009-01-09 Thread Joe Strout
ru...@yahoo.com wrote: a = array (1,2,3) b = a a[1] = 4 print b C, C++, VBA, Fortran, Perl: 1, 2, 3 Python: 1, 4, 3 You are mistaken I don't think so. See http://groups.google.com/group/comp.lang.python/msg/f99d5a0d8f869b96 The code I quoted there was tested. In the C/C++ case,

Re: sftp with no password from python

2009-01-09 Thread loial
On 8 Jan, 18:49, Mike Hjorleifsson mhjorleifs...@gmail.com wrote: On Jan 8, 10:39 am, loial jldunn2...@googlemail.com wrote: Is it possible to usesftpwithout a password from python? Yes you can use keys you preestablish between the server and client so you dont need passwords, i do this on

Re: BadZipfile file is not a zip file

2009-01-09 Thread webcomm
On Jan 9, 5:42 am, John Machin sjmac...@lexicon.net wrote: And here's a little gadget that might help the diagnostic effort; it shows the archive size and the position of all the magic PKnn markers. In a normal uncommented archive, EndArchive_pos + 22 == archive_size. I ran the diagnostic

Re: BadZipfile file is not a zip file

2009-01-09 Thread webcomm
On Jan 9, 10:14 am, Chris Mellon arka...@gmail.com wrote: This is a ticket about another issue or 2 with invalid zipfiles that the zipfile module won't load, but that other tools will compensate for: http://bugs.python.org/issue1757072 Hmm. That's interesting. Are there other tools I can

Re: Implementing file reading in C/Python

2009-01-09 Thread MRAB
Marc 'BlackJack' Rintsch wrote: On Fri, 09 Jan 2009 04:04:41 +0100, Johannes Bauer wrote: As this was horribly slow (20 Minutes for a 2GB file) I coded the whole thing in C also: Yours took ~37 minutes for 2 GiB here. This just ~15 minutes: #!/usr/bin/env python from __future__ import

Re: Extending Python with C or C++

2009-01-09 Thread Nick Craig-Wood
Thomas Heller thel...@python.net wrote: Nick Craig-Wood schrieb: Thomas Heller thel...@python.net wrote: Nick Craig-Wood schrieb: Interesting - I didn't know about h2xml and xml2py before and I've done lots of ctypes wrapping! Something to help with the initial drudge work of

Re: Implementing file reading in C/Python

2009-01-09 Thread rurpy
On Jan 9, 6:48 am, Johannes Bauer dfnsonfsdu...@gmx.de wrote: mk schrieb: The factor of 30 indeed does not seem right -- I have done somewhat similar stuff (calculating Levenshtein distance [edit distance] on words read from very large files), coded the same algorithm in pure Python and

Re: why cannot assign to function call

2009-01-09 Thread Joe Strout
Aaron Brady wrote: Possible compromise. You can think of functions as mutation-only. You pass the object, and it gets a new (additional) name. The old name doesn't go in. /compromise That's correct. The reference itself is passed in, not the variable (or expression) that held or

Re: Python 2.6 fails on compiling Bug report

2009-01-09 Thread googler . 1 . webmaster
Hi! I didn't wanted to post 11.000 Lines here, so I uploaded it here: http://rapidshare.com/files/181425216/config.log.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating new instances of subclasses.

2009-01-09 Thread J. Cliff Dyer
Thanks for the solutions everyone! I'm not sure which I'll end up using, but I think I've got a better grasp of the problem now. Cool stuff. Cheers, Cliff On Thu, 2009-01-08 at 06:52 -0800, Paul McGuire wrote: On Jan 7, 12:00 pm, Paul McGuire pt...@austin.rr.com wrote: On Jan 7, 10:38 am,

Re: why cannot assign to function call

2009-01-09 Thread Mark Wooding
ru...@yahoo.com ru...@yahoo.com wrote: As a side comment (because it always bugs me when I read this, even though I read it in very authoritative sources), ISTM that C passes everything by value except arrays; they are passed by reference (by passing a pointer to the array by value.)

Guaranteeing an n-byte data type?

2009-01-09 Thread Evan Jones
Hello all, I'm trying to use sockets to implement a pre-defined network protocol that requires that I send messages of exactly a certain number of bytes. In Python, integer values are represented as 4 bytes each (AFAIK.) However I don't want to always send 4 bytes: sometimes I want to send one

Re: why cannot assign to function call

2009-01-09 Thread Steve Holden
Joe Strout wrote: Aaron Brady wrote: Possible compromise. You can think of functions as mutation-only. You pass the object, and it gets a new (additional) name. The old name doesn't go in. /compromise That's correct. The reference itself is passed in, not the variable (or expression)

Re: Guaranteeing an n-byte data type?

2009-01-09 Thread MRAB
Evan Jones wrote: Hello all, I'm trying to use sockets to implement a pre-defined network protocol that requires that I send messages of exactly a certain number of bytes. In Python, integer values are represented as 4 bytes each (AFAIK.) However I don't want to always send 4 bytes:

Re: why cannot assign to function call

2009-01-09 Thread Steven D'Aprano
On Fri, 09 Jan 2009 08:30:46 -0700, Joe Strout wrote: That's correct. The reference itself is passed in, not the variable (or expression) that held or generated the reference in the calling code. This is no different from, in C, passing an integer: void foo(int bar) { bar = 42; }

Re: Guaranteeing an n-byte data type?

2009-01-09 Thread Steve Holden
Evan Jones wrote: Hello all, I'm trying to use sockets to implement a pre-defined network protocol that requires that I send messages of exactly a certain number of bytes. In Python, integer values are represented as 4 bytes each (AFAIK.) However I don't want to always send 4 bytes:

Re: Guaranteeing an n-byte data type?

2009-01-09 Thread Grant Edwards
Evan Jones wrote: I'm trying to use sockets to implement a pre-defined network protocol that requires that I send messages of exactly a certain number of bytes. In Python, integer values are represented as 4 bytes each (AFAIK.) However I don't want to always send 4 bytes: sometimes I want

Re: BadZipfile file is not a zip file

2009-01-09 Thread webcomm
On Jan 9, 10:14 am, Chris Mellon arka...@gmail.com wrote: This is a ticket about another issue or 2 with invalid zipfiles that the zipfile module won't load, but that other tools will compensate for: http://bugs.python.org/issue1757072 Looks like I just need to do this to unzip with unix...

Re: Implementing file reading in C/Python

2009-01-09 Thread Grant Edwards
On 2009-01-09, Johannes Bauer dfnsonfsdu...@gmx.de wrote: I've come from C/C++ and am now trying to code some Python because I absolutely love the language. However I still have trouble getting Python code to run efficiently. Right now I have a easy task: Get a file, If I were you, I'd try

Re: BadZipfile file is not a zip file

2009-01-09 Thread Wesley Brooks
I missed the begining of this thread and so appologise if I'm repeating what someone else has said! I had a very similar problem with this error and it turned out it was due to me moving a file across a socket connection and either not reading it or writing it in the binary mode, ie

Re: Implementing file reading in C/Python

2009-01-09 Thread bearophileHUGS
Johannes Bauer, I was about to start writing a faster version. I think with some care and Psyco you can go about as 5 times slower than C or something like that. To do that you need to use almost the same code for the C version, with a list of 256 ints for the frequencies, not using max() but a

Re: Unexpected scientific notation

2009-01-09 Thread Paul McNett
Mark Dickinson wrote: On Jan 8, 1:00 am, Paul McNett p...@ulmcnett.com wrote: It displays '3E+1' instead of '30.0'. As I can't reproduce I'm looking for an idea brainstorm of what could be causing this. What would be choosing to display such a normal number in scientific notation? Ideas?

Re: Python Imaging Library and textmate

2009-01-09 Thread bilgin arslan
Hi Philip, I tried to install PIL with the directions given and it seemed to be ok. When I tried it with IDLE, import Image did not give an error and as far as I checked it seemed to be working. However, importing Image module in TextMate gives an error, saying that the module cannot be found for

Problem with -3 switch

2009-01-09 Thread Aivar Annamaa
Hi I'm getting started with Python and in order to get good habits for Python 3, i'd like to run my Python 2.6.1 with Python 3 warning mode. When i run python -3 and execute statement print 4 then i expect to see a warning because i've understood that this statement is not valid in Python

Re: Problem with -3 switch

2009-01-09 Thread Chris Rebert
On Fri, Jan 9, 2009 at 9:17 AM, Aivar Annamaa concat_na...@hotmail.com wrote: Hi I'm getting started with Python and in order to get good habits for Python 3, i'd like to run my Python 2.6.1 with Python 3 warning mode. When i run python -3 and execute statement print 4 then i expect to

Re: Python Apache Handler

2009-01-09 Thread Gerhard Häring
Scooter wrote: Does anyone have any good examples, or links thereto for using python as an Apache handler? And I should qualify all of this by saying I'm a python newbie, and while having experience with Apache, I've never done anything outside whats in the box . What I'm looking for is how

Re: Unexpected scientific notation

2009-01-09 Thread Mark Dickinson
On Jan 9, 5:16 pm, Paul McNett p...@ulmcnett.com wrote: Thank you for the insight. I believe the problem is with my use of normalize(), but I still can't figure out why I can't reproduce the issue in my running app. Me neither. In particular, I can't see how it could this output could come

Re: Unexpected scientific notation

2009-01-09 Thread Paul McNett
Paul McNett wrote: Mark Dickinson wrote: On Jan 8, 1:00 am, Paul McNett p...@ulmcnett.com wrote: It displays '3E+1' instead of '30.0'. As I can't reproduce I'm looking for an idea brainstorm of what could be causing this. What would be choosing to display such a normal number in scientific

Re: Problem with -3 switch

2009-01-09 Thread Aivar Annamaa
As was recently pointed out in a nearly identical thread, the -3 switch only points out problems that the 2to3 converter tool can't automatically fix. Changing print to print() on the other hand is easily fixed by 2to3. Cheers, Chris I see. So i gotta keep my own discipline with print() then

Re: Implementing file reading in C/Python

2009-01-09 Thread Sion Arrowsmith
Grant Edwards inva...@invalid wrote: On 2009-01-09, Johannes Bauer dfnsonfsdu...@gmx.de wrote: I've come from C/C++ and am now trying to code some Python because I absolutely love the language. However I still have trouble getting Python code to run efficiently. Right now I have a easy task:

Re: Encrypted Logging in python

2009-01-09 Thread Gerhard Häring
koranth...@gmail.com wrote: I was wondering if there is a mechanism to encrypt logging automatically in python. Python's standard library doesn't include any strong symmetric ciphers. But if you include for example a cryptographic module for AES, for example, it should be easy (I guess 10

Re: Python Imaging Library and textmate

2009-01-09 Thread Philip Semanchuk
On Jan 9, 2009, at 12:19 PM, bilgin arslan wrote: Hi Philip, I tried to install PIL with the directions given and it seemed to be ok. When I tried it with IDLE, import Image did not give an error and as far as I checked it seemed to be working. However, importing Image module in TextMate

  1   2   3   >