Re: urllib2.unquote() vs unicode

2008-03-17 Thread Gabriel Genellina
On 18 mar, 02:20, Maciej Bliziński <[EMAIL PROTECTED]> wrote: > I've been hit by a urllib2.unquote() issue. Consider the following > unit test: > > import unittest > import urllib2 > > class UnquoteUnitTest(unittest.TestCase): > >    def setUp(self): >        self.utxt = u'%C4%99' >        self.stx

Re: ctypes in python failed to honor c_int

2008-03-17 Thread Jerry Fleming
Gabriel Genellina wrote: > On 17 mar, 23:57, Jerry Fleming <[EMAIL PROTECTED]> wrote: > >> I have a binary file written with c structures. Each record contains a >> null-terminated string followed by two 4-bytes integers. I wrote a small >> segment of python code to parse this file in this way: >>

Re: Cost of Queue.put

2008-03-17 Thread Gabriel Genellina
On 18 mar, 01:13, James <[EMAIL PROTECTED]> wrote: > Basically, what I need is a multi-process safe persistent quick queue. > The arrangement I had was a simple XML-RPC service running on the web > server which the various web server threads POST the relevant search > engine updates to. These upda

Re: writing to a binary file without intervening spaces

2008-03-17 Thread Larry
On Mar 18, 1:32 pm, Paul Rubin wrote: > Larry <[EMAIL PROTECTED]> writes: > > It seems to me that Python always add intervening spaces between data > > elements when writing to a file > > It's just the print statement that does that. I doubt that. I tried one small file,

Re: ctypes in python failed to honor c_int

2008-03-17 Thread Gabriel Genellina
On 17 mar, 23:57, Jerry Fleming <[EMAIL PROTECTED]> wrote: > I have a binary file written with c structures. Each record contains a > null-terminated string followed by two 4-bytes integers. I wrote a small > segment of python code to parse this file in this way: > [coe] > #!/usr/bin/python > > fr

Re: Pycon disappointment

2008-03-17 Thread mahesh . prakriya
On Mar 16, 7:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote: > If the following seems unnecessarily harsh, it was even more harsh for > me to discover that the time and money I had spent to get to my > favorite conference had been sold to vendors, presenting me as a > captive audience they could pitc

Re: writing to a binary file without intervening spaces

2008-03-17 Thread Paul Rubin
Larry <[EMAIL PROTECTED]> writes: > It seems to me that Python always add intervening spaces between data > elements when writing to a file It's just the print statement that does that. -- http://mail.python.org/mailman/listinfo/python-list

Re: writing to a binary file without intervening spaces

2008-03-17 Thread Larry
Thanks to all those who responded to this query. It seems to me that Python always add intervening spaces between data elements when writing to a file. Even with tostring() of numpy, array elements get separated by space character. I like the output of sys.stdout.write(file) to be writen as is to

Re: finding euclidean distance,better code?

2008-03-17 Thread [EMAIL PROTECTED]
On Mar 17, 6:17 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote > > _, imgindex = min((sum(abs(input_wk - weights[image, :])),image) for image > in xrange(numimgs)) > mindistance = abs(input_wk - weights[imgindex, :]) > # normalize and sum again thanks Gabriel D -- http://mail.python.org/mailm

Re: First Program Bug (Newbie)

2008-03-17 Thread Jeff Schwab
Benjamin Serrato wrote: > P.S. What is the chance I'll get spam for using my real email address? Fendi Chef Bag in Zucca Print - Black Trim Replica AAA, Fake HandBags Cheap Chef Bag in Zucca Print - Black Trim Bags Link : http://www.cnreplicas.com/Fendi_1439.html Chef Bag in Zucca Print - Black

Re: Any fancy grep utility replacements out there?

2008-03-17 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > So I need to recursively grep a bunch of gzipped files. This can't be > easily done with grep, rgrep or zgrep. (I'm sure given the right > pipeline including using the find command it could be donebut > seems like a hassle). > > So I figured I'd find a fancy next g

Re: Any fancy grep utility replacements out there?

2008-03-17 Thread George Sakkis
On Mar 17, 10:20 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > So I need to recursively grep a bunch of gzipped files. This can't be > easily done with grep, rgrep or zgrep. (I'm sure given the right > pipeline including using the find command it could be donebut > seems like a hassle

Re: Interesting math problem

