Hi,
I am rather new to python, and am currently struggling with some
encoding issues. I have some utf-8-encoded text which I need to
encode as iso-2022-jp before sending it out to the world. I am using
python's encode functions:
--
var = var.encode("iso-2022-jp", "replace")
print var
--
I am
Thanks Leo, and everyone else, these were very helpful replies. The
issue was exactly as Leo described, and I apologize for not being
aware of it, and thus not quite reporting it correctly.
At the moment I don't care about round-tripping between half-width and
full-width kana, rather I need only
Hi,
I'm wondering what the best practice is for creating an extensible
dictionary-of-dictionaries in python?
In perl I would just do something like:
my %hash_of_hashes;
for(my $i=0;$i<10;$i++){
for(my $j=0;$j<10;$j++){
${$hash_of_hashes{$i}}{$j} = int(rand(10));
}
}
but it seem
On Dec 9, 5:49 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Sun, 09 Dec 2007 00:35:18 -0800, kettle wrote:
> > Hi,
> > I'm wondering what the best practice is for creating an extensible
> > dictionary-of-dictionaries in python?
>
On Dec 10, 6:58 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> kettle wrote:
> > On Dec 9, 5:49 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> >> On Sun, 09 Dec 2007 00:35:18 -0800, kettle wrote:
> >> > Hi,
> >> > I&
On Dec 10, 6:58 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> kettle wrote:
> > On Dec 9, 5:49 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> >> On Sun, 09 Dec 2007 00:35:18 -0800, kettle wrote:
> >> > Hi,
> >> > I&
Hi I have a socket script, written in perl, which I use to send audio
data from one server to another. I would like to rewrite this in
python so as to replicate exactly the functionality of the perl
script, so as to incorporate this into a larger python program.
Unfortunately I still don't really
On Feb 8, 12:08 am, Bjoern Schliessmann wrote:
> kettle wrote:
> > Hi I have a socket script, written in perl, which I use to send
> > audio data from one server to another. I would like to rewrite
> > this in python so as to replicate exactly the functionality of the
>
On Feb 8, 4:01 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> kettle <[EMAIL PROTECTED]> writes:
> > # pack $length as a 32-bit network-independent long
> > my $len = pack('N', $length);
> [...]
> > the sticking point seems to be the $len variable.
>
Hi,
I was wondering how I ought to be handling character range
translations in python.
What I want to do is translate fullwidth numbers and roman alphabet
characters into their halfwidth ascii equivalents.
In perl I can do this pretty easily with tr:
tr/\x{ff00}-\x{ff5e}/\x{0020}-\x{007e}/;
On Aug 13, 5:18 pm, kettle <[EMAIL PROTECTED]> wrote:
> Hi,
> I was wondering how I ought to be handling character range
> translations in python.
>
> What I want to do is translate fullwidth numbers and roman alphabet
> characters into their halfwidth ascii equivalents.
On Aug 13, 5:33 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> kettle wrote:
> > I was wondering how I ought to be handling character range
> > translations in python.
>
> > What I want to do is translate fullwidth numbers and roman alphabet
> > characters in
12 matches
Mail list logo