PyTables 2.2rc2 ready to test

2010-06-17 Thread Francesc Alted
=== Announcing PyTables 2.2rc2 === PyTables is a library for managing hierarchical datasets and designed to efficiently cope with extremely large amounts of data with support for full 64-bit file addressing. PyTables runs on top of the HDF5

Re: gui doubt

2010-06-17 Thread Stephen Hansen
On 6/16/10 10:40 PM, madhuri vio wrote: if i want to create a button which performs the transcription of dna to rna using tkinter in a gui... can u give me the method... You can not possibly be serious. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT)

Re: basic doubt

2010-06-17 Thread Michael Torrie
On 06/16/2010 11:06 PM, madhuri vio wrote: def h(self,event): handle = open(myco.fasta,r) for seq_record in SeqIO.parse(handle, fasta): messenger_rna = coding_myco.fasta.transcribe() han1 = open(mycorna.fasta,wU) han1.close() return

Re: Python 2.4.4 Tkinter GUI Example for Modeless Dialog with Menu, Edit, List, Buttons, File Save etc.

2010-06-17 Thread Michael Torrie
On 06/16/2010 04:05 PM, My Python wrote: I would like to see some substantial example of an App written for a Modeless Dialog (fixed size, non resizable window) (If you have used WIndows MFC or Visual Basic you all know how elegant it is) What is elegant about a fixed-size, non-re-sizable

Re: Python 2.4.4 Tkinter GUI Example for Modeless Dialog with Menu, Edit, List, Buttons, File Save etc.

2010-06-17 Thread Michael Torrie
On 06/17/2010 12:50 AM, Michael Torrie wrote: On 06/16/2010 04:05 PM, My Python wrote: I would like to see some substantial example of an App written for a Modeless Dialog (fixed size, non resizable window) Tk? PyQt? PyGTK? wxPython? Nevermind that question. You stated that in your subject

Re: Overriding __setattr__ of a module - possible?

2010-06-17 Thread Gabriel Genellina
En Wed, 16 Jun 2010 19:56:39 -0300, Ian Kelly ian.g.ke...@gmail.com escribió: On Wed, Jun 16, 2010 at 3:38 PM, John Nagle na...@animats.com wrote: That just leaves things in a state where even sys and import are undefined. Say what? It works fine for me. import proxy_mod proxy_mod.f()

Re: Overriding __setattr__ of a module - possible?

2010-06-17 Thread Alf P. Steinbach
* Gabriel Genellina, on 17.06.2010 09:25: En Wed, 16 Jun 2010 19:56:39 -0300, Ian Kelly ian.g.ke...@gmail.com escribió: On Wed, Jun 16, 2010 at 3:38 PM, John Nagle na...@animats.com wrote: That just leaves things in a state where even sys and import are undefined. Say what? It works fine

Re: basic doubt

2010-06-17 Thread Gabriel Genellina
En Thu, 17 Jun 2010 02:06:54 -0300, madhuri vio madhuri@gmail.com escribió: def h(self,event): handle = open(myco.fasta,r) for seq_record in SeqIO.parse(handle, fasta): messenger_rna = coding_myco.fasta.transcribe() han1 = open(mycorna.fasta,wU)

Communicating with a program using subprocess

2010-06-17 Thread Laurent Verweijen
I have a file called increment.py as follows: #!/usr/bin/python n = 0 while True: n = int(raw_input(n)) + 1 This is easy to understand, but I want to pipe it's input/output by another python program. (I will show what

Re: Overriding __setattr__ of a module - possible?

2010-06-17 Thread Gabriel Genellina
En Thu, 17 Jun 2010 04:52:48 -0300, Alf P. Steinbach al...@start.no escribió: * Gabriel Genellina, on 17.06.2010 09:25: En Wed, 16 Jun 2010 19:56:39 -0300, Ian Kelly ian.g.ke...@gmail.com escribió: On Wed, Jun 16, 2010 at 3:38 PM, John Nagle na...@animats.com wrote: That just leaves

Re: Overriding __setattr__ of a module - possible?

2010-06-17 Thread Fuzzyman
On Jun 17, 10:29 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Thu, 17 Jun 2010 04:52:48 -0300, Alf P. Steinbach al...@start.no   escribió: But who would have thunk that Python *isn't dynamic enough*? :-) Yep... There are other examples too (e.g. the print statement in 2.x  

List of lists surprising behaviour

