pygrace-0.4

2009-03-04 Thread Michael McKerns
updated Python bindings for grace http://www.its.caltech.edu/~mmckerns/software.html # Version 0.4: 03/02/09 migrated Numeric dependency to Numpy added license text installs with setuptools, if available more gentle install dependency failure --- Mike McKerns California Institute of

Re: String Identity Test

2009-03-04 Thread Terry Reedy
Avetis KAZARIAN wrote: After reading the discussion about the same subject ( From: Thomas Moore jsfrank.c...@msa.hinet.net Date: Tue, 1 Nov 2005 21:45:56 +0800 ), I tried myself some tests with some confusing results (I'm a beginner with Python, I'm coming from PHP) For immutable objects,

Re: Problem with text alignment

2009-03-04 Thread alejandro
Here is the whole dialog: class OpcijeFolija(wx.Dialog): def __init__(self, parent, id, title): wx.Dialog.__init__(self,parent, id, title, size=(300,300)) foli=cPickle.load(file(folije.data)) #-- dropdown self.combo = wx.ComboBox(self,

Re: random module gives same results across all configurations?

2009-03-04 Thread Diez B. Roggisch
So far I get the same results under Mac OS X, Windows, and Linux (Google App Engine). I'm particularly interested in getting the same results under the Google App Engine even as Google upgrades its servers over time. I just had a look into the python source - and I was wrong, it appears

Re: String Identity Test

2009-03-04 Thread Avetis KAZARIAN
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 Herron Well, it's not about curiosity,

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

2009-03-04 Thread Phillip B Oldham
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_tool [2] http://getsprockets.com/ [3] http://code.google.com/p/bundle-fu/ --

Re: String Identity Test

2009-03-04 Thread Tino Wildenhain
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 Herron Well,

Re: String Identity Test

2009-03-04 Thread Christian Heimes
Avetis KAZARIAN schrieb: 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 Herron

Re: random module gives same results across all configurations?

2009-03-04 Thread Paul Rubin
Diez B. Roggisch de...@nospam.web.de writes: Random uses AFAIK rand/srand from the stdlib.h of your platform (*nix, no idea how that beast is called in redmond). According to http://docs.python.org/library/random.html it uses Mersenne Twister. --

Problem with text alignment

2009-03-04 Thread alejandro
I can't align the text on the right in my wxDialog. Everything else works fine self.sirina = wx.StaticText(self,-1,'',(200,50),style=wx.ALIGN_RIGHT) -- http://mail.python.org/mailman/listinfo/python-list

Re: String Identity Test

2009-03-04 Thread Avetis KAZARIAN
Everything's clear now. Thanks all (especially Christian and Tino) :] -- http://mail.python.org/mailman/listinfo/python-list

siple for in expression

2009-03-04 Thread Matko
Hello! Can someone help me to understand the following code: uv_face_mapping = [[0,0,0,0] for f in faces] Thank You very much! Matko from Croatia -- http://mail.python.org/mailman/listinfo/python-list

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

2009-03-04 Thread Abhinayaraj . Raju
Hi, I am a beginner in Python. In fact, beginner to coding/ scripting. Here is a scenario, I need to code. Need your help on this: A script that 1. Reads from a file (may be a local file say test.txt) 2. And, if the line begins with a #, should print the line one time 3. if the

Re: random module gives same results across all configurations?

2009-03-04 Thread Diez B. Roggisch
Paul Rubin schrieb: Diez B. Roggisch de...@nospam.web.de writes: Random uses AFAIK rand/srand from the stdlib.h of your platform (*nix, no idea how that beast is called in redmond). According to http://docs.python.org/library/random.html it uses Mersenne Twister. Yeah, I figured that out

Inverse of dict(zip(x,y))

2009-03-04 Thread lone_eagle
Hi all, This might be trivial ... Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, x2:y2, ...}, what is there any

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

2009-03-04 Thread Andreas Tawn
Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, x2:y2, ...}, what is there any trick to get lists x = [x1, x2, ...]

Re: random module gives same results across all configurations?

2009-03-04 Thread Carl Banks
On Mar 4, 12:33 am, Diez B. Roggisch de...@nospam.web.de wrote: So far I get the same results under Mac OS X, Windows, and Linux (Google App Engine).  I'm particularly interested in getting the same results under the Google App Engine even as Google upgrades its servers over time. I just

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

2009-03-04 Thread Paul Rubin
lone_eagle icym...@gmail.com writes: So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, x2:y2, ...}, what is there any trick to get lists x = [x1, x2, ...] and y = [y1, y2, ...] This may be a bit of a mind bender,

Re: String Identity Test

2009-03-04 Thread Peter Otten
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 Herron

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