2008-03-17 Thread Jeff Schwab
Arnaud Delobelle wrote: > On Mar 17, 10:24 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: >> Here is an interesting math problem: >> >> You have a number X > 0 and another number Y > 0. The goal is to >> divide X into a list with length Y. Each item in the list is an >> integer. The sum of all in

urllib2.unquote() vs unicode

2008-03-17 Thread Maciej Bliziński
I've been hit by a urllib2.unquote() issue. Consider the following unit test: import unittest import urllib2 class UnquoteUnitTest(unittest.TestCase): def setUp(self): self.utxt = u'%C4%99' self.stxt = '%C4%99' def testEq(self): self.assertEqual( self.u

Re: ord function problem from newbie

2008-03-17 Thread 7stud
[EMAIL PROTECTED] wrote: > I convert all to lowercase, > > import string > > small = string.lower(name) > print "Here is the calculated value:" > > print small > for ch in small: > v = ord(ch)-96 > print v > I don't know if you are using an

Ebel 1911 Lady Diamond 18kt Yellow Gold and Steel Ladies Watch 1215526 Replica

2008-03-17 Thread sales057
Ebel 1911 Lady Diamond 18kt Yellow Gold and Steel Ladies Watch 1215526 Replica, Fake, Cheap, AAA Replica watch Ebel 1911 Lady Diamond 18kt Yellow Gold and Steel Ladies Watch 1215526 Link : http://www.aaa-replica-watch.com/Ebel_1215526.html Buy the cheapest Ebel 1911 Lady Diamond 18kt Yellow Gold

Ebel 1911 Lady 18kt Yellow Gold and Steel Ladies Watch 1215525 Replica

2008-03-17 Thread sales057
Ebel 1911 Lady 18kt Yellow Gold and Steel Ladies Watch 1215525 Replica, Fake, Cheap, AAA Replica watch Ebel 1911 Lady 18kt Yellow Gold and Steel Ladies Watch 1215525 Link : http://www.aaa-replica-watch.com/Ebel_1215525.html Buy the cheapest Ebel 1911 Lady 18kt Yellow Gold and Steel Ladies Watch 1

Re: ord function problem from newbie

2008-03-17 Thread Paul Rubin
[EMAIL PROTECTED] writes: > for ch in small: > v = ord(ch)-96 > print v total = 0 for ch in small: # the += below updates the value of total by adding (ord(ch) - 96) total += (ord(ch) - 96) print "ch:", ch, "total so far:", total -- http://mail.python

Can't get bsddb working on Solaris 8

2008-03-17 Thread partofthething
I've been struggling with this all day. I am trying to get Python 2.5 running with the BerkeleyDB bindings provided by bsddb. First, I downloaded the BerkeleyDB system (version 4.5) from http://www.oracle.com/technology/products/berkeley-db/index.html. Then, I downloaded bsddb from http://pybsddb

Re: ord function problem from newbie

2008-03-17 Thread Steven Clark
print sum([ord(ch)-96 for ch in small]) On Mon, Mar 17, 2008 at 11:28 PM, <[EMAIL PROTECTED]> wrote: > I'm trying to convert a name into a numerical value that is not > consistent with ANSCII values. In my case, I convert all to lowercase, > then try to sum the value of the letters entered by t

Re: struct unpack

2008-03-17 Thread Mark Tolonen
"brnstrmrs" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If I run: > > testValue = '\x02\x00' > junk = struct.unpack('h', testValue) > > Everything works but If I run > > testValue = raw_input("Enter Binary Code..:") inputting at the > console '\x02\x00' > junk = struct.unpack('

ord function problem from newbie

2008-03-17 Thread David . J . Anderson66
I'm trying to convert a name into a numerical value that is not consistent with ANSCII values. In my case, I convert all to lowercase, then try to sum the value of the letters entered by the user, can't get it to add them. Here is what I have. By the way, the values I need to use is: a=1, b=2, c=3,

Cost of Queue.put

2008-03-17 Thread James
Hi all, I'm struggling with the following problem: I need to disconnect a web service invocation from the addition of some content to a search engine, so that the web service will always return in reasonable time. Basically, what I need is a multi-process safe persistent quick queue. The arrangem

Py in Counter Strike

2008-03-17 Thread bearophileHUGS
A PDF file, Embedding_Python_into_Counter-Strike: http://us.pycon.org/common/2008/talkdata/PyCon2008/020/Case_Study_-_Embedding_Python_into_Counter-Strike_Source.pdf It talks about some problems too. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Any fancy grep utility replacements out there?

2008-03-17 Thread [EMAIL PROTECTED]
So I need to recursively grep a bunch of gzipped files. This can't be easily done with grep, rgrep or zgrep. (I'm sure given the right pipeline including using the find command it could be donebut seems like a hassle). So I figured I'd find a fancy next generation grep tool. Thirty minutes

