Re: 2to3 Help?

2009-03-04 Thread jjh
On Jan 14, 10:01 pm, marco.m.peter...@gmail.com wrote: > I have Python 3.0. I tried to use the 2to3 program included with the > interpreter to convert some scripts for Python 2.5 to Python 3.0 ones. > When I try to start it form the Python command line, it says it is a > syntax error. > > This was

Re: Dr Dobbs' Python Weekly URL Archive?

2009-03-04 Thread andrew cooke
if it's any help, i have them going back to march 2003 in an imap folder. i can provide a tarball or similar of a maildir. andrew Steve Holden wrote: > My well-known-search-engine-foo must be at an all-time low today. *Is* > there an index and I can't see for looking? > > regards > Steve > --

Re: Dr Dobbs' Python Weekly URL Archive?

2009-03-04 Thread Hendrik van Rooyen
"Steve Holden" wrote: > My well-known-search-engine-foo must be at an all-time low today. *Is* > there an index and I can't see for looking? > typing in python weekly at google gives me: Python-URL!The bookmark for this page is: http://purl.org/thecliff/python/url.html. Dr. Dobb's Python-URL! -

Re: String Identity Test

2009-03-04 Thread Hendrik van Rooyen
"S Arrowsmith" wrote: > "Small" integers get a similar treatment: > > >>> a = 256 > >>> b = 256 > >>> a is b > True > >>> a = 257 > >>> b = 257 > >>> a is b > False This is weird - I would have thought that the limit of "small" would be at 255 - the biggest number to fit in a byte. 256 takes

Re: Question about binary file reading

2009-03-04 Thread Hendrik van Rooyen
"Benjamin Peterson" wrote: >So called encodings like "hex" and "rot13" are abuse of >encode() method. encode() should translate >between byte strings and unicode, not preform >transformations like that. This has been removed >in 3.x, so you should use binascii. When all else fails, and just for

PyPI editing

2009-03-04 Thread andrew cooke
Not sure where to ask this, but how do I edit my PyPI page? http://pypi.python.org/pypi/LEPL/2.0 doesn't have any text compared to http://pypi.python.org/pypi/pypp/0.0.2 (selected at random). How do I the "Benefits", "Drawbacks" etc? I have clicked around the admin interface, but I only see wha

Re: [pysqlite] [ANN] pysqlite 2.5.2

2009-03-04 Thread Edzard Pasma
Hello, It looks that the issue with fetch across rollback still can occur in the new version. It turned up when I applied the Pysqlite transaction test suite to some dbapi2 version of my own. Below is a minimal script to reproduce it. It has puzzled me what goes wrong and I would like to believ

Re: Question about binary file reading

2009-03-04 Thread Tino Wildenhain
Benjamin Peterson wrote: John Machin lexicon.net> writes: On Mar 5, 12:13 pm, Benjamin Peterson wrote: import binascii print binascii.hexlify(some_bytes) AFAICT binascii.hexlify(some_bytes) gives the SAME result as some_bytes.encode("hex") for much more typing -- I see no "better" here. So

Re: What does self.grid() do?

2009-03-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Mar 2009 09:04:50 -0800, chuck wrote: > On Mar 3, 10:40 pm, Marc 'BlackJack' Rintsch wrote: >> On Tue, 03 Mar 2009 18:06:56 -0800, chuck wrote: >> > I am learning python right now.  In the lesson on tkinter I see this >> > piece of code >> >> > from Tkinter import * >> >> > class MyFra

Re: Help required to read and print lines based on the type of first character

2009-03-04 Thread Paul Rubin
abhinayaraj.r...@emulex.com writes: > if '' in data: > count = 4 > elif '###' in data: > count = 3 > elif '##' in data: > count = 2 > elif '#' in data: > count = 1 > elif data.find('#') == -1: >

Re: Peculiar swap behavior

2009-03-04 Thread Lie Ryan
andrew cooke wrote: Delaney, Timothy (Tim) wrote: Tim Chase wrote: # swap list contents...not so much... >>> m,n = [1,2,3],[4,5,6] >>> m[:],n[:] = n,m >>> m,n ([4, 5, 6], [4, 5, 6]) [...] For these types of things, it's best to expand the code out. The appropriate expansion of: m,n = [

RE: Help required to read and print lines based on the type of first character