2009-03-04 Thread Andre Engels
On Wed, Mar 4, 2009 at 11:02 AM, lone_eagle icym...@gmail.com wrote: Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d =

WinCE and python

2009-03-04 Thread 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 Bye, --

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

2009-03-04 Thread psykeedelik
On Mar 4, 11:06 am, Paul Rubin http://phr...@nospam.invalid wrote: lone_eagle icym...@gmail.com writes: So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, x2:y2, ...}, what is there any trick to get lists x =

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

2009-03-04 Thread Peter Otten
Andreas Tawn wrote: Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, x2:y2, ...}, what is there any trick to get lists

Re: qt, gtk, wx for py3 ?

2009-03-04 Thread Paul Boddie
On 4 Mar, 00:40, Peter Billam pe...@www.pjb.com.au wrote: Thanks for that.  I also checked out:  http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits which seemed surprisingly even-handed. I don't have a horse in this race, but apart from needing to update that page based on recent

Re: geospatial python and how to convert multilinestrings to kml

2009-03-04 Thread Andrew MacIntyre
Danny Shevitz wrote: Howdy, I need to do some geospatial work and am a complete newbie at this. I have access to a PostGIS database and there are lots of MultiLineString objects. I want to run a python algorithm that determines a group of these MultiLineString objects and creates a KML file of

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

2009-03-04 Thread Tino Wildenhain
lone_eagle wrote: Hi all, This might be trivial ... Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, x2:y2, ...},

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

2009-03-04 Thread Hrvoje Niksic
psykeedelik icym...@gmail.com writes: Keys and values are listed in an arbitrary order which is non- random, varies across Python implementations, and depends on the dictionary’s history of insertions and deletions. I hope it does not mean that the key-value mapping is not guaranteed,

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 03:13:43 -0200, W. eWatson notval...@sbcglobal.net 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

Python and Windows Services Question

2009-03-04 Thread Phoe6
Hello, This is a windows services question. The following script which is a windows service was supposed to something ( download wallpaper and set the desktopwallpaper) at 16:45 my time here. The service is running, but the supposed action did not take place. Does anyone who is aware of win32

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

2009-03-04 Thread Lie Ryan
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. -- http://mail.python.org/mailman/listinfo/python-list

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

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 07:36:01 -0200, abhinayaraj.r...@emulex.com escribió: I am a beginner in Python. In fact, beginner to coding/ scripting. Here is a scenario, I need to code. Need your help on this: A script that 1. Reads from a file (may be a local file say test.txt) 2. And, if

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

2009-03-04 Thread Tino Wildenhain
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. otoh, I could not think of any use

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

2009-03-04 Thread Andreas Tawn
So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, x2:y2, ...}, what is there any trick to get lists x = [x1, x2, ...] and y = [y1, y2, ...] Cheers, Chaitanya. x = d.keys() y = d.values() But be aware that you

Re: Problem with text alignment

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 06:14:41 -0200, alejandro aleksanda...@brisiovonet.hr escribió: I can't align the text on the right in my wxDialog. Everything else works fine self.sirina = wx.StaticText(self,-1,'',(200,50),style=wx.ALIGN_RIGHT) In case there is a misunderstanding, ALIGN_RIGHT means

Re: Python and Windows Services Question

2009-03-04 Thread Tim Golden
Phoe6 wrote: This is a windows services question. The following script which is a windows service was supposed to something ( download wallpaper and set the desktopwallpaper) at 16:45 my time here. The service is running, but the supposed action did not take place. Does anyone who is aware of

Anyone read Python Interview Questions: Python Certification Review?

2009-03-04 Thread Paul Sammy
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_infoproducts_id=15 Has anyone used this, or even one of the related books? I can find

Re: Python parser

2009-03-04 Thread andrew cooke
Kay Schluehr wrote: You'll most likely need a GLR parser. i'm not sure why you think this. as far as i can tell, the OP needs a parser that is suitable for whatever grammar they find (and the grammar will probably be written for a particular parser, which may not be GLR). however, if you are

Re: looking for template package

2009-03-04 Thread Robin Becker
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

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

2009-03-04 Thread Piet van Oostrum
Andre Engels andreeng...@gmail.com (AE) wrote: AE On Wed, Mar 4, 2009 at 11:02 AM, lone_eagle icym...@gmail.com wrote: Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d =

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/ --

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

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 sri_anna...@yahoo.co.in 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.

Re: Problem with py2exe conversion.

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 11:12:32 -0200, venutaurus...@gmail.com 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

Re: Problem with py2exe conversion.

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

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

Re: Server programming

2009-03-04 Thread Bruno Desthuilliers
koranthala a écrit : On Mar 3, 8:09 pm, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid 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

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_infoproducts_id=15 Has anyone used this, or even one of the related books? While I

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()) should fix your

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 notval...@sbcglobal.net 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