Re: replace string in a file

2008-03-17 Thread cantabile
Le Mon, 17 Mar 2008 09:03:07 -0700, joep a écrit : > An example: looks for all 'junk*.txt' files in current directory and > replaces in each line the string 'old' by the string 'new' > Josef Works like a charm. Many thanks for the example Josef :-) -- http://mail.python.org/mailman/listinfo/pyth

PyCon video editing

2008-03-17 Thread dundeemt
Anyone know who is in charge of this? I'd like to help out if I could. -jeff hinrichs -- http://mail.python.org/mailman/listinfo/python-list

ctypes in python failed to honor c_int

2008-03-17 Thread Jerry Fleming
Hi, I have a binary file written with c structures. Each record contains a null-terminated string followed by two 4-bytes integers. I wrote a small segment of python code to parse this file in this way: [coe] #!/usr/bin/python from ctypes import * class Entry(Structure): _fields_ = ('w

Re: Fast 2D Raster Rendering with GUI

2008-03-17 Thread Ivan Illarionov
On Mar 18, 4:36 am, dave <[EMAIL PROTECTED]> wrote: > Hi All. I've been formulating in my head a simple image editor. I > actually started prototyping is some time ago in Java, but am liking > Python more and more. My editor will be nowhere near the level of Gimp/ > Photoshop, but I do need fast pi

In regards to threads of today:

2008-03-17 Thread castironpi
Speaking of the standards, anyone ever try to override a method in xmlrpclib.ServerProxy? Case in point, and it's on your computer. Tear it up & tell your manager. Class Transport isn't even documented, despite its being the second parameter to the initializer. The module is > 1000 lines long.

Fast 2D Raster Rendering with GUI

2008-03-17 Thread dave
Hi All. I've been formulating in my head a simple image editor. I actually started prototyping is some time ago in Java, but am liking Python more and more. My editor will be nowhere near the level of Gimp/ Photoshop, but I do need fast pixel level control and display. For instance, that means no a

Re: First Program Bug (Newbie)

2008-03-17 Thread Gabriel Genellina
On 17 mar, 21:03, Benjamin Serrato <[EMAIL PROTECTED]> wrote: > I Found It!! The following was a post asking for help finding a bug. I > thought I needed help with my syntax, but just before sending I found > the bug on line 13. Line 13 should read: "base = 2". I would still > appreciate any comme

Re: how to create instances of classes without calling the constructor?

2008-03-17 Thread castironpi
On Mar 17, 7:08 pm, "Dominik Jain" <[EMAIL PROTECTED]> wrote: > Hi! > > Does anyone know how an instance of a (new-style) class can be created > without having to call the constructor (and providing the arguments it > requires)? With old-style classes, this was possible using new.instance. > Surely

Re: About reading Python code

2008-03-17 Thread Jeff Schwab
sturlamolden wrote: > On 17 Mar, 04:54, WaterWalk <[EMAIL PROTECTED]> wrote: > >> So I'm curious how to read code effectively. I agree that python code >> is clear, but when it becomes long, reading it can still be a hard >> work. > > First, I recommend that you write readable code! Don't use Pyt

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-17 Thread dundeemt
On Mar 17, 10:35 am, fumanchu <[EMAIL PROTECTED]> wrote: > On Mar 16, 5:09 pm, [EMAIL PROTECTED] (Aahz) wrote: > > > fumanchu <[EMAIL PROTECTED]> wrote: > > > This is my third PyCon, and I've found a reasonably-sized cadre of > > > people who come for the hallway conversations plus a Bof or two, >

Re: First Program Bug (Newbie)

2008-03-17 Thread Daniel Fetchinson
> P.S. What is the chance I'll get spam for using my real email address? Exactly 1. > I currently don't get any so... ... you will get now. Sorry to disappoint you, but it's better to be prepared in advance than be shocked later :) Cheers, Daniel -- http://mail.python.org/mailman/listinfo/pyt