2009-03-04 Thread Abhinayaraj . Raju
Thank you for the suggestions. Some little reading gave the idea and it works well too. :) Here is the code: fileIN = open("test.txt") count = 0 for line in fileIN: data= line if '' in data: count = 4 elif '###' in data: count = 3

Re: Parsing/Crawler Questions..

2009-03-04 Thread John Nagle
bruce wrote: hi phillip... thanks for taking a sec to reply... i'm solid on the test app i've created.. but as an example.. i have a parse for usc (southern cal) and it exrtacts the courselist/class schedule... my issue was that i realized the multiple runs of the app was giving differentt resu

Dr Dobbs' Python Weekly URL Archive?

2009-03-04 Thread Steve Holden
My well-known-search-engine-foo must be at an all-time low today. *Is* there an index and I can't see for looking? regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ Want to know? Come to PyCon - soon! http://us.pyco

Re: Help required to read and print lines based on the type of first character

2009-03-04 Thread gagsl-py2
De: "abhinayaraj.r...@emulex.com" > I am sorry to that I am not able to fully grasp it. Could you help me with > some more details? > How can I identify each line and utilize the interactive interpreter? You really should read the tutorial at http://docs.python.org/tut (or any other introductor

Re: sys.path with multiple Python installations

2009-03-04 Thread Gabriel Genellina
En Thu, 05 Mar 2009 01:48:44 -0200, Xavier Lapointe Desjardins escribió: this is my first post on the mailing list, so I'll try to be clear enough. I've on my computer WinXp x64 with python 2.5 and 2.6 installed. When I tried to run a small script using smtplib using Python 2.6, I got that e

Re: Reading a file

2009-03-04 Thread Aahz
In article , Terry Reedy wrote: > >for line in open('char.txt'): > if line.find('sweet') != -1 or line.find('blue') != -1: > print(line) For any recent Python, this should be: if 'sweet' in line or 'blue' in line: Although I think that for the OP's use case, it ought to be: if l

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Paul Rubin
Steven D'Aprano writes: > Sure, but if you want two lists, as the OP asked for, then you have to > iterate over it twice either way: > > # method 1: > keys = dict.keys() > values = dict.values() > > # method 2: > keys, values = zip(*dict.items()) > > First you iterate over the dict to get the

Re: Question about binary file reading

2009-03-04 Thread Benjamin Peterson
John Machin lexicon.net> writes: > On Mar 5, 12:13 pm, Benjamin Peterson wrote: > > > > import binascii > > print binascii.hexlify(some_bytes) > > AFAICT binascii.hexlify(some_bytes) gives the SAME result as > some_bytes.encode("hex") for much more typing -- I see no > "better" > here. So calle

RE: Parsing/Crawler Questions..

2009-03-04 Thread bruce
hi phillip... thanks for taking a sec to reply... i'm solid on the test app i've created.. but as an example.. i have a parse for usc (southern cal) and it exrtacts the courselist/class schedule... my issue was that i realized the multiple runs of the app was giving differentt results... in my ca

sys.path with multiple Python installations

2009-03-04 Thread Xavier Lapointe Desjardins
Hi everyone :o), this is my first post on the mailing list, so I'll try to be clear enough. I've on my computer WinXp x64 with python 2.5 and 2.6 installed. When I tried to run a small script using smtplib using Python 2.6, I got that error message: " Traceback (most recent call last): File "<

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Steven D'Aprano
On Wed, 04 Mar 2009 08:00:14 -0800, Paul McGuire wrote: > On Mar 4, 5:33 am, Lie Ryan wrote: >> Andre Engels wrote: >> > y = d.values() might also work, but I am not sure whether d.keys() >> > and d.values() are guaranteed to use the same order. >> >> If they were called immediately after each ot

Re: Peculiar swap behavior

2009-03-04 Thread Terry Reedy
Tim Chase wrote: I stumbled across this oddity and was hoping folks on the list might be able to provide a little understanding: # swap scalars >>> x,y = 1,2 >>> x,y = y,x >>> x,y (2, 1) # swap lists >>> a,b = [1,2,3],[4,5,6] >>> a,b = b,a >>> a,b ([4, 5, 6], [1, 2, 3]) # swap list cont

Re: Parsing/Crawler Questions..

2009-03-04 Thread Philip Semanchuk
On Mar 4, 2009, at 4:44 PM, bruce wrote: Hi... Sorry that this is a bit off track. Ok, maybe way off track! But I don't have anyone to bounce this off of.. I'm working on a crawling project, crawling a college website, to extract course/class information. I've built a quick test app in pyt

