Chris Mueller wrote:
> /Hello.
>
> I am relegated to running python 2.2; so I do not have access to subprocess.
>
> In my script; at one point, I need to run a program; interact with the
> program; exit the program; and parse the output printed to stdout.
>
> This would be simple; if I did not
Norman Khine wrote:
> Hello,
> Simple, I guess, but I am trying to do a formated date function, which
> I have working but for a small annoyance in that:
>
from datetime import date
def format_date(day):
> if day > 3 and day < 14:
> return '%b %dth %Y'
>
Dinesh B Vadhia wrote:
> Hi! I'm processing a large number of xml files that are all declared as
> utf-8 encoded in the header ie.
>
>
>
> I'm using elementtree to process the xml files and
> don't (usually) have any problems with that. Plus, the workaround that
> works is to encode each eleme
"Dinesh B Vadhia" wrote in message
news:col103-ds25bb23a18e216061c32eb1a3...@phx.gbl...
Hi! I'm processing a large number of xml files that are all declared as
utf-8 encoded in the header ie.
My Python environment has been set for 'utf-8' through site.py.
It's a bad idea to change th
On Thu, Jun 4, 2009 at 7:47 PM, Kent Johnson wrote:
> On Wed, Jun 3, 2009 at 5:51 PM, W W wrote:
>
> > Do you (or sombody else) know how to get ipython working with Python 2.6
> > (you know,
> > the Python release, which has that new turtle module ;-) )
> >
> > doesn't install on my Windows box
On Wed, Jun 3, 2009 at 5:51 PM, W W wrote:
> Do you (or sombody else) know how to get ipython working with Python 2.6
> (you know,
> the Python release, which has that new turtle module ;-) )
>
> doesn't install on my Windows box... other than that I've got no experience
> with it
What trouble
Alan Gauld schrieb:
"W W" wrote
Do you (or sombody else) know how to get ipython working with Python 2.6
(you know, the Python release, which has that new turtle module ;-) )
doesn't install on my Windows box... other than that I've got no
experience
with it
I thought the new turtle
On 6/4/2009 1:49 PM Chris Mueller said...
/Hello.
I am relegated to running python 2.2; so I do not have access to subprocess.
In my script; at one point, I need to run a program; interact with the
program; exit the program; and parse the output printed to stdout.
This would be simple; if I
*Hello.
I am relegated to running python 2.2; so I do not have access to subprocess.
In my script; at one point, I need to run a program; interact with the
program; exit the program; and parse the output printed to stdout.
This would be simple; if I did not need to interact with my sub-program.
On 6/4/2009 12:04 PM Norman Khine said...
Hello,
Simple, I guess, but I am trying to do a formated date function, which
I have working but for a small annoyance in that:
from datetime import date
def format_date(day):
... if day > 3 and day < 14:
... return '%b %dth %Y'
...
Hello,
Simple, I guess, but I am trying to do a formated date function, which
I have working but for a small annoyance in that:
>>> from datetime import date
>>> def format_date(day):
... if day > 3 and day < 14:
... return '%b %dth %Y'
... indicator = day % 10
... if indic
That was very useful - thanks! Hopefully, I'm "all Unicode" now.
From: wesley chun
Sent: Thursday, June 04, 2009 10:45 AM
To: Dinesh B Vadhia ; tutor@python.org
Subject: Re: [Tutor] unicode, utf-8 problem again
>> But, I still get this error:
>> Traceback (most recent call last):
>> ...
>> But, I still get this error:
>> Traceback (most recent call last):
>> ...
>> UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in
>> position 76: ordinal not in range(128)
>> What am I missing?
>
> Take a read through http://evanjones.ca/python-utf8.html which will give you
>
On Thu, Jun 04, 2009 at 07:25:20PM +0200, Norman Khine wrote:
> Hello,
> Is there a better way to write this:
Depends on what's cleaner and clearer for what you're doing,
especially as the complexity of this code grows. For example,
if the only difference is which method to call, one approach
mi
Thanks
On Thu, Jun 4, 2009 at 7:34 PM, vince spicer wrote:
> you could assign loop variable
>
> @staticmethod
> def get_form(address=None, postcode=None, town=None, phone=None,
> fax=None,
> freephone=None, address_country=None, address_region=None,
> address
you could assign loop variable
@staticmethod
def get_form(address=None, postcode=None, town=None, phone=None,
fax=None,
freephone=None, address_country=None, address_region=None,
address_county=None, hotel=None):
context = get_context()
root = co
Hello,
Is there a better way to write this:
@staticmethod
def get_form(address=None, postcode=None, town=None, phone=None, fax=None,
freephone=None, address_country=None, address_region=None,
address_county=None, hotel=None):
context = get_context(
Okay, I get it now ... reading/writing files with the codecs module and the
'utf-8' option fixes it. Thanks!
From: Christian Witts
Sent: Thursday, June 04, 2009 7:05 AM
To: Dinesh B Vadhia
Cc: tutor@python.org
Subject: Re: [Tutor] unicode, utf-8 problem again
Dinesh B Vadhia wrote:
> H
On Thu, Jun 4, 2009 at 3:48 PM, W W wrote:
> On Thu, Jun 4, 2009 at 8:29 AM, Norman Khine wrote:
>>
>> Hello,
>> I have the following code, which searches through a directory structure
>> such as:
>>
>> $ tree -L 2 companies
>> companies
>> |-- aberdeen-airport-ltd
>> | |-- aberdeen-airport-dyc
Dinesh B Vadhia wrote:
Hi! I'm processing a large number of xml files that are all declared
as utf-8 encoded in the header ie.
My Python environment has been set for 'utf-8' through site.py.
Additionally, the top of each program/module has the declaration:
# -*- coding: utf-8 -*-
But,
I forgot to add that I'm using elementtree to process the xml files and don't
(usually) have any problems with that. Plus, the workaround that works is to
encode each elementtree output ie.:
thisxmlline = thisxmlline.encode('utf8')
But, this seems odd to me as isn't it already being processed
On Thu, Jun 4, 2009 at 8:29 AM, Norman Khine wrote:
> Hello,
> I have the following code, which searches through a directory structure
> such as:
>
> $ tree -L 2 companies
> companies
> |-- aberdeen-airport-ltd
> | |-- aberdeen-airport-dyce-grampian
> | `-- aberdeen-airport-dyce-grampian.meta
Hi! I'm processing a large number of xml files that are all declared as utf-8
encoded in the header ie.
My Python environment has been set for 'utf-8' through site.py. Additionally,
the top of each program/module has the declaration:
# -*- coding: utf-8 -*-
But, I still get this error:
Tr
Hello,
I have the following code, which searches through a directory structure such as:
$ tree -L 2 companies
companies
|-- aberdeen-airport-ltd
| |-- aberdeen-airport-dyce-grampian
| `-- aberdeen-airport-dyce-grampian.metadata
|-- aberdeen-airport-ltd.metadata
|-- aberdeen-motor-company-ltd
|
"NTB" wrote
array [['Food 1', 'Nutrient 1', 0.9],
['Food 1', 'Nutrient 2', 0.2],
['Food 2', 'Nutrient 1', 0.55],
['Food 2', 'Nutrient 2', 0.11]]
into a new array that looks like this:
array [['Food 1', 0.9, 0.2],
['Food 2', 0.55, 0.11]]
I'd proba
Hi,
I have a small query is there any standard module available for generating
heatmap from given set of data.
--
Cheers,
Vishwajeet
http://www.singhvishwajeet.com
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
26 matches
Mail list logo