Re: First Program Bug (Newbie)

2008-03-17 Thread Mensanator
On Mar 17, 7:03 pm, Benjamin Serrato <[EMAIL PROTECTED]> wrote: > I Found It!! The following was a post asking for help finding a bug. I > thought I needed help with my syntax, but just before sending I found > the bug on line 13. Line 13 should read: "base = 2". I would still > appreciate any comm

Re: stdout custom

2008-03-17 Thread Gabriel Genellina
On 17 mar, 19:43, [EMAIL PROTECTED] wrote: > Can I allocate a second console window, so I can place certain output > to that directly, and leave the original streams alone?  I tried some > things in subprocess (Py 3a3 /WinXP) but they failed.  I don't know if > it's supposed to be possible though,

Re: String To List

2008-03-17 Thread castironpi
On Mar 17, 10:26 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Girish wrote: > > I have a string a = "['xyz', 'abc']".. I would like to convert it to a > > list with elements 'xyz' and 'abc'. Is there any simple solution for > > this?? > > Do you want: > > (1) Specifically to vivify lists formatted

Re: About reading Python code

2008-03-17 Thread Paul Rubin
WaterWalk <[EMAIL PROTECTED]> writes: > from one function to another. But with Python, the debugger is a > little primitive. The default IDLE doesn't even allow me to set a > breakpoint. When the code is long, I am often lost in it. Try winpdb.org which despite the name has nothing to do with MS W

Re: About reading Python code

2008-03-17 Thread sturlamolden
On 17 Mar, 04:54, WaterWalk <[EMAIL PROTECTED]> wrote: > So I'm curious how to read code effectively. I agree that python code > is clear, but when it becomes long, reading it can still be a hard > work. First, I recommend that you write readable code! Don't use Python as if you're entering the o

Re: Pycon disappointment

2008-03-17 Thread dundeemt
> This is my third PyCon, and I've found a reasonably-sized cadre of > people who come for the hallway conversations plus a Bof or two, > having given up on hearing anything new, useful, or inspiring in the > talks. There are several people I know who would like to see a more > advanced academic tr

EuroPython 2008 - Any interest in tutorials?

2008-03-17 Thread David Boddie
As many of you may be aware, preparations for EuroPython 2008 - the European Python community conference - are under way. For the second year running, the event will be held in Vilnius, Lithuania, with the main programme taking place on Monday 7th, Tuesday 8th and Wednesday 9th July. Those of us i

Re: pass float array(list) parameter to C

2008-03-17 Thread zaley
On Mar 17, 10:59 pm, [EMAIL PROTECTED] wrote: > You can also do it with ctypes only; too bad it's not really well > documented. c_float is a type of a floating point number and it has * > operator defined, so that c_float*4 is a type of a 4-element array of > those numbers. So if you want to constr

Re: Which way to access Scintilla

2008-03-17 Thread Neil Hodgson
Alex: > I also want to embed Scintilla in Tkinter-created window (create the > rest of the GUI in Tkinter), or rather, I want to know if that's > possible at all. Any suggestions are appreciated. While it may be possible with sufficient dedication, it is unlikely to be simple. If you reall

First Program Bug (Newbie)

2008-03-17 Thread Benjamin Serrato
I Found It!! The following was a post asking for help finding a bug. I thought I needed help with my syntax, but just before sending I found the bug on line 13. Line 13 should read: "base = 2". I would still appreciate any comments on my program. Maybe there is a better way to do it that I didn

how to create instances of classes without calling the constructor?

2008-03-17 Thread Dominik Jain
Hi! Does anyone know how an instance of a (new-style) class can be created without having to call the constructor (and providing the arguments it requires)? With old-style classes, this was possible using new.instance. Surely there must be a simple way to do this with new-style classes, too --

Tkinter right-to-left windows

2008-03-17 Thread iu2
Hi, I use tix NoteBook, and I need the tabs arranged right to left. Is it possible? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: placing a Python com object into Excel

2008-03-17 Thread Mathew
Thanks for the tip. But, instead of an AddIn, what if I want to be able to insert an object? I see that the demo adds items to the windows registry under \Excel\AddIns. Is there a similar location for the "Insert Object" command? yikes. More Excel programming than I'd like to know. Mathew M