Re: Pickle Problem

2009-03-04 Thread Fab86
On Mar 4, 1:40 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 fabien.h...@gmail.com escribió: On Mar 4, 12:00 am, MRAB goo...@mrabarnett.plus.com wrote: Fab86 wrote: On Mar 3, 8:59 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: How

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 Herron Well,

Re: String Identity Test

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 07:07:44 -0200, Avetis KAZARIAN aveti...@gmail.com 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

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)) nitpick * in argument unpacking is not

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://ITCOOKBOOK.COM http://www.itcookbook.com/store/index.php?main_page=product_infoproducts_id=15

Re: Pickle Problem

2009-03-04 Thread MRAB
Fab86 wrote: On Mar 4, 1:40 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 fabien.h...@gmail.com escribió: On Mar 4, 12:00 am, MRAB goo...@mrabarnett.plus.com wrote: Fab86 wrote: On Mar 3, 8:59 pm, Gabriel Genellina gagsl-...@yahoo.com.ar

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

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 12:12:50 -0200, W. eWatson notval...@sbcglobal.net 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 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 ;] --

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: 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,

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

Re: pexpect on solaris 10

2009-03-04 Thread Jorgen Grahn
On Tue, 3 Mar 2009 14:37:20 -0800 (PST), Chris Pella skipad...@gmail.com 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

Re: String Identity Test

2009-03-04 Thread S Arrowsmith
Avetis KAZARIAN aveti...@gmail.com 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.

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

2009-03-04 Thread Paul McGuire
On Mar 4, 5:33 am, Lie Ryan lie.1...@gmail.com 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.

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

2009-03-04 Thread Paul McGuire
On Mar 4, 5:33 am, Lie Ryan lie.1...@gmail.com 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.

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

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 notval...@sbcglobal.net 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

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

2009-03-04 Thread JohnV
On Mar 2, 10:13 pm, JohnV loftmas...@gmail.com 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 =

Re: qt, gtk, wx for py3 ?

2009-03-04 Thread sturlamolden
On Mar 3, 8:15 pm, Scott David Daniels scott.dani...@acm.org 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

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 13:50:32 -0200, W. eWatson notval...@sbcglobal.net escribió: Gabriel Genellina wrote: En Wed, 04 Mar 2009 12:12:50 -0200, W. eWatson notval...@sbcglobal.net escribió: That's fine, but I think my problem boils down to one question. There seem to be two ways to

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 loftmas...@gmail.com 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,

Re: What does self.grid() do?

2009-03-04 Thread chuck
On Mar 3, 10:40 pm, Marc 'BlackJack' Rintsch bj_...@gmx.net 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):        

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.. from

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,

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

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. http://effbot.org/tkinterbook/entry.htm 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 that

Re: A Simple Tkinter Control Program--Slight Problem

2009-03-04 Thread r
On Mar 4, 12:09 pm, W. eWatson notval...@sbcglobal.net wrote: Here's what I think the author meant in discussing a control variable sample program. http://effbot.org/tkinterbook/entry.htm from Tkinter import * v=Tk.StringVar() [snip] If you do a from Tkinter import * then here is the proper

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: 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 phillip.old...@gmail.com 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...

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: 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. http://effbot.org/tkinterbook/entry.htm from Tkinter import * v=Tk.StringVar() e = Entry(master, textvariable=v) e.pack() e.focus_set()

Re: How to create Standalone PYC File

2009-03-04 Thread Chris Rebert
On Wed, Mar 4, 2009 at 11:38 AM, Rohan Hole rohanhol...@gmail.com 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

Re: WinCE and python

2009-03-04 Thread Vlastimil Brom
2009/3/2 ssd c...@d.com: 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 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

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. http://effbot.org/tkinterbook/entry.htm from Tkinter import * v=Tk.StringVar() e = Entry(master, textvariable=v)

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 implement

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

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

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 binary

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 with the

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

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

Re: Problem with py2exe conversion.

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 11:38:35 -0200, venutaurus...@gmail.com venutaurus...@gmail.com escribió: On Mar 4, 6:23 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 04 Mar 2009 11:12:32 -0200, venutaurus...@gmail.com   venutaurus...@gmail.com escribió:             I am facing an

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: 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

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

2009-03-04 Thread Benjamin Peterson
Andre Engels andreengels at 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

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

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? Preferred by

Re: Question about binary file reading

2009-03-04 Thread Chris Rebert
On Wed, Mar 4, 2009 at 2:58 PM, vibgyorbits bka...@gmail.com 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

Re: Question about binary file reading

2009-03-04 Thread Rhodri James
On Wed, 04 Mar 2009 22:58:38 -, vibgyorbits bka...@gmail.com 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

  1   2   3   >