Re: Question about binary file reading

2009-03-04 Thread John Machin
On Mar 5, 12:13 pm, Benjamin Peterson wrote: > Tino Wildenhain wildenhain.de> writes: > > > Rhodri James wrote: > > > for b in x: > > >     print hex(ord(b)) > > > better: > > > print x.encode("hex") > > even better: > > import binascii > print binascii.hexlify(some_bytes) AFAICT binascii.hexlif

Re: Question about binary file reading

2009-03-04 Thread Scott David Daniels
vibgyorbits wrote: I'm writing a tool to do some binary file comparisons. I'm opening the file using fd=open(filename,'rb') > # Need to seek to 0x80 (hex 80th) location fd.seek(0x80) # Need to read just 8 bytes and get the result back in hex format. x=fd.read(8) print x This print

Re: why python doesn't have a writeline() method like c# ?

2009-03-04 Thread Benjamin Peterson
Chris Rebert rebertia.com> writes: > Sidenote: file.writelines() seems very misleadingly named. Indeed since it is basically a shortcut for f.write("".join(lines)). -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about binary file reading

2009-03-04 Thread Benjamin Peterson
Tino Wildenhain wildenhain.de> writes: > Rhodri James wrote: > > for b in x: > > print hex(ord(b)) > > > > better: > > print x.encode("hex") even better: import binascii print binascii.hexlify(some_bytes) -- http://mail.python.org/mailman/listinfo/python-list

Re: why python doesn't have a writeline() method like c# ?

2009-03-04 Thread Benjamin Peterson
ww gmail.com> writes: > > just curious, it would make writing to a file a bit easier? Because readline() returns the line with the newline attached, writeline() would have to require a newline at the. Therefore, it would be equivalent to write()! Just use f.write("some line\n"). -- http:/

Re: Roulette wheel

2009-03-04 Thread mattia
> Note how get_roulette_wheel() is now completeley independent of the > concrete problem you are using it for. Ok, but also a lot more memory consuming ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with text alignment

2009-03-04 Thread alejandro
>> self.sirina = wx.StaticText(self,-1,'Some text that\n will be alignet >> \nat the right',(200,50),style=wx.ALIGN_RIGHT) #- this would be an example, the reason I didnt understand is that I used just one line of text I understand now. Can I align it on the right withot usi

Re: why python doesn't have a writeline() method like c# ?

2009-03-04 Thread Chris Rebert
On Wed, Mar 4, 2009 at 4:46 PM, ww wrote: > just curious, it would make writing to a file  a bit easier? Because we have print(), which adds the newline, and most other cases either involve lists of stuff (so '\n'.join() is used), or the string comes back from a library and already has newlines,

why python doesn't have a writeline() method like c# ?

2009-03-04 Thread ww
just curious, it would make writing to a file a bit easier? -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about binary file reading

2009-03-04 Thread John Machin
On Mar 5, 10:51 am, "Rhodri James" wrote: > On Wed, 04 Mar 2009 23:28:32 -, Tino Wildenhain   > wrote: > > > > > Rhodri James wrote: > >> On Wed, 04 Mar 2009 22:58:38 -, vibgyorbits   > >> wrote: > > >>> I'm writing a tool to do some binary file comparisons. > >>> I'm opening the file us

Re: Question about binary file reading

2009-03-04 Thread Ben Finney
I just found a well-hidden part of the behaviour you expected. vibgyorbits writes: > # Need to read just 8 bytes and get the result back in hex format. > x=fd.read(8) > print x Why would this print the bytes in hex format? “Convert to hexadecimal” is not the default text encoding for ‘print’.

Re: Upgrade Python on a Mac

2009-03-04 Thread Jorgen Grahn
On Tue, 3 Mar 2009 16:47:51 +1100, Python Nutter wrote: ... > PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" > export PATH ... > If you have ever looked at your Mac?s root directory and wondered what > some of those other directories are for, you?re probably not alone. >

Re: Question about binary file reading

2009-03-04 Thread Ben Finney
vibgyorbits writes: > I'm writing a tool to do some binary file comparisons. > I'm opening the file using > > fd=open(filename,'rb') > > # Need to seek to 0x80 (hex 80th) location > > fd.seek(0x80) > > # Need to read just 8 bytes and get the result back in hex format. > x=fd.read(8) > print x