Re: Interesting math problem

2008-03-17 Thread Jeff Schwab
BJörn Lindqvist wrote: > Here is an interesting math problem: > > You have a number X > 0 and another number Y > 0. The goal is to > divide X into a list with length Y. Each item in the list is an > integer. The sum of all integers is X. Each integer is either A or A + > 1, those should be "evenly

Re: Pycon disappointment

2008-03-17 Thread Raymond Hettinger
On Mar 16, 4:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote: > If the following seems unnecessarily harsh, it was even more harsh for > me to discover that the time and money I had spent to get to my > favorite conference had been sold to vendors, presenting me as a > captive audience they could pitc

Re: Interesting math problem

2008-03-17 Thread Ivan Illarionov
On Mar 18, 1:24 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > Here is an interesting math problem: > > You have a number X > 0 and another number Y > 0. The goal is to > divide X into a list with length Y. Each item in the list is an > integer. The sum of all integers is X. Each integer is eit

Re: Pycon disappointment

2008-03-17 Thread Jacob Kaplan-Moss
On Mar 17, 2:52 pm, Dianne Marsh <[EMAIL PROTECTED]> wrote: > I'm bummed about the lightning talks at PyCon from 2008, but I have a > lot of confidence based on what I have read here from Jacob and > others, that things will be different in 2009. They will! This year's lightning talks[*] were disa

Re: Interesting math problem

2008-03-17 Thread Arnaud Delobelle
On Mar 17, 10:24 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > Here is an interesting math problem: > > You have a number X > 0 and another number Y > 0. The goal is to > divide X into a list with length Y. Each item in the list is an > integer. The sum of all integers is X. Each integer is ei

Re: Interesting math problem

2008-03-17 Thread castironpi
On Mar 17, 5:24 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > Here is an interesting math problem: > > You have a number X > 0 and another number Y > 0. The goal is to > divide X into a list with length Y. Each item in the list is an > integer. The sum of all integers is X. Each integer is eit

Re: stdout custom

2008-03-17 Thread castironpi
On Mar 17, 8:16 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 16 Mar 2008 22:27:28 -0200, <[EMAIL PROTECTED]> escribió: > > > Specifically, before the prompts.  Where does the prompt write come > > from; why doesn't it honor my settings of sys.stdout and sys.stderr? > > The interacti

Re: lists v. tuples

2008-03-17 Thread castironpi
On Mar 17, 11:03 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Ninereeds <[EMAIL PROTECTED]> wrote: > > On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > > >> A common explanation for this is that lists are for homogenous > >> collections, tuples are for when you have heterogenous colle

Re: placing a Python com object into Excel

2008-03-17 Thread M�ta-MCI (MVP)
Hi! Perso, I started from "excelAddin.py" (in C:\Python25\Lib\site-packages\win32com\demos). And, I'm happy with the result (who run OK with Excel 2000, XP, 2007). @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Interesting math problem

2008-03-17 Thread BJörn Lindqvist
Here is an interesting math problem: You have a number X > 0 and another number Y > 0. The goal is to divide X into a list with length Y. Each item in the list is an integer. The sum of all integers is X. Each integer is either A or A + 1, those should be "evenly distributed." Example: 17 // 5 =

Re: Convert binary file

2008-03-17 Thread Diez B. Roggisch
Vamp4L schrieb: > Hello, > Specifically, I'm trying to convert the Internet Explorer history > file (index.dat) into a readable format. Anyone done something > similar or know of any functions that may help with such a task? I'm > not sure exactly what kind of file the index.dat is, it is some

Convert binary file

2008-03-17 Thread Vamp4L
Hello, Specifically, I'm trying to convert the Internet Explorer history file (index.dat) into a readable format. Anyone done something similar or know of any functions that may help with such a task? I'm not sure exactly what kind of file the index.dat is, it is some kind of binary file. I ha

Comunicate processes with python

