>
That is IDLE + python 2.4 on Windows. So I'm not sure what is the
problem. In other messages you seems to be talking about system
console. Why? It's not part of IDE.
And another question: are you aware of the fact that recommended way to
handle non-ascii characters is to use unicode type? Most of IDEs should
work fine with unicode.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
Kirill Simonov wrote:
> On Sun, Nov 19, 2006 at 03:27:32AM -0800, Leo Kislov wrote:
> > IDLE on Windows works fine for your example in interactive console:
> >
> > >>> name = raw_input("What's your name? ")
>
> Have you tried to use cyrillic cha
7;"Jörg Nørgens" <[EMAIL PROTECTED]>'
def is_ascii(char):
return ord(char) < 128
for ascii, group in groupby(addr, is_ascii):
h.append(''.join(group),"latin-1")
print h
=>
"J =?iso-8859-1?q?=F6?= rg N =?iso-8859-1?q?=F8?= rgens"
<[EMAIL PROTECTED]>
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
ython25>python -m timeit -s"from array import array; N = 10**6" "a
=array('h'); a.fromstring('\0'*(2*N))"
100 loops, best of 3: 9.57 msec per loop
C:\Python25>python -m timeit -s"from array import array; N = 10**6" "a
= array('h','\0\0'); a*N"
10 loops, best of 3: 28.4 msec per loop
Perhaps if array multiplication was as smart as string multiplication
then array multiplication version would be the fastest.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
ot; "a
=array('h'); a.fromstring('\0'*(2*N))"
100 loops, best of 3: 9.57 msec per loop
C:\Python25>python -m timeit -s"from array import array; N = 10**6; b =
array('h', [0])*(N/2); c = b[:]" "a = b + c"
100 loops, best of 3: 5.7 msec per loop
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
py:
wanted = input[:]
wanted[1::2] = [-item for item in wanted[1::2]]
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
emp'). The exact code how to make the first
parameter unicode depends on where it is coming from (network, config
file, registry, etc...) Reading unicode tutorial is highly recommended.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
f/lists.html
[blah for x in expr] and [blah for x in expr if cond]
And here is reference page for slicing (note, it's not list
comprehension): http://docs.python.org/ref/slicings.html
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
> from somemodule import ISomeInteface
>
> d = compile(sourcecode)
>
> myfoo = d.Foo()
>
> print ISomeInterface in myfoo.__bases__
>
> Any hints?
Here is hello world program for plugins:
import sys
somecode = """
class Foo:
param1 = "Hello, world!&qu
ot;user/cpapen/wm2addressbook"'
> '(\\HasNoChildren) "/" "user/cpapen/wm2prefs"'
> '(\\HasNoChildren) "/" "user/cpapen/wm2signature"'
>
>
> What I have a problem with is the 14th and 15th line.
> All other entries are strings but the 14th is a tuple.
> and the 15th is an empty string. As far as I can tell
> every time a "%" is in the mailbox name I get this kind of
> result.
>
> I'm using python 2.3.3 and the imap sytem is Cyrus.
>
> Can someone explain what is going one?
>
> Is this a bug?
Empty string seems to be a bug. But tuple is by design, read the docs
and imap rfc. The protocol is convoluted in the first place, and so is
python interface.
> If it is, is it fixed in later versions?
Why don't you try to pull imaplib.py from later versions? I don't think
it changed that much so it should be compatible with python 2.3
> Whether or not it is a bug, can I rely on the mailbox
> being the last item in the tuple in these cases?
Yes (at least for list command)
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
Antoon Pardon wrote:
> On 2006-11-28, Leo Kislov <[EMAIL PROTECTED]> wrote:
> >
> > Antoon Pardon wrote:
> >> This little program gives IMO a strange result.
> >>
> >> import imaplib
> >>
> >> user = "cpapen"
>
of the easiest ways is to install acrobat reader and
redirect client browser to a generated pdf file.
http://www.reportlab.org/ has support for generating barcodes (and
more) in pdf documents.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
your case is:
in the beginning of your program:
import sys
if hasattr(sys.stdin, 'encoding'):
console_encoding = sys.stdin.encoding
else:
import locale
locale_name, console_encoding = locale.getdefaultlocale()
and later:
uni = unicode(word, console_encoding)
But don't think it's portable, if you use other IDE or OS, it may not
work. It would be better if PyDev implemented sys.stdin.encoding
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
aries, terminals, etc. It's
not really Python only problem.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
e
this <http://www.codeproject.com/system/display_states.asp> C API calls
into python. You can use ctypes (included in Python 2.5) or python
win32 extensions.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
e file?
> Maybe python doesn't know I'm to use chinese?!
It depends on how EasyDialogs works. And by the way, when you say utf-8
encoded text is not displayed correctly, what do you actually see on
the screen?
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
a property of bytes, it is not applicable
to other objects.
> Or some good solution to work around my problem?
Do not put undecoded bytes in a mixed-type argument list. A rule of
thumb working with unicode: decode as soon as possible, encode as late
as possible.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
really see from your example what stops you from putting
unicode instead of bytes into your tree, but I can believe some
libraries can cause some extra work. That's the problem with libraries,
not with builtin function unicode(). Would you be happy if floating
point value 17.3 would be stored as 8 bytes in your tree? After all,
that is how 17.3 is actually represented in computer memory. Same story
with unicode, if some library gives you raw bytes *you* have to do
extra work later.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Hi Folks,
>
> How to connect from windows to linux using ssh without username/passwd.
>
> With this scenario, i need to write a program on python.
Use ssh library http://cheeseshop.python.org/pypi/paramiko
-- Leo
--
http://mail.python.org/mailman/
t and it will be fixed in python 3.0 (it will raise
exception) I think you should rewrite GetAck to return a tuple (state,
lane)
def GetAck(p):
response = ""
try:
response = p.readline()
except SerialException:
print ">>>>>Timed out<<
ow, and I
am wondering if this way the whole API for foo() won't become to
complex and overdesigned.
I was wondering if anybody has any insights or best practice
recommendations for me here. Do I keep the function interface? Do
I use a class? Any other solution I am overlooking?
Many thanks i
least write it to a log file):
except SerialException, err:
print err
print ">>>>>Timed out<<<<<"
except OSError, err:
print err
print "Serial port failure. Power cycle units"
and in your OpenPort function too.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
. Python datetime module excepts years from 1 up to
:
>>> datetime.MINYEAR
1
>>> datetime.MAXYEAR
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
s
kind of loop are implemented using iterators. Check if your s object
(is it from external library?) already implements iterator. If it does
then
for data in s:
g.write(data)
is all you need. If it doesn't, you can use iter to create iterator for
you:
for data in iter(s.readLine, ''):
g.write(data)
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
y time you say "I get error" please
provide source code where this error occurs. And by the way, do you
know that for non-ascii characters you should use unicode type, not str
type?
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
he results is right. Either unicode string should be
rejected by raising ValueError or it should be encoded with ascii
encoding and result should be the same as
urllib.unquote(u'%94'.encode('ascii')) that is '\x94'. You can consider
current behaviour as undefined just
Ask Ben, he might know, although he's out to lunch.
Ben wrote:
> I'll try it after lunch. Does anyoone know whether this might be the
> problem?
>
> Ben
>
>
> Ben wrote:
> > I have found the problem, but not the cause.
> >
> > I tried setting the database up manually before hand, which let me get
tirely cosmetic, but still) is that I also need to
show this location to the users of my program, who I suspect
would be much happier with a 'proper' Windows path than with this
'~1' DOS malarkey.
Does anybody know how I can obtain a temp directory in 'verbose'
fo
n improvement, portability-wise.
Finally, if at all possible I'd also like to get this working on
Windows, so I'd rather stick with the standard smtplib if I can.
Does anybody here have any thoughts on this?
--
Leo Breebaart <[EMAIL PROTECTED]>
--
http://mail.python.org/mailman/listinfo/python-list
nherent non-portabilitiness of
the whole concept of 'sending mail from within a program', and
will be going with a Unix-only see-if-you-can-find-sendmail
approach.
--
Leo Breebaart <[EMAIL PROTECTED]>
--
http://mail.python.org/mailman/listinfo/python-list
ict() for i in range(88)]
If it doesn't help that means 1) list&dict caches don't really work
like I think or 2) pymalloc cannot return memory because of
fragmentation and that is not simple to "fix".
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
---
Result:
Can you post a short example that clearly demonstrates the problem?
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 8, 2:24 am, Leo Kislov <[EMAIL PROTECTED]> wrote:
> On Jun 7, 5:12 am, [EMAIL PROTECTED] wrote:
>
> > Hi All,
>
> > I am trying to wrap a japanese text in Python, by the following code.
>
> > if len(message) > 54:
> >message = message.
>
> 20004 function calls in 10.214 CPU seconds
> >>> cProfile.run("z=r.readgenome(open('cb_foo'))")
>
> 20004 function calls in 0.041 CPU seconds
>
I suspect open files are cached so the second reader
picks up where the first one left:
back from rendering library.
Assuming you use *fixed* font for English and Thai the following
function will return how many columns your text will use:
from unicodedata import category
def columns(self, s):
return sum(1 for c in s if category(c) != 'Mn')
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 27, 3:10 am, Leo Kislov <[EMAIL PROTECTED]> wrote:
> On Jun 27, 12:20 am, Andy <[EMAIL PROTECTED]> wrote:
>
> > Hi guys,
>
> > I'm writing a piece of software for some Thai friend. At the end it
> > is supposed to print on paper some report with
e zero time point (just like OP wanted). TAI timestamps are
pretty useless IMHO. They need to be converted to decimal/float for
interval calculations and they don't represent any legal time.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
wierd. When the
programmer is *ready* to support unicode he/she will explicitly
call .codepoints() or .graphemes(). As they say: You can lead
a horse to water, but you can't make it drink.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
push("world\n")
asyncore.loop()
s.join()
but the weirdest thing is, if i run python test_asynchat.py directly,
everything is ok.
anybody could help me?
thanks in advance.
ps, my linux box is an ubuntu 6.10.
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
" of convertsimple() - sure it is. However, how
> did it get there? It's in an argument tuple - and where came
> that from?
Looking at the call stack OP posted, -1 is coming as forth parameter
of
__import__, I *guess* at the first import in site.py or at implicit
"import sit
commented further.
> I would have changed the status to "invalid" myself, if I were able to do
> so.
I think it should have been marked as "won't fix" as it's a wart just
like
1/2 == 0, but as there are many users of the current behaviour it's
"
) would
> be useful for a script? (I.e., more useful than importing relative
> to the directory holding the script, as indicated by __file__.)
Do you realize it's a different behaviour and it won't work for some
packages? One possible alternative is to assume empty parent
package and let
i want to compile a python by myself, but after configure and make, it
seems that md5 is not built by default.
what should i do to compile md5 as an module?
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
On 4/30/07, Leo Jay <[EMAIL PROTECTED]> wrote:
> i have a development board based on s3c2410 arm cpu. and i want to
> port python on it.
> after googling some threads, i successfully cross compiled python.
> but i still encountered a weird issue that when i ran
> /lib/pyth
16.384 bytes allocated
> 287.555.584 bytes free
>
> [E:\Projects]c:\Python24\python.exe -c "import os; print
> os.path.getmtime('p64.py')"
> 1164470381
>
> [E:\Projects]c:\Python25\python.exe -c "import os; print
> os.path.getmtime('p64.py
le blank. Do I need MS
> Exchange Server to run this demo?
No, but you need an account on some mail server and some email program
should create a MAPI profile to represent that account on your local
computer. As I understand creation of MAPI profiles is not a common
practice among non-Microsoft products, for example my computer with
Lotus Notes doesn't have any MAPI profiles.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 24, 10:10 am, Stargaming <[EMAIL PROTECTED]> wrote:
> On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote:
> > There are various things I like about the D language that I think Python
> > too may enjoy. Here are few bits (mostly syntactical ones):
>
> > 1) (we have discussed part of thi
not designed for that kind of
usage, it was designed for settings. Either use an option to set
output file or just redirect stdout. If the interface of ldapsearch is
so lame that it requires environmental variable use env to set the
variable: "env __kabc_ldap=/tmp/wrjhdsf ldapsearch ..."
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 16, 12:40 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> Leo Kislov wrote:
> > You're changing environmental variable __kabc_ldap that is shared
> > between your threads. Environment is not designed for that kind of
> > usage, it was designed for setti
On Mar 16, 3:08 pm, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> Leo Kislov wrote:
> > But you miss the fact that there is only one environment per process.
>
> Maybe there's a confusion.
> The environment variable that I'm setting has noting to do with l
; How can I get that without being
> the root user?
Maybe you can go over the list of all possible signals from the
terminal and notify kernel that you want to ignore them. Sounds
similar to dettaching from the terminal, but maybe there some
differences. But the fact that os.setsid fails for you is weird
anyway.
-- Leo.
--
http://mail.python.org/mailman/listinfo/python-list
ng that can handle the characters good, or
> handle the unicode filenames.
You said you've got good result, so it's not clear what do you want.
> Does anyone knows about a python project that can do this?
> Or other tool what I can use for zipping intern. characters?
Zipp
output:
> exceptions.UnicodeDecodeError
> 'ascii' codec can't decode byte 0xd6 in position 26: ordinal not in
> range(128)]
>
> What could the possible cause of this be?
Show us traceback, without it I doubt anyone can help.
> Shouldn't shutil simply be
&
f sys.stdout to another encoding?
What are you going to set it to? As I understand you're going to
distribute your program to some users. How are you going to find out
the encoding of the terminal of your users?
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
everywhere in your program is a complete solution. Like
shutil.copy(xmlfile, u"C:\iTunes Music Library.xml")
if you use constant or make sure your file name is unicode:
dest = unicode()
shutil.copy(xmlfile, dest)
-- Leo.
--
http://mail.python.org/mailman/listinfo/python-list
#x27;s
a personal preference, I usually put as many quit sentinels in a queue
as many consumers.
-- Leo
--
http://mail.python.org/mailman/listinfo/python-list
#x27;.translate(iso2022_squeezing))
It prints u'\u30e1'. Feel free to ask questions if something is not
clear.
Note, this is just an example, I *don't* claim it does what you want
for any character
in FF61-FFDF range. You may want to carefully review the whole unicode
block:
http://www.unicode.org/charts/PDF/UFF00.pdf
-- Leo.
--
http://mail.python.org/mailman/listinfo/python-list
"; % ('192.168.0.92', 31281))
start = datetime.now()
print server.test()
print server.test()
print server.test()
print server.test()
print 'total: ', datetime.now() - start
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
rint foo1(3)
print foo2(3)
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
own, what is then the easiest yet still most Pythonic way
to run doctest on the docstrings in the file?
Trigger doctest.testmod() via a "--test" command-line option, is
what I'm thinking. But is that really the best way?
--
Leo Breebaart <[EMAIL PROTECTED]>
--
http://mail.python.org/mailman/listinfo/python-list
hes, and/or are there perhaps
possibilities I have overlooked?
Many thanks in advance for your feedback.
--
Leo Breebaart <[EMAIL PROTECTED]>
--
http://mail.python.org/mailman/listinfo/python-list
"alisonken1" <[EMAIL PROTECTED]> writes:
> Leo Breebaart wrote:
>
> > I am writing fairly large console scripts in Python. They
> > have quite a few command-line options, which lead to
> > configuration variables that are needed all over the program
> &
Sybren Stuvel <[EMAIL PROTECTED]> writes:
> Leo Breebaart enlightened us with:
> > I think the main reason why I am not using [logging] by
> > default is because, when all is said and done, it still comes
> > easier to me to resort to guarded print statements the
y one manually.
>
> For those of you who work in C++, where do you go to discuss it
> online? I'm interested in any newsgroups, mailing lists, or web
> boards you can recommend.
>
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
a couple of weeks ago I uploaded PyHyphen-0.1 on the PyPI. It is a wrapper
around the C library "hnj_hyphen 2.3" that ships with OpenOffice and Mozilla
products. You can have a look at PyHyphen at
http://pypi.python.org/pypi/PyHyphen/0.2.1a
I've tested it on Linux, but it should also run on
ld be terrific.
Bests
Leo
--
http://mail.python.org/mailman/listinfo/python-list
#x27;s and web
development frameworks.
Although I would be happy to give it a first go on textwrap, I fear I won't
find the time in the coming weeks. Spring is ahead in my country after
all...
So if you wish to contribute, the above bullets may be good starting points.
Thanks again and en
This latest version of PyHyphen is only important for Python 2.4 addicts who
encountered a missing type when compiling. Further, a few signed/unsigned
mismatch warnings coming from MSVC should be fixed. As I have only Python
2.5, I'd be interested in any experiences when compiling it with Python 2.
1) time for 50 passes = 6.00515
This machine benchmarks at 83261.8 pystones/second
I tried many times, and get the same result.
Why optimization mode is slower than normal mode?
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
indows. I'm hoping the core python library has
> a library for this. Note that I'll be using Python 3.0.
>
You can get Wget for Windows here:
http://gnuwin32.sourceforge.net/packages/wget.htm
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
Any special reasons?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
on, and platform variations are common.
>
> So if your underlying C implementation of strftime() supports "%e", then
> Python will. My guess is that the same applies to time.strftime as it does
> to datetime.strftime
>
> The docs list ones that are fairly cross-platform. However, it would seem
> that not all platforms support "%e"
>
>
> -tkc
>
>
> [1]
> http://docs.python.org/library/datetime.html#module-datetime
>
>
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
r("Content-Length", str(fs[6]))# <--
obviously, this is not the same with len(f.read()) in windows.
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
r of python:
>>> a = 10
>>> b = 10
>>> a is b
False
>>> a == b
True
>>> a = 5
>>> b = 5
>>> a is b
True
>>> a == b
True
>>>
which is caused by small object cache mechanism.
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
I need a window's handle to be passed to external c++.
Thanks in advance
--
http://mail.python.org/mailman/listinfo/python-list
Please take close look at the details of the two snapshots.
I need explanation and correcting this problem.
begin 666 after.png
MB5!.1PT*&@[EMAIL PROTECTED];0```#-" ,```#GL'7)`7-21T(`KLX<
MZ01G04U!``"[EMAIL PROTECTED]>B8``("[EMAIL PROTECTED]@``'4P
M``#J8 [EMAIL PROTECTED]/ ```P!03%1%
Thank you , Mike.
"Mike Driscoll" <[EMAIL PROTECTED]>
??:[EMAIL PROTECTED]
On Jul 2, 8:40 pm, "Leo Lee" <[EMAIL PROTECTED]> wrote:
> I need a window's handle to be passed to external c++.
> Thanks in advance
Are you talking about a wxPython wx.Win
"optimize": 2,
"ascii": 1,
"bundle_files": 1}},
zipfile = None,
windows = [test_wx],
)
"Leo Lee" <[EMAIL PROTECTED]> дÈëÏûÏ¢ÐÂÎÅ:[EMAIL PROTECTED]
> Please take close look at the details of the two snapshots.
> I need explanation and correcting this problem.
>
>
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I''m trying achieve the following by running python programs
-login to a website
-automate filling up web forms
So far I 've tried out the following codes:
import cookielib, urllib, urllib2
login = 'cod45'
password = 'mell'
# Enable cookie support for urllib2
cookiejar = cookielib.Cooki
Hiya,
I found this code snippet(reference http://www.goldb.org) and wish to do more
with it than just send out a Http Get request.I would like to introduce more
traffic -say by downloading files,crawling through all the links,logging in etc
etc,and wish to see how the web server reacts.I'm tryin
Fredrik Lundh,
I'm with you and my apologies for not making the scenario more clearer in my
previous post
[QUOTE]"load testing" other people's sites are known as something
else, of course[QUOTE]-
yes,that could cause a DoS and its lameI certainly dont intend to do
that,was just chec
Good Day!
I have set up virtual IPs on my Ubuntu client machine & assigned IPs
192.168.12.3 - eth0
192.168.12.4 - eth0:1
192.168.12.5 - eth0:2
192.168.12.6 - eth0:3
I have written python code to send multiple HTTP requests to my web server to
load test it.When I check the logs on the apache serve
'ful']]
print h_en.wrap('beautiful', 6)
[u'beau-', u'tiful']
print h_en.wrap('beautiful', 7)
[u'beauti-', u'ful']
from textwrap2 import fill
print fill('very long text...', width = 40, use_hyphens = h_en)
My thanks go to those who helped enormously with advice, suggestions,
criticism and Windows builds.
Regards
Leo
--
http://mail.python.org/mailman/listinfo/python-list
ntation it should. But catching an exception
> can't be the standard way to stop iterating right?
>
you can use for loop:
for line in movie_iter:
...
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
te port, the program works.
But if the first element of the tuple is 's', the program doesn't work.
Is it possible to read and write the same socket in different threads?
Thanks in advance.
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Aug 23, 2008 at 1:58 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote:
>>
>> I'd like to read and write the same socket in different threads.
>> one thread is only used to read
gt; ','.join(string.ascii_lowercase)
'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'
>>>
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
this is not an accepted
> and pythonic way of doing things then please let me know... and I'll
> stop!
>
how about this one:
>>> h = { "1" : "a\r", "2" : "b\n" }
>>> dict((k, h[k].strip()) for k in h)
{'1': 'a', '2': 'b'}
>>>
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
I try to a run a python numpy programe, however the python can't run
this program.
my python version is 2.6.2 , numpy version is 1.3.0, however, the
program can run in previous numpy version(1.2.0), who can help me to
solve the problem, I will deeply appreciate!
the program is below:
import sy
when I run a program, it list the hint:
Could not import module "Gnuplot" - it is not installed on your
system. You need to install the Gnuplot.py package.
\easyviz\gnuplot_.py(41) :
Traceback (most recent call last):
File "E:\study\python\commodity modle 10.23.py", line 3, in
import mult
_body, etc.)
I can of course always just hardcode the template filenames in
each derived class, but I am just curious if it can be automated
through some form of introspection.
--
Leo Breebaart
--
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert writes:
> On Mon, Feb 15, 2010 at 10:29 AM, Leo Breebaart wrote:
>
> > I have a base class Foo with a number of derived classes FooA,
> > FooB, FooC, etc. Each of these derived classes needs to read
> > (upon initialisation) text from an associated tem
x27;d doubt it). But it's certainly been
educational to learn about these techniques.
One observation: if I implement the descriptor solution as given
above, the code works perfectly, but running the code through
pychecker now causes an error, because that again causes an
attempt to read from the non-existant base class template file
"Foo.tmpl"...
--
Leo Breebaart
--
http://mail.python.org/mailman/listinfo/python-list
evaluation
and caching solution now -- I never really had a big problem with
that.
My thanks again to all of you for helping me out with this.
--
Leo Breebaart
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I'd like to know how do you guys find out what's happening in your
code if the process seems not work.
In java, I will use jstack to check stacks of threads and lock status.
But I don't know how to do it in python.
--
Best Regards,
Leo Jay
--
http://mail.python.org/m
gt; dont know how to catch them.
>>
> The files and subfolders of Python are all installed into a single
> folder, for example C:\Python26, and none into the system folder or
> other places, if you are worried about that.
>
I don't think so. At least, the pythonXX.d
ult of
'aaa'.encode('base64')
has a '\n' at the end, but the other method doesn't.
Why the inconsistent?
Thanks.
--
Best Regards,
Leo Jay
--
http://mail.python.org/mailman/listinfo/python-list
meant by this warning. In fact, it
simply seems wrong -- but I have learned not to jump to that
conclusion too quickly, so I was hoping someone here could
perhaps enlighten me...
Many thanks in advance,
--
Leo Breebaart
--
http://mail.python.org/mailman/listinfo/python-list
pylint on it before doing anything else, just to see what
comes up.
As far as I can tell the sole reason for that code being
structured the way it is, is to provide a kind of
module-within-a-module and not clutter up the outer module with
these helper classes needed only by the foo() function.
--
L
Hi Folks,
Not being very familiar with python, nor with cgi/http, I intend to
have 3 of buttons in a webpage, each of them is associate with a file
(so I have 3 files, too)
What I would like to have is, when users choose a button, the droplist
update automatically to load the contents of the ass
101 - 200 of 207 matches
Mail list logo