Re: Question about binary file reading

2009-03-04 Thread Rhodri James
On Wed, 04 Mar 2009 23:28:32 -, Tino Wildenhain wrote: Rhodri James wrote: On Wed, 04 Mar 2009 22:58:38 -, vibgyorbits wrote: I'm writing a tool to do some binary file comparisons. I'm opening the file using fd=open(filename,'rb') # Need to seek to 0x80 (hex 80th) location fd

Re: Question about binary file reading

2009-03-04 Thread Tino Wildenhain
Rhodri James wrote: On Wed, 04 Mar 2009 22:58:38 -, vibgyorbits wrote: I'm writing a tool to do some binary file comparisons. I'm opening the file using fd=open(filename,'rb') # Need to seek to 0x80 (hex 80th) location fd.seek(0x80) # Need to read just 8 bytes and get the result back i

Re: Question about binary file reading

2009-03-04 Thread Rhodri James
On Wed, 04 Mar 2009 22:58:38 -, vibgyorbits wrote: I'm writing a tool to do some binary file comparisons. I'm opening the file using fd=open(filename,'rb') # Need to seek to 0x80 (hex 80th) location fd.seek(0x80) # Need to read just 8 bytes and get the result back in hex format. x=fd.re

Re: Question about binary file reading

2009-03-04 Thread Chris Rebert
On Wed, Mar 4, 2009 at 2:58 PM, vibgyorbits wrote: > I'm writing a tool to do some binary file comparisons. > I'm opening the file using > > fd=open(filename,'rb') > > # Need to seek to 0x80 (hex 80th) location > > fd.seek(0x80) > > # Need to read just 8 bytes and get the result back in hex format

Re: Convert IPv6 address to binary representation on 2.x/Windows

2009-03-04 Thread Martin v. Löwis
>> I do wonder why you need a binary representation of an IPv6 address... > I'd like to subscribe to an IPv6 multicast address via > socket.setsockopt(IPPROTO_IPV6, IPV6_JOIN_GROUP, binary_address). I see. >> Yes, writing your own routine is certainly an option. > Is it the preferred one? Prefer

Question about binary file reading