2008-03-17 Thread Adrián Bravo Navarro
Hi, let me introduce ourselves first. We are a smallish group of students working on a open source snapshot/backup system (www.hdlorean.com or http://launchpad.net/hdlorean). We are using python for almost all of the code and for all of us this is the first python project we develop. At this point

Re: Apache binary error?

2008-03-17 Thread Michael Wieher
yes that was already there, but it kept giving me that every-other problem i know its the fact the web-browser wasn't passed the "content-type=..." on the alternate reloads but as to why im lost in the end i figure its best to just ignore this and move to the more beta-test dev stage which invol

php/python webkit2png issue

2008-03-17 Thread browntown
Hi...i'm relatively new to python...i'm trying to use webkit2png to take some screenshots. Everything works fine when I run the script from the command line...things do not work when i try to execute them from php using exec. My php code looks something like: exec("python /usr/local/bin/webkit2pn

Re: Apache binary error?

2008-03-17 Thread Graham Dumpleton
On Mar 18, 4:43 am, Sean Allen <[EMAIL PROTECTED]> wrote: > On Mar 17, 2008, at 10:55 AM, Michael Wieher wrote: > > > have simple webpage running > > > apache,mod_python > > > the error is binary > > ...binary as in "every other" time I load the page, Firefox keeps   > > telling me I'm download

win32: emulating select() on pipes

2008-03-17 Thread gangesmaster
hi i'm trying to figure out if a pipe on win32 has data for me to read. this is the code i've come up with: def poll(self, timeout, interval = 0.2): """a poor man's version of select() on win32""" from win32pipe import PeekNamedPipe from msvcrt import g

elementtree and entities

2008-03-17 Thread rurpy
I need to parse little snipits of xml that come from a file that has a large DTD that defines hundreds or entities. But when these snipits are parsed (with elementtree.XML()) without the DTD, the entities are undefined and cause a parse failure. Is there any way to tell elementtree to not fail on

Re: struct unpack

2008-03-17 Thread Ivan Illarionov
On Mar 17, 11:00 pm, brnstrmrs <[EMAIL PROTECTED]> wrote: > If I run: > > testValue = '\x02\x00' > junk = struct.unpack('h', testValue) > > Everything works but If I run > > testValue = raw_input("Enter Binary Code..:") inputting at the > console '\x02\x00' > junk = struct.unpack('h', testValue) >

Sharing code between server, client, and web

2008-03-17 Thread Jeff
Hello everyone. This is a basic question of structure--something that it's rather difficult to search for. So, here's what there will be once this project is finished: 1) A server using Twisted and SQLAlchemy 2) A desktop client connecting to that server (with Twisted), using wxPython 3) A web

Re: Immutable and Mutable Types

2008-03-17 Thread Duncan Booth
Matthew Woodcraft <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Duncan Booth <[EMAIL PROTECTED]> wrote: >> I don't have a copy of 1.4 to check so I'll believe you, but you can >> certainly get the output I asked for with much more recent versions. > >> For the answer I actually

Re: placing a Python com object into Excel

2008-03-17 Thread Michael Wieher
2008/3/17, Mathew <[EMAIL PROTECTED]>: > > Hi > I have seen examples from Mark Hammonds book where a Python COM object > is accessed from Excel with a VBA script. But, what if I want to Insert > a Python COM into the Sheet itself? > > When I try this, a list of available objects appear. But my obje

Re: struct unpack

2008-03-17 Thread Michael Wieher
> > testValue = '\x02\x00' > junk = struct.unpack('h', testValue) #Works > > testValue = raw_input("Enter Binary Code..:") inputting at the > console '\x02\x00' > junk = struct.unpack('h', testValue) > > error: unpack requires a string argument of length 2 Well, it thinks the length of the test

placing a Python com object into Excel

2008-03-17 Thread Mathew
Hi I have seen examples from Mark Hammonds book where a Python COM object is accessed from Excel with a VBA script. But, what if I want to Insert a Python COM into the Sheet itself? When I try this, a list of available objects appear. But my object isn't on the list. Anybody have any ideas? M

struct unpack

2008-03-17 Thread brnstrmrs
If I run: testValue = '\x02\x00' junk = struct.unpack('h', testValue) Everything works but If I run testValue = raw_input("Enter Binary Code..:") inputting at the console '\x02\x00' junk = struct.unpack('h', testValue) It errors out with Traceback (most recent call last): File "/home/nirmal/

Re: Pycon disappointment

2008-03-17 Thread Dianne Marsh
This was my first PyCon as well. I had heard glowing recommendations about the lightning talks (from Bruce) previously, and I was really looking forward to them. I, too, was disappointed. I help to organize a community based conference, and we have struggled with providing value for sponsors as

