On Wed, 28 Jul 2010 22:45:19 -0700, John Nagle wrote:
[...]
>> if you have an instance of class A, you can do this:
>>
>> a = A() # make an instance of class A
>> a.__class__ = B # tell it that it's now class B
>>
>> and hope that it won't explode when you try to use it :/
[...]
> The main u
On 29-Jul-2010, at 11:41 AM, Chris Rebert wrote:
> On Wed, Jul 28, 2010 at 8:12 PM, Navkirat Singh wrote:
>> Sorry, I might have been a bit vague:
>> (Also, I am new to pythong)
>> I am trying to do construct my own web session tracking algorithm for a web
>> server (which also I have constructe
On Wed, Jul 28, 2010 at 8:12 PM, Navkirat Singh wrote:
> Sorry, I might have been a bit vague:
> (Also, I am new to pythong)
> I am trying to do construct my own web session tracking algorithm for a web
> server (which also I have constructed). The book keeping is for the session
> information I t
On Wed, Jul 28, 2010 at 9:06 PM, sturlamolden wrote:
> On 29 Jul, 03:47, Navkirat Singh wrote:
>> I was wondering what would be better to do some medium to heavy book keeping
>> in memory - Ordered Dictionary or a plain simple Dictionary object??
>
> It depends on the problem. A dictionary is a
On 7/28/2010 7:32 AM, Steven D'Aprano wrote:
On Wed, 28 Jul 2010 09:35:52 -0400, wheres pythonmonks wrote:
Thanks ... I thought int was a type-cast (like in C++) so I assumed I
couldn't reference it.
Python doesn't have type-casts in the sense of "tell the compiler to
treat object of type A a
On Wed, Jul 28, 2010 at 10:08 PM, John Nagle wrote:
> On 7/28/2010 6:26 PM, geremy condra wrote:
>>
>> On Wed, Jul 28, 2010 at 4:41 PM, Jeffrey
>> Gaynor wrote:
>>>
>>> Hi,
>>>
>>> I am making a first large project in python and am having quite a
>>> bit of difficulty unscrambling various python
On 7/28/2010 6:26 PM, geremy condra wrote:
On Wed, Jul 28, 2010 at 4:41 PM, Jeffrey
Gaynor wrote:
Hi,
I am making a first large project in python and am having quite a
bit of difficulty unscrambling various python versions and what
they can/cannot do. To wit, I must communicate with certain
se
On 29-Jul-2010, at 9:36 AM, sturlamolden wrote:
> On 29 Jul, 03:47, Navkirat Singh wrote:
>
>> I was wondering what would be better to do some medium to heavy book keeping
>> in memory - Ordered Dictionary or a plain simple Dictionary object??
>
> It depends on the problem. A dictionary is a
On 29 Jul, 03:47, Navkirat Singh wrote:
> I was wondering what would be better to do some medium to heavy book keeping
> in memory - Ordered Dictionary or a plain simple Dictionary object??
It depends on the problem. A dictionary is a hash table. An ordered
dictionary is a binary search tree (B
On Wed, 28 Jul 2010 15:58:01 -0700, Joe Goldthwaite wrote:
> This still seems odd to me. I would have thought that the unicode
> function would return a properly encoded byte stream that could then
> simply be written to disk. Instead it seems like you have to re-encode
> the byte stream to some
On Thu, 29 Jul 2010 07:30:34 +0530, Navkirat Singh wrote:
> Hi,
>
> I had another question:
>
> What is the scope of a parameter passed to a function? I know its a
> very basic question, but I am just sharpening my basics :)
>
> def func_something(x)
> return print(x+1);
>
> Does x beco
On Wed, 28 Jul 2010 08:47:52 -0700, Carl Banks wrote:
> On Jul 28, 7:32 am, Steven D'Aprano cybersource.com.au> wrote:
>> On Wed, 28 Jul 2010 09:35:52 -0400, wheres pythonmonks wrote:
>> > Thanks ... I thought int was a type-cast (like in C++) so I assumed I
>> > couldn't reference it.
>>
>> Pyth
On Wed, Jul 28, 2010 at 7:00 PM, Navkirat Singh wrote:
> Hi,
>
> I had another question:
>
> What is the scope of a parameter passed to a function? I know its a very
> basic question, but I am just sharpening my basics :)
>
> def func_something(x)
>
> return print(x+1);
>
> Does x become
On Wed, Jul 28, 2010 at 6:47 PM, Navkirat Singh wrote:
> Hi guys,
>
> I was wondering what would be better to do some medium to heavy book keeping
> in memory - Ordered Dictionary or a plain simple Dictionary object??
Your question is rather vague. Define "book keeping". Why do you feel
an Order
Hi,
I had another question:
What is the scope of a parameter passed to a function? I know its a very basic
question, but I am just sharpening my basics :)
def func_something(x)
return print(x+1);
Does x become a local variable or does it stay as a module scoped variable?
Though I th
Hi guys,
I was wondering what would be better to do some medium to heavy book keeping in
memory - Ordered Dictionary or a plain simple Dictionary object??
Regards,
N4v
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Jul 28, 2010 at 4:41 PM, Jeffrey Gaynor wrote:
> Hi,
>
> I am making a first large project in python and am having quite a bit of
> difficulty unscrambling various python versions and what they can/cannot do.
> To wit, I must communicate with certain services via https and am required to
Hi,
I am making a first large project in python and am having quite a bit of
difficulty unscrambling various python versions and what they can/cannot do. To
wit, I must communicate with certain services via https and am required to
perform certificate verification on them.
The problem is that
> Hello hello ... you are running on Windows; the likelihood that you
> actually have data encoded in latin1 is very very small. Follow MRAB's
> answer but replace "latin1" by "cp1252".
I think you're right. The database I'm working with is a US zip code
database. It gets updated monthly. The p
Thanks to all of you who responded. I guess I was working from the wrong
premise. I was thinking that a file could write any kind of data and that
once I had my Unicode string, I could just write it out with a standard
file.write() operation.
What is actually happening is the file.write() operati
On 7/27/2010 1:28 PM, John Nagle wrote:
Python 2.6 has a recently added "with" clause, borrowed from
LISP, for associating actions with scopes. This is supported for
files and locks, but setting your own object up for "with"
requires adding special methods to the object. "with" is less
convenien
Hi there;
I'm using Tabular Package for manipulating tab-delimited data.
There is a small problem that I cannot get my head around it.
When I construct my tabarray from file, the black fields are replaced by
"nan".
Does any one knows how to just keep them as empty string (ie. ' ')?
Thanks,
-R
--
On Jul 28, 12:44 pm, John Nagle wrote:
> On 7/27/2010 2:36 PM, kBob wrote:
>
>
>
>
>
>
>
> > I created a script to access weather satellite imagery fron NOAA's
> > ADDS.
>
> > It worked fine until recently with Python 2.6.
>
> > The company changed the Internet LAN connections to "Accept Aut
On Jul 29, 4:32 am, "Joe Goldthwaite" wrote:
> Hi,
>
> I've got an Ascii file with some latin characters. Specifically \xe1 and
> \xfc. I'm trying to import it into a Postgresql database that's running in
> Unicode mode. The Unicode converter chokes on those two characters.
>
> I could just manua
On Wed, Jul 28, 2010 at 5:50 AM, whitey wrote:
> On Tue, 27 Jul 2010 19:19:59 -0700, Mithrandir wrote:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On 07/27/2010 04:07 AM, whitey wrote:
>>> hi all. am totally new to python and was wondering if there are any
>>> newsgroups that are t
On Wed, 28 Jul 2010 09:01:38 -0700, Jonathan Hartley wrote:
> Also, is it crazy to imagine that if colorama was pushed through to
> completion (ie. to support a majority of the relevant ANSI codes) then
> Python's stdlib curses module, unmodified, would suddenly just work on
> Windows? (after a ca
On 2010-07-28, Thomas Jollans wrote:
> It might be possible to write a curses-compatible library that works
> with cmd.exe. Maybe. But, even if it's possible, I don't think it's
> easy, and I especially don't think it would be particularly rewarding.
http://pdcurses.sourceforge.net/
It would be
On 07/28/2010 09:29 PM, John Nagle wrote:
> for rawline in input :
> unicodeline = unicode(line,'latin1')# Latin-1 to Unicode
> output.write(unicodeline.encode('utf-8')) # Unicode to as UTF-8
you got your blocks wrong.
--
http://mail.python.org/mailman/listinfo/python-list
On 7/28/2010 11:32 AM, Joe Goldthwaite wrote:
Hi,
I've got an Ascii file with some latin characters. Specifically \xe1 and
\xfc. I'm trying to import it into a Postgresql database that's running in
Unicode mode. The Unicode converter chokes on those two characters.
I could just manually replac
On 07/28/2010 08:32 PM, Joe Goldthwaite wrote:
> Hi,
>
> I've got an Ascii file with some latin characters. Specifically \xe1 and
> \xfc. I'm trying to import it into a Postgresql database that's running in
> Unicode mode. The Unicode converter chokes on those two characters.
>
> I could just ma
Joe Goldthwaite wrote:
Hi,
I've got an Ascii file with some latin characters. Specifically \xe1 and
\xfc. I'm trying to import it into a Postgresql database that's running in
Unicode mode. The Unicode converter chokes on those two characters.
I could just manually replace those to character
Hi,
I've got an Ascii file with some latin characters. Specifically \xe1 and
\xfc. I'm trying to import it into a Postgresql database that's running in
Unicode mode. The Unicode converter chokes on those two characters.
I could just manually replace those to characters with something valid but
i
On 7/27/2010 2:36 PM, kBob wrote:
I created a script to access weather satellite imagery fron NOAA's
ADDS.
It worked fine until recently with Python 2.6.
The company changed the Internet LAN connections to "Accept Automatic
settings" and "Use automatic configuration script"
How do yo
On 2010-07-28, Jonathan Hartley wrote:
> And Neil Cerutti, I think I'll just email the whole source tree
> to myself, and have a script that scans my inbox, unzips source
> trees and runs their tests. Much nicer. :-)
Don't forget to clear the screen, though. That ties the whole
program together.
On Wed, Jul 28, 2010 at 9:30 AM, kBob wrote:
> On Jul 28, 9:11 am, kBob wrote:
>> The connection problem has to do with the proxy settings.
>>
>> In order for me to use Internet Explorer, the LAN's Automatic
>> configuration must be turned on and use a script found on the
>> company's proxy ser
On Wed, Jul 28, 2010 at 9:57 AM, hardi wrote:
> Hi,
>
> I'm trying to interpolate a 3D data (from the pic attached) with the
> interp2d command. What I have, are three vectors f, z, A (x, y, z
> respectively, A is the percentage data given on the isolines). I first put
> the f and z in a meshgrid
On 07/28/2010 07:02 PM, Jonathan Hartley wrote:
> On Jul 28, 5:47 pm, Thomas Jollans wrote:
>> On 07/28/2010 06:01 PM, Jonathan Hartley wrote:
>>
>>
>>
>>> Oh, plus, while we're on this subject:
>>
>>> Am I right that curses in Python stdlib doesn't work on Windows, and
>>> there is currently no s
Bruno Desthuilliers wrote:
Ethan Furman a écrit :
Bruno Desthuilliers wrote:
Bruno Desthuilliers a écrit :
Ethan Furman a écrit :
Bruno Desthuilliers wrote:
Duncan Booth a écrit :
(snip)
Or you could create the default as a class attribute
from the OP:
"""
I have a class (FuncDesigner o
On Jul 28, 5:47 pm, Thomas Jollans wrote:
> On 07/28/2010 06:01 PM, Jonathan Hartley wrote:
>
>
>
> > Oh, plus, while we're on this subject:
>
> > Am I right that curses in Python stdlib doesn't work on Windows, and
> > there is currently no simple way to fix this?
>
> > Also, is it crazy to imagi
Hi,
I'm trying to interpolate a 3D data (from the pic attached) with the
interp2d command. What I have, are three vectors f, z, A (x, y, z
respectively, A is the percentage data given on the isolines). I first put
the f and z in a meshgrid and afterwards in the griddata to get a 3D-grid
then sta
On 07/28/2010 06:01 PM, Jonathan Hartley wrote:
>
> Oh, plus, while we're on this subject:
>
> Am I right that curses in Python stdlib doesn't work on Windows, and
> there is currently no simple way to fix this?
>
> Also, is it crazy to imagine that if colorama was pushed through to
> completion
On Jul 28, 9:11 am, kBob wrote:
> On Jul 27, 4:56 pm, MRAB wrote:
>
>
>
>
>
> > kBob wrote:
> > > On Jul 27, 4:23 pm, MRAB wrote:
> > >> kBob wrote:
>
> > >>> I created a script to access weather satellite imagery fron NOAA's
> > >>> ADDS.
> > >>> It worked fine until recently with Python 2.6.
On 2010-07-28, Jonathan Hartley wrote:
> I want to write a quick script which, notices whenever I save
> my source code, and re-runs the unit tests, displaying the
> output. I think I'd like it to clear the terminal before each
> re-run of the tests, so that it's immediately obvious what is
> outp
On Jul 28, 4:45 pm, Jonathan Hartley wrote:
> On Jul 28, 8:08 am, Ulrich Eckhardt wrote:
>
>
>
> > Daniel Fetchinson wrote:
> > > After getting the technicalities out of the way, maybe I should have
> > > asked:
>
> > > Is it only me or others would find a platform independent python API
> > > to
On Jul 28, 7:32 am, Steven D'Aprano wrote:
> On Wed, 28 Jul 2010 09:35:52 -0400, wheres pythonmonks wrote:
> > Thanks ... I thought int was a type-cast (like in C++) so I assumed I
> > couldn't reference it.
>
> Python doesn't have type-casts in the sense of "tell the compiler to
> treat object of
On Jul 28, 8:08 am, Ulrich Eckhardt wrote:
> Daniel Fetchinson wrote:
> > After getting the technicalities out of the way, maybe I should have
> > asked:
>
> > Is it only me or others would find a platform independent python API
> > to clear the terminal useful?
>
> There are two kinds of programs
On 7/28/2010 4:23 AM Daniel Fetchinson said...
Okay, that makes perfect sense, thanks for the exaplanation!
I'll just live with the platform.system( ) check for this particular
problem then.
If all else fails, repeating 24 (or 40,60?) lines feeds clears the
screen cross platform.
Emile
-
On Jul 27, 4:56 pm, MRAB wrote:
> kBob wrote:
> > On Jul 27, 4:23 pm, MRAB wrote:
> >> kBob wrote:
>
> >>> I created a script to access weather satellite imagery fron NOAA's
> >>> ADDS.
> >>> It worked fine until recently with Python 2.6.
> >>> The company changed the Internet LAN connections
On Wed, 28 Jul 2010 09:35:52 -0400, wheres pythonmonks wrote:
> Thanks ... I thought int was a type-cast (like in C++) so I assumed I
> couldn't reference it.
Python doesn't have type-casts in the sense of "tell the compiler to
treat object of type A as type B instead". The closest Python has to
wheres pythonmonks a écrit :
Thanks ... I thought int was a type-cast (like in C++) so I assumed I
couldn't reference it.
Python has no C/C++ like "type-cast". "int" is the builtin integer type,
and instanciating an object in Python is done by calling it's type.
Remember that in Python, every
On 07/28/10 08:15, wheres pythonmonks wrote:
f( *map(lambda x: int(x), struct.unpack('2s2s2s','123456')))
102
1. There is a way using unpack to get out string-formatted ints?
well, you can use
>>> s = '123456'
>>> [int(s[i:i+2]) for i in range(0, len(s), 2)]
[12, 34, 56]
>>> f(*_)
102
While
wheres pythonmonks wrote:
> Thanks ... I thought int was a type-cast (like in C++) so I assumed I
> couldn't reference it.
Hopefully somebody correct me if I explain this badly, but I'll take a
shot...
Firstly, "int" is a class. Python doesn't make a distinction between builtin
types and class t
wheres pythonmonks wrote:
A new python convert is now looking for a replacement for another perl idiom.
In particular, since Perl is weakly typed, I used to be able to use
unpack to unpack sequences from a string, that I could then use
immediately as integers.
In python, I find that when I use
Thanks ... I thought int was a type-cast (like in C++) so I assumed I
couldn't reference it.
On Wed, Jul 28, 2010 at 9:31 AM, Nick Raptis wrote:
> Ep, that missing line should be:
>
> On 07/28/2010 04:27 PM, Nick Raptis wrote:
>>
>> On 07/28/2010 04:15 PM, wheres pythonmonks wrote:
>>>
>>> f( *
wheres pythonmonks wrote:
> 2. There is something like map(lambda x: int(x) without all the
> lambda function call overhead. (e.g., cast tuple)?
Yes there is: "lambda x: int(x)" is just a roundabout way of writing "int"
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.
Ep, that missing line should be:
On 07/28/2010 04:27 PM, Nick Raptis wrote:
On 07/28/2010 04:15 PM, wheres pythonmonks wrote:
f( *map(lambda x: int(x), struct.unpack('2s2s2s','123456')))
102
But this seems too complicated.
Well, you don't need the lambda at all
int ===lambda x: int(x
On 07/28/2010 04:15 PM, wheres pythonmonks wrote:
f( *map(lambda x: int(x), struct.unpack('2s2s2s','123456')))
102
But this seems too complicated.
Well, you don't need the lambda at all
int ===lambda x: int(x)
So just write
It's like writing:
def myint(x):
return int(x)
Nic
A new python convert is now looking for a replacement for another perl idiom.
In particular, since Perl is weakly typed, I used to be able to use
unpack to unpack sequences from a string, that I could then use
immediately as integers.
In python, I find that when I use struct.unpack I tend to get
On Tue, 27 Jul 2010 19:19:59 -0700, Mithrandir wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 07/27/2010 04:07 AM, whitey wrote:
>> hi all. am totally new to python and was wondering if there are any
>> newsgroups that are there specifically for beginners. i have bought a
>> book
For more information,please contact karen,
MSN:cntrade...@hotmail.com
Minimum order is one,factory price also! Paypal payment free
shipping,ship time will take 4-7 working days.
Shox TW,Shox Saya+,Shox Arraw+,Shox Pursuit+,Shox Turbo V+5,Shox
NZ,Shox Turbo+IV 4,Shox Spotlight,Shox Saikano+,Shox F
>> > After getting the technicalities out of the way, maybe I should have
>> > asked:
>>
>> > Is it only me or others would find a platform independent python API
>> > to clear the terminal useful?
> I don't know much, but just in case the following is useful to anyone:
>
> There is a Windows prog
>> After getting the technicalities out of the way, maybe I should have
>> asked:
>>
>> Is it only me or others would find a platform independent python API
>> to clear the terminal useful?
>
> There are two kinds of programs:
> 1. Those that process input to output. If one of those suddenly starte
jia li, 28.07.2010 12:10:
I have an XML file with hundreds of elements.
What's strange is only one of there elements could not be parsed correctly:
REVERSE_INULL
Dispose_ParameterList
Dispose_ParameterList
UNINSPECTED
146
1/146MMSLib_LinkedList.c
I printed the data in "characters(self, data)
I have an XML file with hundreds of elements.
What's strange is only one of there elements could not be parsed correctly:
REVERSE_INULL
Dispose_ParameterList
Dispose_ParameterList
UNINSPECTED
146
1/146MMSLib_LinkedList.c
I printed the data in "characters(self, data)" and after parsing. The res
On Jul 28, 8:08 am, Ulrich Eckhardt wrote:
> Daniel Fetchinson wrote:
> > After getting the technicalities out of the way, maybe I should have
> > asked:
>
> > Is it only me or others would find a platform independent python API
> > to clear the terminal useful?
>
> There are two kinds of programs
The multiprocessing module has 4 methods for sharing data between processes:
Queues
Pipes
Shared Memory Map
Server Process
Which of these use shared memory?
I understand that the 3rd (Shared Memory Map) does, but what about Queues?
Thanks,
Kevin
__
Ethan Furman a écrit :
Bruno Desthuilliers wrote:
Bruno Desthuilliers a écrit :
Ethan Furman a écrit :
Bruno Desthuilliers wrote:
Duncan Booth a écrit :
(snip)
Or you could create the default as a class attribute
from the OP:
"""
I have a class (FuncDesigner oofun) that has no attribute
I personally prefer to be slightly excessive in the amount of spacing
I used, especially when parentheses are involved.
In no way do I assert that my code style is right for all situations,
but here are a few examples of my personal style.
---
myTuple = ( 1, 2, 3, 4, 5 )# Comment about what th
On Jul 28, 1:26 pm, Peng Yu wrote:
> I know the library reference webpage for re.MatchObject is
> athttp://docs.python.org/library/re.html#re.MatchObject
>
> But I don't find such a help page in python help(). Does anybody know
> how to get it in help()?
Yes, but it doesn't tell you very much:
Daniel Fetchinson wrote:
> After getting the technicalities out of the way, maybe I should have
> asked:
>
> Is it only me or others would find a platform independent python API
> to clear the terminal useful?
There are two kinds of programs:
1. Those that process input to output. If one of those
70 matches
Mail list logo