2010-06-17 Thread candide
Let's the following code : t=[[0]*2]*3 t [[0, 0], [0, 0], [0, 0]] t[0][0]=1 t [[1, 0], [1, 0], [1, 0]] Rather surprising, isn't it ? So I suppose all the subarrays reférence the same array : id(t[0]), id(t[1]), id(t[2]) (3077445996L, 3077445996L, 3077445996L) So what is the right way

Re: How do I fix this test so it runs on Windows? (it uses tzset)

2010-06-17 Thread Chris Withers
Nobody wrote: On Wed, 16 Jun 2010 16:30:02 +0100, Chris Withers wrote: I'd like to make test_non_gmt_timezone at the bottom of https://... run on Windows, any suggestions? MSVCRT has _tzset(), which understands the TZ environment variable.

Re: List of lists surprising behaviour

2010-06-17 Thread Lie Ryan
On 06/17/10 20:21, candide wrote: Let's the following code : t=[[0]*2]*3 t [[0, 0], [0, 0], [0, 0]] t[0][0]=1 t [[1, 0], [1, 0], [1, 0]] Rather surprising, isn't it ? So I suppose all the subarrays reférence the same array : id(t[0]), id(t[1]), id(t[2]) (3077445996L, 3077445996L,

Re: List of lists surprising behaviour

2010-06-17 Thread Matteo Landi
Yes you are. List comprehension makes you create list of lists without reference-sharing. You should also find a recipe about that on the python cookbook. On Thu, Jun 17, 2010 at 12:21 PM, candide cand...@free.invalid wrote: Let's the following code : t=[[0]*2]*3 t [[0, 0], [0, 0], [0, 0]]

Could not import external source folder in Pydev

2010-06-17 Thread Narendran
Env info: Python version: '2.6.5 (r265:79063, Apr 16 2010, 13:57:41) \n[GCC 4.4.3]' Eclipse version: Version: 3.5.2 Build id: M20100211-1343 PyDev version: PyDev for Eclipse 1.5.7.2010050621 org.python.pydev.feature.feature.group OS: Ubuntu 10.04 Problem: I am trying to develop a module

Serializing functions

2010-06-17 Thread Matteo Landi
Some weeks ago, here on the mailing list I read about picloud[1], a python library used for cloud-computing; I was impressed by its simplicity, here is an example: import cloud def square(x): ... return x * x cloud.call(square, 10) cloud.result() 100 So, I tried to figure out how to achieve the

Re: a +b ?

2010-06-17 Thread David Robinow
On Wed, Jun 16, 2010 at 11:34 PM, Aahz a...@pythoncraft.com wrote: In article mailman.1662.1276743037.32709.python-l...@python.org, James Mills  prolo...@shortcircuit.net.au wrote: ... What in particular do you _not_ enjoy about using map/reduce (and possibly other functional features of the

Re: GUIs - A Modest Proposal

2010-06-17 Thread Grant Edwards
On 2010-06-16, Matt m...@themattfella.xxxyyz.com wrote: On 06/05/2010 09:22 PM, ant wrote: PyQt is tied to one platform. Several posters have asked for support for or clarification of this claim of yours. Let me guess... The one platform it's tied to is Qt? -- Grant Edwards

Re: List of lists surprising behaviour

2010-06-17 Thread Boris Borcic
candide wrote: So what is the right way to initialize to 0 a 2D array ? Is that way correct : t=[[0 for _ in range(2)] for _ in range(3)] That's overkill :) You can skip the inner loop by using a list display, eg t=[[0,0] for _ in range(3)] It seems there is no more trouble now : t

Re: Serializing functions

2010-06-17 Thread Bruno Desthuilliers
Matteo Landi a écrit : Some weeks ago, here on the mailing list I read about picloud[1], a python library used for cloud-computing; I was impressed by its simplicity, here is an example: import cloud def square(x): ... return x * x cloud.call(square, 10) cloud.result() 100 So, I tried to

Goals,watch the World Cup .. mondial 2010 Online

2010-06-17 Thread mondial worldcup2010
Goals,watch the World Cup .. mondial 2010 Online http://www.echance.info/fifa2010 http://www.echance.info/sopcast-en http://www.echance.info/sopcast-ar -- http://mail.python.org/mailman/listinfo/python-list

كيف تحصل على لاب توب جائزة

2010-06-17 Thread mondial worldcup2010
How to get a laptop gift http://echance.info/laptop.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Serializing functions

2010-06-17 Thread Paul Rubin
Matteo Landi landima...@gmail.com writes: If you try and pickle a function, it is not pickled as a whole, indeed, once you unpickle it, it will raise an exception telling you that the target function was not found in the current module. So I'm here, with nothing in my hands; how would you

Re: gui doubt

2010-06-17 Thread Tim Chase
On 06/17/2010 01:04 AM, Stephen Hansen wrote: On 6/16/10 10:40 PM, madhuri vio wrote: if i want to create a button which performs the transcription of dna to rna using tkinter in a gui... can u give me the method... You can not possibly be serious. Oh, it's not that bad

Re: Serializing functions

2010-06-17 Thread Matteo Landi
On Thu, 2010-06-17 at 07:37 -0700, Paul Rubin wrote: Matteo Landi landima...@gmail.com writes: If you try and pickle a function, it is not pickled as a whole, indeed, once you unpickle it, it will raise an exception telling you that the target function was not found in the current module.

RE: gui doubt

2010-06-17 Thread Andreas Tawn
On 06/17/2010 01:04 AM, Stephen Hansen wrote: On 6/16/10 10:40 PM, madhuri vio wrote: if i want to create a button which performs the transcription of dna to rna using tkinter in a gui... can u give me the method... You can not possibly be serious. Oh, it's not that bad

Re: Serializing functions

2010-06-17 Thread Paul Rubin
Matteo Landi landima...@gmail.com writes: I could be wrong, but it seems functions are not marshable objects, is it right? Hmm, you're right, you can marshal code objects, but you can't marshal a function directly. It's been a while since I've used marshal and I forgot how it works. You might

Re: Serializing functions

2010-06-17 Thread Matteo Landi
On Thu, 2010-06-17 at 07:37 -0700, Paul Rubin wrote: Matteo Landi landima...@gmail.com writes: If you try and pickle a function, it is not pickled as a whole, indeed, once you unpickle it, it will raise an exception telling you that the target function was not found in the current module.

Re: gui doubt

2010-06-17 Thread Bruno Desthuilliers
Andreas Tawn a écrit : On 06/17/2010 01:04 AM, Stephen Hansen wrote: On 6/16/10 10:40 PM, madhuri vio wrote: if i want to create a button which performs the transcription of dna to rna (snip the GUI part) Seems like a simple problem... or am I missing something? def translate():

Re: Serializing functions

2010-06-17 Thread Stephen Hansen
On 6/17/10 6:23 AM, Matteo Landi wrote: itself. If you try and pickle a function, it is not pickled as a whole, indeed, once you unpickle it, it will raise an exception telling you that the target function was not found in the current module. You can pickle functions-- and classes, instances,

Re: gui doubt

2010-06-17 Thread Tim Chase
On 06/17/2010 10:07 AM, Andreas Tawn wrote: On 6/16/10 10:40 PM, madhuri vio wrote: which performs the transcription of dna to rna [snip] Seems like a simple problem... or am I missing something? def translate(): return dna.replace(d, r) And I understand people in bioinformatics get

Re: gui doubt

2010-06-17 Thread Steven W. Orr
On 06/17/10 01:40, quoth madhuri vio: if i want to create a button which performs the transcription of dna to rna using tkinter in a gui... can u give me the method... -- madhuri :) Dear Madasahatter. You need to read the description below on how to properly implement and use the

Re: Serializing functions

2010-06-17 Thread Matteo Landi
On Thu, 2010-06-17 at 08:31 -0700, Stephen Hansen wrote: On 6/17/10 6:23 AM, Matteo Landi wrote: itself. If you try and pickle a function, it is not pickled as a whole, indeed, once you unpickle it, it will raise an exception telling you that the target function was not found in the current

Re: Serializing functions

2010-06-17 Thread Andreas Löscher
Am Donnerstag, den 17.06.2010, 08:18 -0700 schrieb Paul Rubin: Matteo Landi landima...@gmail.com writes: I could be wrong, but it seems functions are not marshable objects, is it right? Hmm, you're right, you can marshal code objects, but you can't marshal a function directly. It's been

Re: Serializing functions

2010-06-17 Thread Andreas Löscher
Am Donnerstag, den 17.06.2010, 18:03 +0200 schrieb Andreas Löscher: Am Donnerstag, den 17.06.2010, 08:18 -0700 schrieb Paul Rubin: Matteo Landi landima...@gmail.com writes: I could be wrong, but it seems functions are not marshable objects, is it right? Hmm, you're right, you can

Efficiency/style issues of import module vs. from module import name, ...

2010-06-17 Thread python
Are there any efficiency or style guidelines regarding the choice of import module vs. from module import name, ...? If one only needs to import a few names from a module, are there specific benefits to explictly importing these names? My understanding is that both forms of the import command

Re: Upgrading from Python 2.6.5 w.r.t. matplotlib/numpy?

2010-06-17 Thread Robert Kern
On 6/17/10 12:24 AM, Stephen Hansen wrote: On 6/16/10 10:18 PM, Mark Lawrence wrote: I'm like to go direct to Python 3.1 if possible, but if necessary I'll happily use Python 2.7 as an interim measure. However I'm uncertain as to the status of matplotlib and its dependency on numpy. I've tried

Re: gui doubt

2010-06-17 Thread Robert Kern
On 6/17/10 10:38 AM, Tim Chase wrote: On 06/17/2010 10:07 AM, Andreas Tawn wrote: On 6/16/10 10:40 PM, madhuri vio wrote: which performs the transcription of dna to rna [snip] Seems like a simple problem... or am I missing something? def translate(): return dna.replace(d, r) And I

Re: Serializing functions

2010-06-17 Thread Robert Kern
On 6/17/10 8:23 AM, Matteo Landi wrote: Some weeks ago, here on the mailing list I read about picloud[1], a python library used for cloud-computing; I was impressed by its simplicity, here is an example: import cloud def square(x): ... return x * x cloud.call(square, 10) cloud.result() 100

Re: Efficiency/style issues of import module vs. from module import name, ...

2010-06-17 Thread Stephen Hansen
On 6/17/10 9:12 AM, pyt...@bdurham.com wrote: Are there any efficiency or style guidelines regarding the choice of import module vs. from module import name, ...? There are no legitimate efficiency issues. In theory, module.blah is slightly slower then blah, but that slightly is largely

super() woes (n00b)

2010-06-17 Thread Deadly Dirk
I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 Type copyright, credits or license() for more information. No Subprocess class P: def __init__(__class__,self): print(I am a member of class P) class

Re: Efficiency/style issues of import module vs. from module import name, ...

2010-06-17 Thread Ethan Furman
Stephen Hansen wrote: On 6/17/10 9:12 AM, pyt...@bdurham.com wrote: Now, this is all IMHO: the style guide does not define any 'guidelines' on this, except that its okay to use from ... import ... to pull in classes and (implicitly) constants, and despite how the rules say 'one module per line'

Re: super() woes (n00b)

2010-06-17 Thread Deadly Dirk
On Thu, 17 Jun 2010 16:36:10 +, Deadly Dirk wrote: I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 Type copyright, credits or license() for more information. No Subprocess class P: def

Re: Efficiency/style issues of import module vs. from module import name, ...

2010-06-17 Thread Stephen Hansen
On 6/17/10 10:01 AM, Ethan Furman wrote: Stephen Hansen wrote: On 6/17/10 9:12 AM, pyt...@bdurham.com wrote: Now, this is all IMHO: the style guide does not define any 'guidelines' on this, except that its okay to use from ... import ... to pull in classes and (implicitly) constants, and

Re: Overriding __setattr__ of a module - possible?

2010-06-17 Thread John Nagle
On 6/17/2010 12:25 AM, Gabriel Genellina wrote: Note the fake.g(8) call: __setattr__ wasn't called. If the OP wants to trace assignments to global variables, this becomes a problem. A function defined in a module holds a reference to the module's __dict__ in its func_globals attribute. Getting

Re: Efficiency/style issues of import module vs. from module import name, ...

2010-06-17 Thread Ethan Furman
Stephen Hansen wrote: On 6/17/10 10:01 AM, Ethan Furman wrote: Stephen Hansen wrote: On 6/17/10 9:12 AM, pyt...@bdurham.com wrote: Now, this is all IMHO: the style guide does not define any 'guidelines' on this, except that its okay to use from ... import ... to pull in classes and

Re: Efficiency/style issues of import module vs. from module import name, ...

2010-06-17 Thread Jack Diederich
On Thu, Jun 17, 2010 at 12:58 PM, Stephen Hansen me+list/pyt...@ixokai.io wrote: On 6/17/10 10:01 AM, Ethan Furman wrote: Stephen Hansen wrote: On 6/17/10 9:12 AM, pyt...@bdurham.com wrote: Now, this is all IMHO: the style guide does not define any 'guidelines' on this, except that its okay

Re: Efficiency/style issues of import module vs. from module import name, ...

2010-06-17 Thread Ethan Furman
Jack Diederich wrote: You want to import a name that is itself a namespace; preferably a module or package and sometimes a class. Importing constants can lead to trouble. ex/ from settings import DEBUG if DEBUG: log('debug is on!') The value of the flag gets fetched at import time. If code

Re: Efficiency/style issues of import module vs. from module import name, ...

2010-06-17 Thread Stephen Hansen
On 6/17/10 10:22 AM, Jack Diederich wrote: On Thu, Jun 17, 2010 at 12:58 PM, Stephen Hansen It explicitly states later its entirely OK to import classes. It never says anything else directly, except in the example given, it shows you importing a constant. So, its giving implicit approval to

Re: Python OpenSSL library

2010-06-17 Thread Antoine Pitrou
On Tue, 15 Jun 2010 19:56:46 -0700 John Nagle na...@animats.com wrote: http://bugs.python.org/issue1589 [...] The typical Python user will expect SSL checking for URL opening to behave like a browser does. They won't be up to speed on the internal mechanics of X.509 certificates. The

Re: super() woes (n00b)

2010-06-17 Thread J. Cliff Dyer
On Thu, 2010-06-17 at 16:36 +, Deadly Dirk wrote: I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 Type copyright, credits or license() for more information. No Subprocess class P: def

The inverse of .join

2010-06-17 Thread Neil Cerutti
What's the best way to do the inverse operation of the .join function? -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: The inverse of .join

2010-06-17 Thread nn
Neil Cerutti wrote: What's the best way to do the inverse operation of the .join function? -- Neil Cerutti split -- http://mail.python.org/mailman/listinfo/python-list

Re: super() woes (n00b)

2010-06-17 Thread Matteo Landi
I found few error in your code: 1 the constructor of P class seems to be wrong: class P(object): ...def __init__(self): ...print(I am a member of class P) ... 2 super() works with new style classes, i.e. the ones which inherit from 'object' class P: ...def

Re: The inverse of .join

2010-06-17 Thread MRAB
Neil Cerutti wrote: What's the best way to do the inverse operation of the .join function? .split, possibly, although there will be problems if the string contains other occurrences of the separator. -- http://mail.python.org/mailman/listinfo/python-list

Re: The inverse of .join

2010-06-17 Thread Ian Kelly
On Thu, Jun 17, 2010 at 11:45 AM, Neil Cerutti ne...@norwich.edu wrote: What's the best way to do the inverse operation of the .join function? Use the str.split method? -- http://mail.python.org/mailman/listinfo/python-list

Re: super() woes (n00b)

2010-06-17 Thread Deadly Dirk
On Thu, 17 Jun 2010 13:48:45 -0400, J. Cliff Dyer wrote: super gives you an instantiated version of the super class, which means that you don't have to explicitly send self to any methods you call on it. So use `super().__init__()` instead. Thanks. Interestingly enough, it works in Python

Re: super() woes (n00b)

2010-06-17 Thread Benjamin Kaplan
On Thu, Jun 17, 2010 at 10:51 AM, Matteo Landi landima...@gmail.com wrote: I found few error in your code: 1 the constructor of P class seems to be wrong: class P(object): ...    def __init__(self): ...        print(I am a member of class P) ... 2 super() works with new style classes,

Re: Python OpenSSL library

2010-06-17 Thread geremy condra
On Thu, Jun 17, 2010 at 10:49 AM, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 15 Jun 2010 19:56:46 -0700 John Nagle na...@animats.com wrote:      http://bugs.python.org/issue1589 [...] The typical Python user will expect SSL checking for URL opening to behave like a browser does.

Re: super() woes (n00b)

2010-06-17 Thread Ethan Furman
Deadly Dirk wrote: On Thu, 17 Jun 2010 13:48:45 -0400, J. Cliff Dyer wrote: super gives you an instantiated version of the super class, which means that you don't have to explicitly send self to any methods you call on it. So use `super().__init__()` instead. Thanks. Interestingly enough,

Import fails (newbie)

2010-06-17 Thread mhorlick
Hello, I'm a newbie and I have a small problem. After invoking IDLE -- Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] on win32 Type copyright, credits or license() for more information. import os,glob os.chdir('D:/Python_Programs') print(os.getcwd())

Re: The inverse of .join

2010-06-17 Thread Neil Cerutti
On 2010-06-17, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Jun 17, 2010 at 11:45 AM, Neil Cerutti ne...@norwich.edu wrote: What's the best way to do the inverse operation of the .join function? Use the str.split method? split is perfect except for what happens with an empty string. --

Processing HTML form

2010-06-17 Thread Bradley Hintze
Hi, I am a newbie to anything web related, I know a bit of HTML though. I've been programing in python for a year or so so I know the language at an intermediate level. I am wondering if its possible to get info from an HTML form and pass it to my python code and return a page based on the code

Running a program from another program.

2010-06-17 Thread Laurent Verweijen
I have a program called increment.py as follows: #!/usr/bin/python n = 0 while True: n = int(raw_input(n)) + 1 This is probably very easy to understand, but I want to run this program from another python program. Below is an attempt

Black-Jewish History FAQ - Is The Secret Relationshi p between blacks and jews a “hate literature”?

2010-06-17 Thread nanothermite911fbibustards
http://www.blacksandjews.com/JewsBlackHolocaust.html Blacks and Jews have been involved in a re-evaluation of their current and historical relationship. Events of the past several years have raised both tensions and the level of rhetoric coming from all sides. The Secret Relationship Between

* Black-Jewish History FAQ - Is The Secret Relations hip between blacks and jews a “hate literature”? *

2010-06-17 Thread nanothermite911fbibustards
http://www.blacksandjews.com/JewsBlackHolocaust.html Jews and the Black Holocaust - What are the Issues? Blacks and Jews have been involved in a re-evaluation of their current and historical relationship. Events of the past several years have raised both tensions and the level of rhetoric coming

Re: The inverse of .join

2010-06-17 Thread MRAB
Neil Cerutti wrote: On 2010-06-17, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Jun 17, 2010 at 11:45 AM, Neil Cerutti ne...@norwich.edu wrote: What's the best way to do the inverse operation of the .join function? Use the str.split method? split is perfect except for what happens with an

Re: Processing HTML form

2010-06-17 Thread Grant Edwards
On 2010-06-17, Bradley Hintze bradle...@aggiemail.usu.edu wrote: I am a newbie to anything web related, I know a bit of HTML though. I've been programing in python for a year or so so I know the language at an intermediate level. I am wondering if its possible to get info from an HTML form

Re: The inverse of .join

2010-06-17 Thread Robert Kern
On 6/17/10 2:08 PM, Neil Cerutti wrote: On 2010-06-17, Ian Kellyian.g.ke...@gmail.com wrote: On Thu, Jun 17, 2010 at 11:45 AM, Neil Cerutti ne...@norwich.edu wrote: What's the best way to do the inverse operation of the .join function? Use the str.split method? split is perfect except

Re: The inverse of .join

2010-06-17 Thread Stephen Hansen
On 6/17/10 12:44 PM, MRAB wrote: Neil Cerutti wrote: On 2010-06-17, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Jun 17, 2010 at 11:45 AM, Neil Cerutti ne...@norwich.edu wrote: What's the best way to do the inverse operation of the .join function? Use the str.split method? split is

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
On 6/17/10 12:13 PM, Laurent Verweijen wrote: How do I make sure the inputstream stays open after the first call to communicate? This was just asked a few days ago in different words-- check out the thread, a couple solutions are offered. In short, you need to make stdin/stdout non-blocking:

Possible to reach back in stack and grab calling function's locals()?

2010-06-17 Thread python
Is there an elegant way to reach back in the stack and grab the calling function's copy of locals()? I'm working on a library that does lots of textmerge operations and am looking for a way to eliminate the need for many of the calls to our library to have to explictly pass locals() to our

Re: The inverse of .join

2010-06-17 Thread Neil Cerutti
On 2010-06-17, Robert Kern robert.k...@gmail.com wrote: On 6/17/10 2:08 PM, Neil Cerutti wrote: On 2010-06-17, Ian Kellyian.g.ke...@gmail.com wrote: On Thu, Jun 17, 2010 at 11:45 AM, Neil Cerutti ne...@norwich.edu wrote: What's the best way to do the inverse operation of the .join

Re: how to get bit info

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 12:51 uur [tijdzone -0700], schreef Back9: Hi, I have one byte data and want to know each bit info, I mean how I can know each bit is set or not? TIA def bitset(x, n): Return whether nth bit of x was set return bool(x (1 n)) --

Re: Serializing functions

2010-06-17 Thread Aaron Staley
I am one of the developer's of PiCloud. To answer your question, we wrote a custom subclass of Pickler to pickle functions. As Robert pointed out, the library is LGPL, so you can see (and use) the source code. I also presented the details on a poster at PyCon 2010. You can see it here:

Re: how to get bit info

2010-06-17 Thread Tim Lesher
On Jun 17, 3:51 pm, Back9 backgoo...@gmail.com wrote: Hi, I have one byte data and want to know each bit info, I mean how I can know each bit is set or not? You want the bitwise-and operator, . For example, to check the least significant bit, bitwise-and with 1: 3 1 1 2 1 0 --

Re: how to get bit info

2010-06-17 Thread Stephen Hansen
On 6/17/10 12:51 PM, Back9 wrote: I have one byte data and want to know each bit info, I mean how I can know each bit is set or not? BIT_1 = 1 0 BIT_2 = 1 1 BIT_3 = 1 2 BIT_4 = 1 3 BIT_5 = 1 4 BIT_6 = 1 5 BIT_7 = 1 6 BIT_8 = 1 7 byte = 67 if byte BIT_1: ... print Bit 1 is

Re: how to get bit info

2010-06-17 Thread Irmen de Jong
On 17-6-2010 21:51, Back9 wrote: Hi, I have one byte data and want to know each bit info, I mean how I can know each bit is set or not? TIA Use bitwise and, for instance, to see if the third bit is set: byte = 0b if byte 0b0100: print bit is set -irmen --

Re: Processing HTML form

2010-06-17 Thread Bradley Hintze
I apologize in advance for my lack of knowledge, I really do not know. I would guess server but I quite honestly I am not clear what an 'HTTP client' or 'HTTP server' refers to. I am running a webpage and am serving it locally for the moment. I have a program that is already written in Python. I

Re: Processing HTML form

2010-06-17 Thread Marco Nawijn
On 17 jun, 21:11, Bradley Hintze bradle...@aggiemail.usu.edu wrote: Hi, I am a newbie to anything web related, I know a bit  of HTML though. I've been programing in python for a year or so so I know the language at an intermediate level. I am wondering if its possible to get info from an

Re: List of lists surprising behaviour

2010-06-17 Thread J Kenneth King
candide cand...@free.invalid writes: Let's the following code : t=[[0]*2]*3 t [[0, 0], [0, 0], [0, 0]] t[0][0]=1 t [[1, 0], [1, 0], [1, 0]] Rather surprising, isn't it ? Not at all, actually. I'd be surprised if the multiplication operator was aware of object constructors. Even

Re: how to get bit info

2010-06-17 Thread Grant Edwards
On 2010-06-17, Stephen Hansen me+list/pyt...@ixokai.io wrote: BIT_1 = 1 0 BIT_2 = 1 1 ... Basically, those BIT_X lines are creating numbers which have *only* the specified bit set. Then you do byte BIT_X, and that will return 0 if the byte doesn't have the specified bit in it. You can

Python distributing localization files

2010-06-17 Thread Gabriele Lanaro
Hi, I want to localize my application (a pygtk gui app), what's the best way to distribute and install localization files? I'm currently using `distribute` to package it. Any suggestion? -- http://mail.python.org/mailman/listinfo/python-list

Re: Processing HTML form

2010-06-17 Thread Grant Edwards
On 2010-06-17, Bradley Hintze bradle...@aggiemail.usu.edu wrote: I apologize in advance for my lack of knowledge, I really do not know. I would guess server but I quite honestly I am not clear what an 'HTTP client' or 'HTTP server' refers to. I am running a webpage and am serving it locally

Re: The inverse of .join

2010-06-17 Thread Robert Kern
On 6/17/10 3:03 PM, Neil Cerutti wrote: On 2010-06-17, Robert Kernrobert.k...@gmail.com wrote: On 6/17/10 2:08 PM, Neil Cerutti wrote: On 2010-06-17, Ian Kellyian.g.ke...@gmail.com wrote: On Thu, Jun 17, 2010 at 11:45 AM, Neil Cerutti ne...@norwich.edu wrote: What's the best way to do

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 13:01 uur [tijdzone -0700], schreef Stephen Hansen: On 6/17/10 12:13 PM, Laurent Verweijen wrote: How do I make sure the inputstream stays open after the first call to communicate? This was just asked a few days ago in different words-- check out the thread, a

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
On 6/17/10 1:42 PM, Laurent Verweijen wrote: I tried putting what Ian Kelly said in my code, by it doesn't work for me. Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. import os import fcntl import

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 13:48 uur [tijdzone -0700], schreef Stephen Hansen: On 6/17/10 1:42 PM, Laurent Verweijen wrote: I tried putting what Ian Kelly said in my code, by it doesn't work for me. Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type help,

Re: Processing HTML form

2010-06-17 Thread Bradley Hintze
I am on Mac OSX 10.6, server is apache. If I do get this working we will move it to the main server which also serves apache, i believe.I dont think I want a whole new server, I'd like to serve from the apache framework if possible. On Thu, Jun 17, 2010 at 4:34 PM, Grant Edwards

Re: Processing HTML form

2010-06-17 Thread Benjamin Kaplan
On Thu, Jun 17, 2010 at 1:15 PM, Bradley Hintze bradle...@aggiemail.usu.edu wrote: I apologize in advance for my lack of knowledge, I really do not know. I would guess server but I quite honestly I am not clear what an 'HTTP client' or 'HTTP server' refers to. I am running a webpage and am

Re: Py_single_input and the side-effects...

2010-06-17 Thread Mark Lawrence
On 05/06/2010 11:11, Gabriel Genellina wrote: On 31 mayo, 08:11, moerchendiser2k3googler. 1.webmas...@spamgourmet.com wrote: you are right, Python still holds the last reference. I just set a dummy and thats it :) Can you tell me where did you get the information from? Do you mean the _

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
On 6/17/10 2:09 PM, Laurent Verweijen wrote: It just gives me an empty string. Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. from asynchronous import * p = Popen([python, increment.py], stdin=PIPE,

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 23:09 uur [tijdzone +0200], schreef Laurent Verweijen: Op donderdag 17-06-2010 om 13:48 uur [tijdzone -0700], schreef Stephen Hansen: On 6/17/10 1:42 PM, Laurent Verweijen wrote: I tried putting what Ian Kelly said in my code, by it doesn't work for me.

Re: how to get bit info

2010-06-17 Thread Stephen Hansen
On 6/17/10 1:29 PM, Grant Edwards wrote: On 2010-06-17, Stephen Hansen me+list/pyt...@ixokai.io wrote: BIT_1 = 1 0 BIT_2 = 1 1 ... Basically, those BIT_X lines are creating numbers which have *only* the specified bit set. Then you do byte BIT_X, and that will return 0 if the byte

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 14:36 uur [tijdzone -0700], schreef Stephen Hansen: On 6/17/10 2:09 PM, Laurent Verweijen wrote: It just gives me an empty string. Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more

How to print SRE_Pattern (regexp object) text for debugging purposes?

2010-06-17 Thread dmtr
I need to print the regexp pattern text (SRE_Pattern object ) for debugging purposes, is there any way to do it gracefully? I've came up with the following hack, but it is rather crude... Is there an official way to get the regexp pattern text? import re, pickle r = re.compile('^abc$', re.I) r

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
On 6/17/10 2:40 PM, Laurent Verweijen wrote: Op donderdag 17-06-2010 om 14:36 uur [tijdzone -0700], schreef Stephen Hansen: On 6/17/10 2:09 PM, Laurent Verweijen wrote: It just gives me an empty string. Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type help,

Re: Processing HTML form

2010-06-17 Thread Grant Edwards
On 2010-06-17, Bradley Hintze bradle...@aggiemail.usu.edu wrote: I am on Mac OSX 10.6, server is apache. If I do get this working we will move it to the main server which also serves apache, i believe.I dont think I want a whole new server, I'd like to serve from the apache framework if

Re: Py_single_input and the side-effects...

2010-06-17 Thread Stephen Hansen
On 6/17/10 2:32 PM, Mark Lawrence wrote: Where is the use of _ in a script documented, I've searched all over and can't find it, guess I don't have the Midas touch with google? :) Its purely a convention, and one that crosses language-bounds, and isn't entirely universal even given that. It

  1   2   3   >