Re: Regarding coding style

2008-03-17 Thread [EMAIL PROTECTED]
On Mar 17, 12:15 pm, rockingred <[EMAIL PROTECTED]> wrote: > On Mar 10, 11:30 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Fix that. That's usually something that's fairly easy to get done as > > a programmer (I've had to do it at 2 of the last 4 places I worked). > > Just go explain

Re: Pycon disappointment

2008-03-17 Thread J. Clifford Dyer
I just want to step in and offer my 2¢. This is my first PyCon, and I agree that a lot of the Lightning talks seemed pretty useless. Overall though, I had a great experience at this conference. I learned a lot; I met a lot of cool people; and I got really excited about new ideas to bring back ho

Re: Python 3 and PEP238 division

2008-03-17 Thread Terry Reedy
"Ninereeds" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Is the PEP238 change to division going into Python 3 as planned? IDLE 3.0a3 >>> 1/2 0.5 | I realise that the new integer division semantics have been available | in "from __future__" for quite a few years now, but a warni

Re: how long do the different python-vm bytecodes take?

2008-03-17 Thread Terry Reedy
"GHUM" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I looked at the virtual machine bytecode of python programs: | | def f(whatever): |text="Hallo"+whatever |return text | | import dis | dis.dis(f) | 2 0 LOAD_CONST 1 ('Hallo') | 3 LOAD

Re: Missing PyObject definition

2008-03-17 Thread Michael Wieher
2008/3/17, James Whetstone <[EMAIL PROTECTED]>: > > Hi, > > Yeah, I've included python.h and object.h but the compiler still complain > about not finding PyObject. It's weird.So I'm developing and App on > windows using VS 8.0. I've intalled Python 2.5 and have added the include > directory t

how long do the different python-vm bytecodes take?

2008-03-17 Thread GHUM
I looked at the virtual machine bytecode of python programs: def f(whatever): text="Hallo"+whatever return text import dis dis.dis(f) 2 0 LOAD_CONST 1 ('Hallo') 3 LOAD_FAST0 (whatever) 6 BINARY_ADD 7 STORE

Re: Anomaly in time.clock()

2008-03-17 Thread Roel Schroeven
Godzilla schreef: > Hello, > > I have been reading a thread about time.clock() going backward, which > is exactly what I am seeing... the thread generally leaning toward the > problem is caused by multi-processor machines. But I am seeing it at a > single CPU computer, and running XP. > > The err

Re: questions about named pipe objects...

2008-03-17 Thread waltbrad
On Mar 17, 1:59 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > > A Unix fifo is only nominally a file. It's really just a convenient way > of referring to an in-memory object. > mkfifo f > some_prog > f & > cat f > > Is semantically equivalent to: > > some_prog | cat > > If you w

Re: Immutable and Mutable Types

2008-03-17 Thread Matthew Woodcraft
In article <[EMAIL PROTECTED]>, Duncan Booth <[EMAIL PROTECTED]> wrote: > I don't have a copy of 1.4 to check so I'll believe you, but you can > certainly get the output I asked for with much more recent versions. > For the answer I actually want each asterisk substitutes for exactly one > char

Re: SAXReaderNotAvaiable after switching Python

2008-03-17 Thread mich1985
Hello all, i think that my problem is solved now. I haven't seen that the old package was recompiled from another guy. Best regards, flo On 17 Mrz., 13:12, mich1985 <[EMAIL PROTECTED]> wrote: > Hello all, > after i have switched from python-2.4.2 to python-2.4.3 i get the > following message if r

Re: Immutable and Mutable Types

2008-03-17 Thread Duncan Booth
Stargaming <[EMAIL PROTECTED]> wrote: > On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote: > >> For the answer I actually want each asterisk substitutes for exactly one >> character. > > Played around a bit and found that one: > > Python 3.0a3+ (py3k:61352, Mar 12 2008, 12:58:20) > [GCC 4.

Re: questions about named pipe objects...

2008-03-17 Thread Jeff Schwab
waltbrad wrote: > I'm proceeding slowly though the Lutz book "Programming Python". I'm > in the section on named pipes. The script he uses has two functions: > one for the child the other for the parent. You start the parent then > the child: > > python pipefifo.py #starts the parent > > file /

Re: questions about named pipe objects...

2008-03-17 Thread waltbrad
On Mar 17, 1:50 pm, waltbrad <[EMAIL PROTECTED]> wrote: > > I then wanted to start the child process first and see what happened > when I ran the parent. Well that works but the reads come out in > random order. Well, I take that back. I accidentally had two 'parent' processes open. So, the reads

questions about named pipe objects...

2008-03-17 Thread waltbrad
I'm proceeding slowly though the Lutz book "Programming Python". I'm in the section on named pipes. The script he uses has two functions: one for the child the other for the parent. You start the parent then the child: python pipefifo.py #starts the parent file /tmp/pipefifo # shows that the f

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread Gabriel Genellina
En Mon, 17 Mar 2008 14:22:31 -0300, hellt <[EMAIL PROTECTED]> escribió: > On 17 мар, 15:48, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Mon, 17 Mar 2008 08:56:26 -0200, hellt <[EMAIL PROTECTED]> >> escribi�: >> >> > i have a problem with this modules py2exe + pywinauto + sendkeys used >>

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
On 17 мар, 20:22, hellt <[EMAIL PROTECTED]> wrote: > On 17 мар, 15:48, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > > > En Mon, 17 Mar 2008 08:56:26 -0200, hellt <[EMAIL PROTECTED]> escribi�: > > > > i have a problem with this modules py2exe + pywinauto + sendkeys used > > > together. > > >

Re: Apache binary error?

2008-03-17 Thread Sean Allen
On Mar 17, 2008, at 10:55 AM, Michael Wieher wrote: > have simple webpage running > > apache, mod_python > > the error is binary > ...binary as in "every other" time I load the page, Firefox keeps > telling me I'm downloading a python script, and asks to open it in > WINE, which is really

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
On 17 мар, 15:48, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 17 Mar 2008 08:56:26 -0200, hellt <[EMAIL PROTECTED]> escribi�: > > > i have a problem with this modules py2exe + pywinauto + sendkeys used > > together. > > > In my script i'm using this expression > > app.window_(title="SJ

Re: Pycon disappointment

2008-03-17 Thread DavidA
On Mar 16, 9:42 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > Do you mean the "official" presentations or the lightning talks? I > thought both were kind of bad. Jeff Rush was great in both of the > sessions I saw and the gaming presenters were also good. But I saw a > lot of people who had never

Question on using distutils.core.run_setup

2008-03-17 Thread Terry Jones
I'm trying to programmatically install something built using distutils. I found distutils.core.run_setup and can use it via >>> dist = run_setup('setup.py', ['-q', 'install']) Is that the recommended way to do an install from inside Python (as opposed to doing it on the command line)? If so, h

Re: Immutable and Mutable Types

2008-03-17 Thread Stargaming
On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote: > For the answer I actually want each asterisk substitutes for exactly one > character. Played around a bit and found that one: Python 3.0a3+ (py3k:61352, Mar 12 2008, 12:58:20) [GCC 4.2.3 20080114 (prerelease) (Debian 4.2.2-7)] on linux2 T

Re: Missing PyObject definition

2008-03-17 Thread James Whetstone
Hi, Yeah, I've included python.h and object.h but the compiler still complain about not finding PyObject. It's weird.So I'm developing and App on windows using VS 8.0. I've intalled Python 2.5 and have added the include directory to my project's configuration. I'm also using boost.python

Re: Why doesn't xmlrpclib.dumps just dump an empty value instead of ?

2008-03-17 Thread martin f krafft
also sprach martin f krafft <[EMAIL PROTECTED]> [2008.03.16.1421 +0100]: > Why doesn't it just yield > > '\n\n\n\n' > > Or even just > > '\n\n\n' There's a difference between those two. The first one has an empty string value ('') while the second one pretty clearly says that there is a par

Re: Regarding coding style

2008-03-17 Thread rockingred
On Mar 10, 11:30 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Fix that. That's usually something that's fairly easy to get done as > a programmer (I've had to do it at 2 of the last 4 places I worked). > Just go explain all the problems that can happen by not having VC and > all the benefi

Re: Immutable and Mutable Types

2008-03-17 Thread Duncan Booth
Stargaming <[EMAIL PROTECTED]> wrote: > On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote: >> Here's a puzzle for those who think they know Python: >> >> Given that I masked out part of the input, which version(s) of Python >> might give the following output, and what might I have replaced b

  1   2   >