2009-03-04 Thread vibgyorbits
I'm writing a tool to do some binary file comparisons. I'm opening the file using fd=open(filename,'rb') # Need to seek to 0x80 (hex 80th) location fd.seek(0x80) # Need to read just 8 bytes and get the result back in hex format. x=fd.read(8) print x This prints out garbage. I would like to kno

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Benjamin Peterson
Andre Engels gmail.com> writes: > y = d.values() might also work, but I am not sure whether d.keys() and > d.values() are guaranteed to use the same order. They are for the builtin dictionary type, but that requirement does not extend to any other mapping type. (It's not a requirement of the Mapp

Re: Parsing/Crawler Questions..

2009-03-04 Thread MRAB
bruce wrote: Hi... Sorry that this is a bit off track. Ok, maybe way off track! But I don't have anyone to bounce this off of.. I'm working on a crawling project, crawling a college website, to extract course/class information. I've built a quick test app in python to crawl the site. I crawl a

Re: Convert IPv6 address to binary representation on 2.x/Windows

2009-03-04 Thread Philipp Hagemeister
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi Martin, Martin v. Löwis wrote: > I do wonder why you need a binary representation of an IPv6 address... I'd like to subscribe to an IPv6 multicast address via socket.setsockopt(IPPROTO_IPV6, IPV6_JOIN_GROUP, binary_address). > Yes, writing your

Re: Problem with py2exe conversion.

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 11:38:35 -0200, venutaurus...@gmail.com escribió: On Mar 4, 6:23 pm, "Gabriel Genellina" wrote: En Wed, 04 Mar 2009 11:12:32 -0200, venutaurus...@gmail.com   escribió: >             I am facing an interesting problem with py2exe conversion. > I've a python script which u

Parsing/Crawler Questions..

2009-03-04 Thread bruce
Hi... Sorry that this is a bit off track. Ok, maybe way off track! But I don't have anyone to bounce this off of.. I'm working on a crawling project, crawling a college website, to extract course/class information. I've built a quick test app in python to crawl the site. I crawl at the top level

ANN: tracshell 0.1r23

2009-03-04 Thread J Kenneth King
Hello everyone, Just wanted to let everyone know that I'm still working on TracShell and it has come a long way in the last couple of weeks! As of r23, TracShell has introduced the following features and fixes: - TracShell now queries the Trac server for a list of available methods and ensure

Re: Roulette wheel

2009-03-04 Thread mattia
Il Wed, 04 Mar 2009 21:30:54 +0100, Peter Otten ha scritto: > mattia wrote: > >> Hi everyone, I'm new to python and I want to create some simple code in >> order to code the classical genetic algorithm example: given a >> population of chromosomes, encoded using 1 and 0, find the chromosome >> wi

Re: Convert IPv6 address to binary representation on 2.x/Windows

2009-03-04 Thread Martin v. Löwis
> Neither of these values looks like 0x0001. Am I missing > something or is the documentation just wrong? If so, how am I supposed > to get a binary representation of an IPv6 address in the absence of > socket.inet_pton? Should I write my I own version? I do wonder why you need a binar

Re: looking for template package

2009-03-04 Thread Robert Kern
On 2009-03-03 20:06, Neal Becker wrote: I'm looking for something to do template processing. That is, transform text making various substitutions. I'd like to be able to do substitutions that include python expressions, to do arithmetic computations within substitutions. I know there are lots

Convert IPv6 address to binary representation on 2.x/Windows

2009-03-04 Thread Philipp Hagemeister
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 socket.inet_pton which does exactly what I want is not available on 2.x on Windows. Strangely, the documentation of socket.inet_aton (IPv4 only) reads: "inet_aton() does not support IPv6, and getnameinfo() should be used instead for IPv4/v6 dual sta

Re: Roulette wheel

2009-03-04 Thread Peter Otten
mattia wrote: > Hi everyone, I'm new to python and I want to create some simple code in > order to code the classical genetic algorithm example: given a population > of chromosomes, encoded using 1 and 0, find the chromosome with the > maximum number of 1s. Now, despite all the code used to implem

Re: A Simple Tkinter Control Program--Slight Problem

2009-03-04 Thread W. eWatson
Marc 'BlackJack' Rintsch wrote: On Wed, 04 Mar 2009 10:09:10 -0800, W. eWatson wrote: Here's what I think the author meant in discussing a control variable sample program. from Tkinter import * v=Tk.StringVar() e = Entry(master, textvariable=v) e.pac

Re: How to create Standalone PYC File

2009-03-04 Thread Shane Geiger
py2exe (Windows) and py2app (Mac) are probably what you are looking for. Rohan Hole wrote: I have .py file which uses some third party modules like egg files, like simplejson and python-twitter , - start of file - import ConfigParser import getopt import os import sys import twit

Re: WinCE and python

2009-03-04 Thread Vlastimil Brom
2009/3/2 ssd : > Hi, > > Has somebody tested this pyhton implementation in Windows CE 6.0? > http://sourceforge.net/projects/pythonce/ > > > I have tried in my WinCE 6.0 platform, I can run some commands in the shell, > but I can not run that commands in python script (.py), "python.exe test.py" >

Re: How to create Standalone PYC File

2009-03-04 Thread Chris Rebert
On Wed, Mar 4, 2009 at 11:38 AM, Rohan Hole wrote: > I have .py file which uses some third party modules like egg files, like > simplejson and python-twitter , > > - start of file  - > > import ConfigParser > import getopt > import os > import sys > import twitter > > > when i compile this

Re: A Simple Tkinter Control Program--Slight Problem

2009-03-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Mar 2009 10:09:10 -0800, W. eWatson wrote: > Here's what I think the author meant in discussing a control variable > sample program. > > from Tkinter import * > > v=Tk.StringVar() > > e = Entry(master, textvariable=v) > e.pack() > e.focus_set

How to create Standalone PYC File

2009-03-04 Thread Rohan Hole
I have .py file which uses some third party modules like egg files, like simplejson and python-twitter , - start of file - import ConfigParser import getopt import os import sys import twitter when i compile this py file using compile module , i get .pyc file . Now my question is , if

Re: Are there any python libraries/packages like Juicer/Sprockets/bundle_fu?

2009-03-04 Thread Jason Scheirer
On Mar 4, 1:22 am, Phillip B Oldham wrote: > Hi all. > > Just wondering whether there are any libraries for python like ruby's > Juicer[1], Sprocets[2], or bundle_fu[3]? > > Thanks! > > [1]http://www.cjohansen.no/en/ruby/juicer_a_css_and_javascript_packaging... > [2]http://getsprockets.com/ > [3]h

Re: Roulette wheel

2009-03-04 Thread Tim Wintle
On Wed, 2009-03-04 at 18:02 +, mattia wrote: > ri = randint(0, len(rw) - 1) > print("Random index:", rw[ri], ", value:", pop[rw[ri]]) you probably want random.choice(rw) -- http://mail.python.org/mailman/listinfo/python-list

Re: A Simple Tkinter Control Program--Slight Problem

2009-03-04 Thread r
On Mar 4, 12:09 pm, "W. eWatson" wrote: > Here's what I think the author meant in discussing a control variable sample > program. > > from Tkinter import * > > v=Tk.StringVar() [snip] If you do a "from Tkinter import *" then here is the proper line... v =

A Simple Tkinter Control Program--Slight Problem

2009-03-04 Thread W. eWatson
Here's what I think the author meant in discussing a control variable sample program. from Tkinter import * v=Tk.StringVar() e = Entry(master, textvariable=v) e.pack() e.focus_set() v.set("a default value") s = v.get() mainloop() The problem is th

Re: What does self.grid() do?

2009-03-04 Thread r
PS: Check here http://effbot.org/tkinterbook/ There are three geometry managers "pack", "place", and "grid". Be sure to learn the pros and cons of all three. -- http://mail.python.org/mailman/listinfo/python-list

Roulette wheel

2009-03-04 Thread mattia
Hi everyone, I'm new to python and I want to create some simple code in order to code the classical genetic algorithm example: given a population of chromosomes, encoded using 1 and 0, find the chromosome with the maximum number of 1s. Now, despite all the code used to implement the solution, I

Re: What does self.grid() do?

2009-03-04 Thread r
> What exactly is meant by "widgets that layout themselves"- what is the > right way to do this? He means you can't control it at creation time, you would have to call w.pack_configure() if you did not like the default options. There are times however when you DO want a widget to pack itself.. fr

Re: What does self.grid() do?

2009-03-04 Thread chuck
On Mar 3, 10:40 pm, Marc 'BlackJack' Rintsch wrote: > On Tue, 03 Mar 2009 18:06:56 -0800, chuck wrote: > > I am learning python right now.  In the lesson on tkinter I see this > > piece of code > > > from Tkinter import * > > > class MyFrame(Frame): > >    def __init__(self): > >        Frame.__in

Re: New User - Using tutorial and Docs - POST returns 302 Found

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 14:36:21 -0200, JohnV escribió: Couldn't figure out the proper usage of the urllib2 functions to fix the 302 Found problem, but what I did was change the URL to a php page and httplib.HTTPConnection() worked fine when a "POST" was sent to that page. So, when I have learned

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 13:50:32 -0200, W. eWatson escribió: Gabriel Genellina wrote: En Wed, 04 Mar 2009 12:12:50 -0200, W. eWatson escribió: That's fine, but I think my problem boils down to one question. There seem to be two ways to communicate with a dialog (I mean a collection of widg

Re: qt, gtk, wx for py3 ?

2009-03-04 Thread sturlamolden
On Mar 3, 8:15 pm, Scott David Daniels wrote: > Qt: simplest model, well-documented, until very recently not available > on Windows w/o a restrictive license or substantial cost. As of March 3, Qt is LGPL on all platforms!!! The problem is PyQt which is still dual GPL/commercially licensed

Re: New User - Using tutorial and Docs - POST returns 302 Found

2009-03-04 Thread JohnV
On Mar 2, 10:13 pm, JohnV wrote: > Thanks for your suggestion, but I am not able to get it to work for > me. > > My original script was: > > f = open('C:\Users\Owner\Desktop\mydata.txt', 'r') > read_data = f.read() > > f.close() > > import httplib, urllib > params = urllib.urlencode({'textarea1':

Re: looking for template package

2009-03-04 Thread Gerard Flanagan
Neal Becker wrote: I'm looking for something to do template processing. That is, transform text making various substitutions. I'd like to be able to do substitutions that include python expressions, to do arithmetic computations within substitutions. I know there are lots of template packag

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Paul McGuire
On Mar 4, 5:33 am, Lie Ryan wrote: > Andre Engels wrote: > > y = d.values() might also work, but I am not sure whether d.keys() and > > d.values() are guaranteed to use the same order. > > If they were called immediately after each other I think they should, > but better not rely on it. Also, it

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Paul McGuire
On Mar 4, 5:33 am, Lie Ryan wrote: > Andre Engels wrote: > > y = d.values() might also work, but I am not sure whether d.keys() and > > d.values() are guaranteed to use the same order. > > If they were called immediately after each other I think they should, > but better not rely on it. I think t

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread W. eWatson
Gabriel Genellina wrote: En Wed, 04 Mar 2009 12:12:50 -0200, W. eWatson escribió: That's fine, but I think my problem boils down to one question. There seem to be two ways to communicate with a dialog (I mean a collection of widgets assembled in a window that requires the user enter various

Re: String Identity Test

2009-03-04 Thread S Arrowsmith
Avetis KAZARIAN wrote: >It seems that any strict ASCII alpha-numeric string is instantiated as >an unique object, like a "singleton" ( a =3D "x" and b =3D "x" =3D> a is b = >) >and that any non strict ASCII alpha-numeric string is instantiated as >a new object every time with a new id. What no-o

Re: pexpect on solaris 10

2009-03-04 Thread Jorgen Grahn
On Tue, 3 Mar 2009 14:37:20 -0800 (PST), Chris Pella wrote: > Has anybody had success getting pexpect to work well on solaris 10 > (x86)? I am trying to do some test automation which involves > controlling some other processes. Soon after I spawn the process I am > trying to control a message com

FW: Anyone read "Python Interview Questions: Python Certification Review"?

2009-03-04 Thread Grimes, George
The listing for the book on Amazon did not have any reviews but they had an almost identical page for their Perl book. It had 3 reviews giving one star (the lowest rating) each. All reported that it was just the reproduction of on-list postings, no original material, and no attempt to make a c

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Mar 2009 06:12:50 -0800, W. eWatson wrote: > That's fine, but I think my problem boils down to one question. There > seem to be two ways to communicate with a dialog (I mean a collection of > widgets assembled in a window that requires the user enter various > parameters, integers, stri

Re: Python parser

2009-03-04 Thread Alan G Isaac
Gabriel Genellina wrote: Do you mean the simpleparser project in Sourceforge? http://simpleparse.sourceforge.net/ I thought this to be one of the most famous and useful Python parsers, because of its combination of simplicity and speed. Anyway, it is *very* good, and not having a version for

Re: String Identity Test

2009-03-04 Thread Avetis KAZARIAN
Steve Holden wrote: > Does PHP really keep only one copy of every string? Not at all. I might have said something confusing if you understood that... > So, don't try to translate concepts from one language to another. > > -- > Gabriel Genellina I'll try ;] -- http://mail.python.org/mailman/lis

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 12:12:50 -0200, W. eWatson escribió: That's fine, but I think my problem boils down to one question. There seem to be two ways to communicate with a dialog (I mean a collection of widgets assembled in a window that requires the user enter various parameters, integers,

Re: Pickle Problem

2009-03-04 Thread Lie Ryan
Fab86 wrote: Is there another way rather than closing the file? Is it possible to delete all within the file? Thanks Delete the old file then opening (and creating) it again is the easiest way? If you need the data from the old file, you can rename the old file and reopen (and create) a new

Re: Pickle Problem

2009-03-04 Thread MRAB
Fab86 wrote: On Mar 4, 1:40 am, "Gabriel Genellina" wrote: En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 escribió: On Mar 4, 12:00 am, MRAB wrote: Fab86 wrote: On Mar 3, 8:59 pm, "Gabriel Genellina" wrote: How to "spell" exactly the exception name should appear in the documentation; migh

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Lie Ryan
Lorenzo wrote: zip() in conjunction with the * operator can be used to unzip a list: That's because zip is the inverse operation of zip. I remember someone saying that zip's typical name is transpose (like in matrix transpose). a == zip(*zip(*a)) * in argument unpacking is not an operat

Re: Anyone read "Python Interview Questions: Python Certification Review"?

2009-03-04 Thread Steve Holden
Paul Sammy wrote: > Hi, > > On a recent trawl of the internet for some Python books, I came across > "Python Interview Questions: Python Certification Review" by > ITCOOKBOOK.COM > > http://www.itcookbook.com/store/index.php?main_page=product_info&products_id=15 >

Re: String Identity Test

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 07:07:44 -0200, Avetis KAZARIAN escribió: Gary Herron wrote: The question now is: Why do you care? The properties of strings do not depend on the implementation's choice, so you shouldn't care because of programming considerations. Perhaps it's just a matter of curios

Re: String Identity Test

2009-03-04 Thread Steve Holden
Avetis KAZARIAN wrote: > Gary Herron wrote: >> The question now is: Why do you care? The properties of strings do >> not depend on the implementation's choice, so you shouldn't care because >> of programming considerations. Perhaps it's just a matter of curiosity >> on your part. >> >> Gary Her

Re: Pickle Problem

2009-03-04 Thread Fab86
On Mar 4, 1:40 am, "Gabriel Genellina" wrote: > En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 escribió: > > > > > On Mar 4, 12:00 am, MRAB wrote: > >> Fab86 wrote: > >> > On Mar 3, 8:59 pm, "Gabriel Genellina" wrote: > >> >> How to "spell" exactly the exception name should appear in the   > >> >> d

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread W. eWatson
Gabriel Genellina wrote: En Wed, 04 Mar 2009 03:13:43 -0200, W. eWatson escribió: I'm converting a Tkinter program (Win XP) that uses widgets that allows the user to change default values of various parameters like start and stop time in hh:mm:ss, time of exposure in seconds, and whether ce

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Lorenzo
Having a look at python documentation I found: zip() in conjunction with the * operator can be used to unzip a list: >>> x = [1, 2, 3] >>> y = [4, 5, 6] >>> zipped = zip(x, y) >>> zipped [(1, 4), (2, 5), (3, 6)] >>> x2, y2 = zip(*zipped) >>> x == x2, y == y2 True So, >>> x2, y2 = zip(*d.items())

Re: Anyone read "Python Interview Questions: Python Certification Review"?

2009-03-04 Thread Tim Chase
On a recent trawl of the internet for some Python books, I came across "Python Interview Questions: Python Certification Review" by ITCOOKBOOK.COM http://www.itcookbook.com/store/index.php?main_page=product_info&products_id=15 Has anyone used this, or even one of the related books? While I c

Re: Server programming

2009-03-04 Thread Bruno Desthuilliers
koranthala a écrit : On Mar 3, 8:09 pm, Bruno Desthuilliers wrote: koranthala a écrit : (snip) Hi Bruno, After reading your email, I tried reworking my code so that most of my logic moves to Models. But, most probably because this is my first application development, I am unable to do s

Re: looking for template package

2009-03-04 Thread Bruno Desthuilliers
Neal Becker a écrit : I'm looking for something to do template processing. That is, transform text making various substitutions. I'd like to be able to do substitutions that include python expressions, to do arithmetic computations within substitutions. I know there are lots of template pac

Re: Problem with py2exe conversion.

2009-03-04 Thread venutaurus...@gmail.com
On Mar 4, 6:23 pm, "Gabriel Genellina" wrote: > En Wed, 04 Mar 2009 11:12:32 -0200, venutaurus...@gmail.com   > escribió: > > > Hello all, > >             I am facing an interesting problem with py2exe conversion. > > I've a python script which uses the shutil libarary. When I convert > > that py

Re: Problem with py2exe conversion.

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 11:12:32 -0200, venutaurus...@gmail.com escribió: Hello all, I am facing an interesting problem with py2exe conversion. I've a python script which uses the shutil libarary. When I convert that python script into exe, it creates a dist folder and then in that it

Re: Difference between 32 bit and 64 bit Python

2009-03-04 Thread David Cournapeau
On Wed, Mar 4, 2009 at 10:13 PM, srinivasan srinivas wrote: > > Hi, > I would like to know more about the advantages of 64-bit python. It runs on 64 bits OS, for once, which generally means the python process can address more than the few Gb possible under a 32 bits platform. If you need to deal

Problem with py2exe conversion.

2009-03-04 Thread venutaurus...@gmail.com
Hello all, I am facing an interesting problem with py2exe conversion. I've a python script which uses the shutil libarary. When I convert that python script into exe, it creates a dist folder and then in that it places the exe. Along with the exe it also places a zip folder containing p

Difference between 32 bit and 64 bit Python

2009-03-04 Thread srinivasan srinivas
Hi, I would like to know more about the advantages of 64-bit python. What appliactions can use 64-bit python and all? Can someone help me out in this? Thanks, Srini Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/ -- http://m

  1   2   >