Steven Bethard a écrit :
> Steven D'Aprano wrote:
>
>> I would love to see your test code and profiling results that demonstrate
>> that explicit tuple unpacking in the body of a function is faster than
>> tuple unpacking (implicit or explicit) in the header of a function.
>
>
> Should be pretty
See http://pynms.sourceforge.net/
Also see Google. :)
David.
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
i am doing a plotting application.
i am using mxRelativeDateTimeDiff to get how much time is between
date x and date y
now what i need to do is divide that time by 20 to get 20 even time
slots
for plotting on a graph.
For example, if the difference between them is 20 hours, i need 20
p
You should also be aware of IronPython, although it is not suitable for
production use due to its reliance on a beta version of the .NET
runtime. In some future time, IronPython will probably be the cleanest
and simplest way to integrate Python with existing .NET code.
http://www.ironpython.com/
Hey there,
i am doing a plotting application.
i am using mxRelativeDateTimeDiff to get how much time is between
date x and date y
now what i need to do is divide that time by 20 to get 20 even time
slots
for plotting on a graph.
For example, if the difference between them is 20 hours, i need 20
Paul Rubin wrote:
> Neal Becker <[EMAIL PROTECTED]> writes:
>> Like a puzzle? I need to interface python output to some strange old
>> program. It wants to see numbers formatted as:
>>
>> e.g.: 0.23456789E01
>
> Yeah, that was normal with FORTRAN.
>
>> My solution is to print to a string with
Hi everyone,
I'm writing an exception that will open a trouble ticket for certain
events. Things like network failure. I thought I would like to have it
only open a ticket if the exception is not caught. Is there a way to do
this inside the Exception? As far as I can see there are only two eve
On Thursday 22 September 2005 05:52, Nico Grubert wrote:
> Does f = open('/tmp/myfile', 'w') overwrite the existing file or
> does f.writelines('456') replace the first line in the existing file?
Here's an excerpt from open.__doc__
The mode can be 'r', 'w' or 'a' for reading (default),
w
If the exception isn't caught, it is printed to standard error. This
means that either __str__ or __repr__ is called (to convert it to a
displayable string). If the exception is caught, those methods
*probably* won't be called.
--
Where you are is not as important as where you are going.
"Måns Rullgård" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This guy deserves two ascii trolls:
>
> ___
> /| /| | |
> ||__|| | Please do |
>
Nico Grubert <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Hi there,
>
> I would like to open an existing file that contains some lines of
> text in order to append a new line at the end of the content.
>
> My first try was:
>
> >>> f = open('/tmp/myfile', 'w') #create new file for wr
Hi
Is there any simpler way to convert a unicode numeric to an int than:
int(u'1024'.encode('ascii'))
??
regards tores
--
http://mail.python.org/mailman/listinfo/python-list
Hi all.
re.split() doesn't work as I intend.
My Python Version is 2.4.1
(#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32.
For example,
>>> r = re.compile('^$', re.MULTILINE)
>>> r.split('foo\nbar\n\nbaz')
['foo\nbar\n\nbaz']
but I expected ['foo\nbar\n', 'baz'].
This proble
Paul Dale wrote:
> I'm writing an exception that will open a trouble ticket for certain
> events. Things like network failure. I thought I would like to have it
> only open a ticket if the exception is not caught. Is there a way to do
> this inside the Exception? As far as I can see there are only
Hello,
I would like to know
how to open a PDF document from a python script, any suggestions are
appreciated.
Thanks,
JR
--
http://mail.python.org/mailman/listinfo/python-list
Op 2005-09-22, Sam schreef <[EMAIL PROTECTED]>:
> Jp Calderone writes:
>
>> On Wed, 21 Sep 2005 18:23:33 -0500, Sam <[EMAIL PROTECTED]> wrote:
>>>I'm using Python 2.3.5 with pygtk 2.4.1, and I'm using the second threading
>>>approach from pygtk's FAQ 20.6 - invoking "gtk.gdk.threads_init()", and
Tor Erik Sønvisen wrote:
> Hi
>
> Is there any simpler way to convert a unicode numeric to an int than:
>
> int(u'1024'.encode('ascii'))
why doesn't:
int(u'104')
work for you?
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/lis
On 2005-09-22, Tor Erik Sønvisen <[EMAIL PROTECTED]> wrote:
> Hi
>
> Is there any simpler way to convert a unicode numeric to an int than:
>
> int(u'1024'.encode('ascii'))
>>> int(u'1024')
1024
Didn't that work for you when you tried it?
--
Grant Edwards grante Yow
Salve a tutti,
sono alle prese con delle stampe su
stampanti ad aghi...
Per stampare puro testo la soluzione più gettonata
sembra essere
f = open("LPT1:")
f.write("bla bla")
f.close()
devo dire che funziona benissimo, ma mi piacerebbe
essere slegato falla parallela (sempre meno frequente)
e invi
Maurice LING <[EMAIL PROTECTED]> writes:
> Is there a way of getting the path to the site-packages directory?
>>> import sys
>>> import os
>>> for dir in sys.path:
... if os.path.split(dir)[-1] == 'site-packages':
... print dir
...
/usr/opt/lib/python2.4/site-packages
>>>
But there's sel
This code doesn't seem to do what I think it should do:
# python 2.3.2
# not sure of my win32 extensions version
import logging
from logging.handlers import NTEventLogHandler
logger = logging.getLogger("testlogger")
handler = NTEventLogHandler("testlogger")
logger.addHandler(handler)
logger.info(
> I would like to know how to open a PDF document from a python script
You mean open it and display it to the user? Under Windows you may be
able to get away with just "executing" the file (as though it were an
executable):
import os
os.system("c:/path/to/file.pdf")
Under Linux you can proba
Paul Dale wrote:
>
> Hi everyone,
>
> I'm writing an exception that will open a trouble ticket for certain
> events. Things like network failure. I thought I would like to have it
> only open a ticket if the exception is not caught. Is there a way to do
> this inside the Exception? As far as I
[EMAIL PROTECTED] wrote:
> Hey there,
> i am doing a plotting application.
> i am using mxRelativeDateTimeDiff to get how much time is between
> date x and date y
>
> now what i need to do is divide that time by 20 to get 20 even time
> slots
> for plotting on a graph.
>
> For example, if the dif
rbt <[EMAIL PROTECTED]> writes:
> On Tue, 2005-09-20 at 23:03 +0100, Tony Houghton wrote:
>> I'm using pygame to write a game called Bombz which needs to save some
>> data in a directory associated with it. In Unix/Linux I'd probably use
>> "~/.bombz", in Windows something like
>> "C:\Documents An
On Thu, 22 Sep 2005 14:31:22 +0200, TK <[EMAIL PROTECTED]> wrote:
>Hi,
>
>is there no IDLE in Python2.4?
>
>o-o
>
>Thomas
Sure,
on Windows:
C:\Python24\Lib\idlelib\idle.pyw
You should have a shortcuts in your StartMenu
und Python 2.4
--
Franz Steinhaeusler
--
http://mail.python.org/mailman/l
I have a vexing problem and seek some input on how to fix it.
Starting with Python 2.4.0, I have been unable to compile a working
Python on our AIX 4.3.3 development system. I can compile a working
Python 2.3.x with no problem.
The failure symptom is that Python 2.4.x fails its unit tests on
tes
"David Wilson" <[EMAIL PROTECTED]> writes:
> See http://pynms.sourceforge.net/
Thanks for the pointer. And to Simon Brunning for the pointer to
Eddie.
> Also see Google. :)
While everything may be in Google, it's not always obvious how to get
it out. I've managed to extract a score of systems fr
Masayuki Takemura wrot:
> re.split() doesn't work as I intend.
it works as it's supposed to work.
empty matches are not considered to be valid split points, partially
because it doesn't really make sense to split on nothing in most cases,
but mostly because doing so will, most likely, result in
Hello,
From windows, using
a python script how can I open Adobe Reader without displaying a PDF
document? Furthermore, using a script is it possible to run two Adobe
Reader sessions simulatneously. Thanks in advance.
Kind
Regards,
JR
--
http://mail.python.org/mailman/listinfo/python-
Simon Brunning <[EMAIL PROTECTED]> writes:
>On 9/22/05, Mike Meyer <[EMAIL PROTECTED]> wrote:
>> I've found a fair number of systems/network monitoring tools (things
>> like Big Brother, Big Sister, cricket, etc.) written in Perl. I'm
>> curious if there are any written in Python.
>There's EDDIE
On Thu, 22 Sep 2005 00:23:56 +1000
Steven D'Aprano wrote:
> I wish the Linux Standard Base folks would specify that settings files
> should all go into a subdirectory like ~/settings rather than filling up
> the home directory with cruft. That was acceptable in the days when people
> only looked a
Jaime Wyant wrote:
> This code doesn't seem to do what I think it should do:
>
> # python 2.3.2
> # not sure of my win32 extensions version
>
> import logging
> from logging.handlers import NTEventLogHandler
> logger = logging.getLogger("testlogger")
> handler = NTEventLogHandler("testlogger")
> lo
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jim Hugunin's keynote speech at this year's PyCon was accompanied by a
> projection if his interactive interpreter session, and I know I wasn't
> alone in finding this a convincing example of Microsoft's (well, Jim's,
Dan <[EMAIL PROTECTED]> writes:
> Under Linux you can probably use xpdf or gpdf:
>
> os.system("xpdf /path/to/file.pdf")
>
> Note that you should check the return code of "system" to see if the
> execution was successful. For example, the user might not have xpdf
> installed.
This is the problem
Hi,
I am trying to install python 2.4.1 on a windows XP machine. Whether I
choose to install 'for me' or 'for all users, and no matter where I select
as the root directory, the installer always puts the python root in C:\,
which is obviously a bit messy.
I am running this instalaltion as a sli
Another option is to implement the needed python code in COM server and
call that from C#. A simple example of python COM server can be seen
about halfway down the page here
http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html
--
http://mail.python.org/mailman/listinfo/python-list
I must be missing something. This is what I read from the documentation:
When a logger is created, the level is set to NOTSET (which causes all
messages to be processed in the root logger, or delegation to the
parent in non-root loggers).
:/
Thanks!
jw
On 22 Sep 2005 08:21:48 -0700, Vinay Sajip
BTW - you're suggestion worked.
Thanks again!
jw
On 9/22/05, Jaime Wyant <[EMAIL PROTECTED]> wrote:
> I must be missing something. This is what I read from the documentation:
>
> When a logger is created, the level is set to NOTSET (which causes all
> messages to be processed in the root logger,
David Wilson wrote:
> http://www.ironpython.com/
It should be noted that they (?) don't seem to update that site
anymore, you can find 0.9.1 here:
http://workspaces.gotdotnet.com/ironpython
There is also Boo, which is Python-like (with some differences) but is
a .NET Language itself. I never und
Hello,
being an almost complete Python AND programming neophyte I would like to ask
the following - very elementary, as I might suspect - question:
How do I do the following flawed things right:
a1=a2=0
def f(x):
if x == a1:
a1 = a1 + 1
elif x == a2:
a2 = a2 + 1
Now
Kreedz wrote:
> Could Windows version have anything to do with this?? Else I've got
> some really weird issue...
>
> I'm on Windows 2000 Professional
Yes, that definitely counts as a wierd issue.
I couldn't reproduce the bug either.
C:\temp>python
ActivePython 2.4.1 Build 247 (ActiveState Corp
>a1=a2=0
>
>def f(x):
>if x == a1:
>a1 = a1 + 1
>elif x == a2:
>a2 = a2 + 1
>
>
>Now if I call f with f(a2) only a1, of course, is incremented because the
>if-clause does only check for the value of the input and the values of a1
>and a2 are identical.
>
>So how do I define
[EMAIL PROTECTED] wrote:
> So how do I define the function such as to discrimate wheter I call it by
> f(a1) or f(a2) ?
I don't want to sound rude, but I think you'll be better served by
telling us why you would want to do such a thing - ten to one someone
can suggest a better way to acomplish
On Thu, 22 Sep 2005 [EMAIL PROTECTED] wrote:
> How do I do the following flawed things right:
Well, that depends on what you mean by 'right'. I'm going to give you two
solutions; one that answers your apparent question, and one that addresses
what i suspect is your true question.
> a1=a2=0
>
>
>If you really want to change an actual parameter inside an object, then
>
>
inside a function, I mean
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> Ron Adam wrote:
>>
>> 2. Expressions that will be used in a calculation or another
>> expression.
>>
> By which you appear to mean "expressions in which Boolean values are
> used as numbers".
Or compared to other types, which is common.
>> This matters because if you
Thanks for the hints. I just found NLTK and MontyLingua.
And yes, it is just adventure game language. This means every tense
except present tense is discarded as "not changing world". Furthermore
the parser will make a lot of assumptions, which are perhaps 90% right,
not perfect:
if word[-2:] ==
Steve Holden wrote:
> Ron Adam wrote:
>
>> Tony Houghton wrote:
>>
>>> I'm using pygame to write a game called Bombz which needs to save some
>>> data in a directory associated with it. In Unix/Linux I'd probably use
>>> "~/.bombz", in Windows something like
>>> "C:\Documents And Settings\\Applic
Further diggingappears to show this is an instance of the problem documented
here:
http://tinyurl.com/82dt2
Running msiexec with logging revealed the following lines:
MSI (s) (48:F8) [18:15:47:990]: Ignoring disallowed property X
MSI (s) (48:F8) [18:15:47:990]: Ignoring disallowed property TARG
Hi,
Have you guys any good experience on connecting a Python (Zope) app
running on Linux to a Windoze SQL*Server ?
Many thanks by advance to report your success, failure, pitfalls (...)
and used products.
Even reports using commercial solutions are welcome.
--
Gilles
--
http://mail.python.o
nephish wrote:
> i am doing a plotting application> If its 40 minutes,
> i need 20 plots that are 2 minutes apart.
> what would be a way i could pull this off?
>
> thanks
Sounds like homework related to another assignment discussed above.
Write your code, try to get it to work, and _then_ i
Antoon Pardon wrote:
> Op 2005-09-22, Sam schreef <[EMAIL PROTECTED]>:
>>What's the GIL?.
>
> The general interpretor lock. In general changing python internals
That should be "global" (and, more pedantically, "interpreter").
--
http://mail.python.org/mailman/listinfo/python-list
Dear All:
I have a question of show percentage.
For example ,I want to show the percentage of 1/3 = 33.33%
I use the 1*100/3 = 33
it is 33 not 33.33 , how to show the 33.33 %
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
beza1e1 wrote:
> Verbs are the tricky part i think. There is no way to recognice them.
> So i will have to get a database ... work to do. ;)
Try the Brill tagger[1] or MXPOST[2].
STeVe
[1] http://www.cs.jhu.edu/~brill/code.html
[2] ftp://ftp.cis.upenn.edu/pub/adwait/jmx/jmx.tar.gz
--
http://mai
Mike wrote:
> > Jim Hugunin's keynote speech at this year's PyCon was accompanied by a
> > projection if his interactive interpreter session, and I know I wasn't
> > alone in finding this a convincing example of Microsoft's (well, Jim's,
> > really) full integration of Python into the .net framewo
Gilles Lenfant wrote:
> Have you guys any good experience on connecting a Python (Zope) app
> running on Linux to a Windoze SQL*Server ?
Yep. I wrote bindings to ODBTP (http://odbtp.sourceforge.net/) using
ctypes. It worked really well, good performance and quite reliable.
You can see an alph
Tony Houghton wrote:
> > This works on Win XP. Not sure if it will work on Linux.
> >
> > import os
> >
> > parent = os.path.split(os.path.abspath(os.sys.argv[0]))[0]
> > file = parent + os.sep + '.bombz'
>
> Ooh, no, I don't want saved data to go in the installation directory. In
> genera
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Which is yet another reason why it makes absolutely no sense to apply
> arithmetic operations to Boolean values.
Except for counting the number of true values. This and other legitimate
uses of False/True as 0/1 (inde
Traditionally, one part of the expression has to be a float for the
result to be a float (this is a holdover from C). So 100/3.0 will give
you the result you want. Alternatively, you can put "from __future__
import division" at the top of your script, and then 100/3 will return
a float.
http://www
You need to convert 1 or 3 to a float. How about:
>>> def pct(num, den): return (float(num)/den) * 100
...
>>> pct(1, 3)
33.329
Peace
Bill Mill
bill.mill at gmail.com
On 22 Sep 2005 10:51:43 -0700, Sen-Lung Chen
<[EMAIL PROTECTED]> wrote:
> Dear All:
> I have a question of show perc
"Sen-Lung Chen" <[EMAIL PROTECTED]> writes:
> Dear All:
> I have a question of show percentage.
> For example ,I want to show the percentage of 1/3 = 33.33%
>
> I use the 1*100/3 = 33
> it is 33 not 33.33 , how to show the 33.33 %
Python interprets '/' in an integer environment to return ints,
Jaime Wyant wrote:
> I must be missing something. This is what I read from the documentation:
>
> When a logger is created, the level is set to NOTSET (which causes all
> messages to be processed in the root logger, or delegation to the
> parent in non-root loggers).
>
The documentation could be c
101 - 163 of 163 matches
Mail list logo