> >> I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
> >> use Python to help me in this regard?
> >
> > I can say from experience that Python on Windows (at least, Python 2.5
> > on 32-bit Vista) works perfectly well with UTF-8 files containing
> > Bangla. I have had trouble
On Aug 22, 10:53 am, Stefan Behnel wrote:
> Rami Chowdhury wrote:
> >> I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
> >> use Python to help me in this regard?
>
> > I can say from experience that Python on Windows (at least, Python 2.5
> > on 32-bit Vista) works perfectly
On Aug 21, 2009, at 7:15 PM, joy99 wrote:
Dear Group,
I like to convert some simple strings of natural language to XML. May
I use Python to do this? If any one can help me, on this.
I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
use Python to help me in this regard?
Rami Chowdhury wrote:
>> I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
>> use Python to help me in this regard?
>
> I can say from experience that Python on Windows (at least, Python 2.5
> on 32-bit Vista) works perfectly well with UTF-8 files containing
> Bangla. I have h
I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
use Python to help me in this regard?
I can say from experience that Python on Windows (at least, Python
2.5 on 32-bit Vista) works perfectly well with UTF-8 files containing
Bangla. I have had trouble with working with
On 2009-08-21 11:43:31 -0500, Kevin D. Smith
said:
On 2009-08-21 10:39:09 -0500, "Martin v. Löwis" said:
Did you install Python to the network device from your XP box? That
would explain why you can run it: the required registry settings &
environment variables are added by the installer, n
On 2009-08-21 10:39:09 -0500, "Martin v. Löwis" said:
Did you install Python to the network device from your XP box? That
would explain why you can run it: the required registry settings &
environment variables are added by the installer, none of which is
occurring on any computer other than th
joy99 wrote:
> Dear Group,
>
> I like to convert some simple strings of natural language to XML. May
> I use Python to do this? If any one can help me, on this.
>
> I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
> use Python to help me in this regard?
>
> How can I learn
On Fri, 21 Aug 2009 14:48:57 -0500, Derek Martin wrote:
>> It maybe made sense once but this relic of the past should have been
>> consigned to the waste bin of history long ago.
>
> Sigh. Nonsense. I use octal notation *every day*, for two extremely
> prevalent purposes: file creation umask, a
On Fri, 21 Aug 2009 15:17:40 -0700, Jonathan Gardner wrote:
>> Unfortunately, apply() has been removed as a built-in in 3.x. I'm not
>> sure if it has been relocated to a module somewhere, there's no mention
>> of such in the docs.
>
> apply = lambda f: f()
>
> It's one of those functions th
Jonathan Gardner wrote:
> This is brilliant. I am going to use this more often. I've all but
> given up on property() since defining "get_foo", "get_bar", etc... has
> been a pain and polluted the namespace.
Unfortunately I can't remember who I first learned it from - it was
definitely in a post
Dear Group,
I like to convert some simple strings of natural language to XML. May
I use Python to do this? If any one can help me, on this.
I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
use Python to help me in this regard?
How can I learn good XML aspects of Python. If
On Aug 21, 9:40 pm, Christian Heimes wrote:
> SeanMon schrieb:
>
> > Is there a way to decompress a large (2GB) gzipped file being
> > retrieved over FTP on the fly?
>
> > I'm using ftplib.FTP to open a connection to a remote server, and I
> > have had no success connecting retrbinary to gzip with
SeanMon schrieb:
Is there a way to decompress a large (2GB) gzipped file being
retrieved over FTP on the fly?
I'm using ftplib.FTP to open a connection to a remote server, and I
have had no success connecting retrbinary to gzip without using an
intermediate file.
Is there any way to get a file-
Is there a way to decompress a large (2GB) gzipped file being
retrieved over FTP on the fly?
I'm using ftplib.FTP to open a connection to a remote server, and I
have had no success connecting retrbinary to gzip without using an
intermediate file.
Is there any way to get a file-like object describ
Derek Martin writes:
> Sure, but that won't stop people who've been writing code for 20 years
> from continuing to type octal that way... Humans can learn fairly
> easily, but UN-learning is often much harder, especially when the
> behavior to be unlearned is still very commonly in use.
This is
LinkedIn
Tim Heath requested to add you as a connection on LinkedIn:
--
Jaime,
I'd like to add you to my professional network on LinkedIn.
- Tim
View invitation from Tim Heath
http://www.linkedin.com/e/I2LlXdLlWUhFABKmxVOlgGLlWUhFAfhMPPF/bl
Derek Martin writes:
> James Harris wrote:
> > It maybe made sense once but this relic of the past should have been
> > consigned to the waste bin of history long ago.
>
> Sigh. Nonsense. I use octal notation *every day*, for two extremely
> prevalent purposes: file creation umask, and Unix file
On Fri, Aug 21, 2009 at 3:55 PM, Ben Finney wrote:
> Rick King writes:
>
>> shlex doesn't handle unicode input though, so, in general, it's not a
>> good solution.
>
> Argh. Is there a Python bug tracker number for fixing that?
Indeed there is:
http://bugs.python.org/issue1170
It even has a patc
On 21 Aug, 22:18, MRAB wrote:
> Piet van Oostrum wrote:
> >> Derek Martin (DM) wrote:
>
> >> DM> I fail to see how 0O012, or even 0o012 is more intelligible than 012.
> >> DM> The latter reads like a typo, and the former is virtually
> >> DM> indistinguishable from 00012, O0012, or many other
In article <87ocqchl2k@benfinney.id.au>,
Ben Finney wrote:
>"Diez B. Roggisch" writes:
>>
>> excessblk = None
>> if total > P.BASE:
>> excessblk = ...
>>
>> You don't lose any vertical space,
>
>I don't see vertical space as such a scarce resource; we don't have an
>imminent newline shor
On Fri, 21 Aug 2009 14:45:55 -0500, David C Ullrich
wrote:
>[...]
>
>Oops. Should have tested that a little more carefully
>before posting. No time to fix it right now, customer just
>got here. Let's just say we're looking for the primes
>between sqrt(n) and n...
from math import sqrt
def Prime
On 21 Aug, 20:48, Derek Martin wrote:
...
> James Harris wrote:
> > It maybe made sense once but this relic of the past should have been
> > consigned to the waste bin of history long ago.
>
> Sigh. Nonsense. I use octal notation *every day*, for two extremely
> prevalent purposes: file creati
On Aug 21, 1:50 pm, travis+ml-pyt...@subspacefield.org wrote:
> On Mon, Jul 20, 2009 at 04:10:35PM +0200, Hrvoje Niksic wrote:
> > To emulate the os-module-type calls, it's better to raise exceptions
> > than return negative values:
>
> > > def setresuid(ruid, euid, suid):
> > > return _setresu
Rick King writes:
> shlex doesn't handle unicode input though, so, in general, it's not a
> good solution.
Argh. Is there a Python bug tracker number for fixing that? Or is there
a better solution?
--
\ “Pinky, are you pondering what I'm pondering?” “I think so, |
`\ Brain, but if
josef writes:
> On Aug 21, 4:26 am, Ben Finney wrote:
> > Note that, after that list is created, each item in that list is
> > *also* a reference to the corresponding object. That is, ‘a’ is a
> > reference to an object, and ‘dk[0]’ is a *different* reference to
> > the *same* object. The object
seanm wrote:
In the book I am using, they give the following function as an
example:
def copyFile(oldFile, newFile):
f1 = open(oldFile, 'r')
f2 = open(newFile, 'w')
while True:
text = f1.read(50)
This will read up to 50 characters from the input file. At the end of
the file
Why do you post the same question twice within 5 minutes of each other?
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 2009-08-21 at 15:21 -0700, seanm wrote:
> In the book I am using, they give the following function as an
> example:
>
> def copyFile(oldFile, newFile):
> f1 = open(oldFile, 'r')
> f2 = open(newFile, 'w')
> while True:
> text = f1.read(50)
> if text == "":
>
In the book I am using, they give the following function as an
example:
def copyFile(oldFile, newFile):
f1 = open(oldFile, 'r')
f2 = open(newFile, 'w')
while True:
text = f1.read(50)
if text == "":
break
f2.write(text)
f1.close()
f2.close()
In the book I am using, they give the following function as an
example:
def copyFile(oldFile, newFile):
f1 = open(oldFile, 'r')
f2 = open(newFile, 'w')
while True:
text = f1.read(50)
if text == "":
break
f2.write(text)
f1.close()
f2.close()
On Aug 21, 9:09 am, alex23 wrote:
> On Aug 21, 11:36 pm, Jonathan Fine wrote:
>
> class ColourThing(object):
> @apply
> def rgb():
> def fset(self, rgb):
> self.r, self.g, self.b = rgb
> def fget(self):
> return (self.r, self.g, self.b)
> re
On Aug 21, 6:36 am, Jonathan Fine wrote:
> �...@apply
> def tags():
> value = []
> # complicated code
> return value
>
Is this different from:
tags = []
# complicated code
I can see the argument that you are cleaning up a lot of intermediary
variables upon re
On Aug 21, 4:10 pm, MRAB wrote:
[snip]
> That happens if you don't provide the extension, eg you save as
> "my_script" instead of "my_script.py". (Perhaps IDLE should add the
> extension if the user doesn't.)
Yes, and much more needs improvement! I have made many changes already
and i am polishin
M. Hecht wrote:
Hello,
does anyone know whether it is possible to draw three-phase-diagrams with
matplotlib?
A three-phase-diagram is a triangular diagram applied in chemistry e.g. for
slags where
one has three main components of a chemical substance at the corners and
points or lines
within t
Piet van Oostrum wrote:
Derek Martin (DM) wrote:
DM> I fail to see how 0O012, or even 0o012 is more intelligible than 012.
DM> The latter reads like a typo, and the former is virtually
DM> indistinguishable from 00012, O0012, or many other combinations that
DM> someone might accidentally type
newb.py wrote:
I am learning Python and need to use use IDLE, but I am having a
problem. When I open a new window in IDLE and write my code, all is
well. The coloring works and is very helpful. However, when I save the
file I am working on, all the color disappears. And what is more
frustrating i
I am learning Python and need to use use IDLE, but I am having a
problem. When I open a new window in IDLE and write my code, all is
well. The coloring works and is very helpful. However, when I save the
file I am working on, all the color disappears. And what is more
frustrating is that when I ope
On Mon, Jul 20, 2009 at 04:10:35PM +0200, Hrvoje Niksic wrote:
> To emulate the os-module-type calls, it's better to raise exceptions
> than return negative values:
>
> > def setresuid(ruid, euid, suid):
> > return _setresuid(__uid_t(ruid), __uid_t(euid), __uid_t(suid))
>
> def setresuid(ruid
> The default windows install puts Python26.dll in \windows\system32. I
> haven't tried this, but you could probably fix your install by moving
> Python26.dll into the Python26 directory.
Only the admin installation should do that (for all users). The "just
for me" installation won't.
Regards,
Ma
> Derek Martin (DM) wrote:
>DM> I fail to see how 0O012, or even 0o012 is more intelligible than 012.
>DM> The latter reads like a typo, and the former is virtually
>DM> indistinguishable from 00012, O0012, or many other combinations that
>DM> someone might accidentally type (or intentionally
On Fri, Aug 21, 2009 at 08:25:45PM +, Benjamin Peterson wrote:
> > More than flushing out bugs, it will *cause* them in ubiquity,
> > requiring likely terabytes of code to be poured over and fixed.
>
> 2to3, however, can fix it for you extreme easily.
Sure, but that won't stop people who've b
Derek Martin pizzashack.org> writes:
> More than flushing out
> bugs, it will *cause* them in ubiquity, requiring likely terabytes of
> code to be poured over and fixed.
2to3, however, can fix it for you extreme easily.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 20, 10:21 am, "Tim Arnold" wrote:
> Hi,
> I installed python2.6 to a netapp device. I can use it from my local windows
> machine (XP). But others cannot use it from their pcs.
>
> They get this response
> "The system cannot execute the specified program.".
>
> If they double click on python
Simon Forman gmail.com> writes:
> No. You would have to modify and recompile the interpreter. This is
> not exactly trivial, see "How to Change Python's Grammar"
> http://www.python.org/dev/peps/pep-0306/
And even that's incorrect. You'd have to modify the tokenizer.
--
http://mail.python.o
On Fri, Jul 17, 2009 at 04:59:53PM -0400, Jean-Paul Calderone wrote:
> On Fri, 17 Jul 2009 15:01:41 -0500, travis+ml-pyt...@subspacefield.org wrote:
>> I am suggesting that the setresuid function be added to python,
>> perhaps in the OS module, because it has the clearest semantics for
>> manipulat
I've come up with a good test for issue5210 and uploaded it to the bug tracker.
This patch should be ready for inclusion now.
--
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. |
http://www.subspacefield.org/~travis/
If you a
On Fri, 21 Aug 2009, Iñigo Serna wrote:
2009/8/21 Thomas Dickey :
On Aug 20, 6:12 pm, Iñigo Serna wrote:
c = win.getch()
You're using "getch", not "get_wch" (Python's ncurses binding may/may
not have the latter).
curses getch returns 8-bit values, get_wch would return wider values.
On Fri, 21 Aug 2009 14:40:30 -0500, David C Ullrich wrote:
> On Thu, 20 Aug 2009 16:51:00 -0700, Aahz wrote:
>
>> In article ,
>> Benjamin Kaplan wrote:
>>>On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrich
>>>wrot= e:
I just noticed that
sequence[i:j:k]
>>>
>>>Well, I got some goo
John Nagle wrote:
> Yes, and making lead zeros an error as suggested in PEP 3127 is a
> good idea. It will be interesting to see what bugs that flushes
> out.
James Harris wrote:
> It maybe made sense once but this relic of the past should have been
> consigned to the waste bin of history long ag
On Thu, 20 Aug 2009 16:51:00 -0700, Aahz wrote:
> In article ,
> Benjamin Kaplan wrote:
>>On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrich
>>wrot= e:
>>>
>>> I just noticed that
>>> sequence[i:j:k]
>>
>>Well, I got some good news and some bad news. According to the docs, it
>>existed in 1.4 but
On Fri, 21 Aug 2009 14:43:55 -0400
Ronn Ross wrote:
> On Fri, Aug 21, 2009 at 2:26 PM, D'Arcy J.M. Cain wrote:
> > You don't say what database you are using but you may find it simpler
> > to do the conversion in your SELECT statement. For example, see
> > http://www.postgresql.org/docs/8.3/stat
alex23 wrote:
Unfortunately, apply() has been removed as a built-in in 3.x. I'm not
sure if it has been relocated to a module somewhere, there's no
mention of such in the docs.
The old use of apply()
You can save yourself the tidy up by using the same name for the
function & the label:
On Fri, Aug 21, 2009 at 2:26 PM, D'Arcy J.M. Cain wrote:
> On Fri, 21 Aug 2009 14:14:32 -0400
> Ronn Ross wrote:
> > I want to split it into two fields one with the date formatted like this:
> > -MM-DD 2009-08-02
> >
> > and the time to be 24 hour or military time. How every you call it.
>
On Thu, 20 Aug 2009 17:45:11 -0700, John Machin wrote:
> On Aug 21, 5:33 am, David C Ullrich wrote:
>
>> So I'm slow, fine. (There were several times when I was using 1.5.3 and
>> wished they were there - transposing matrices, etc.)
>
> 1.5.THREE ??
Not sure. 1.SOMETHING. Sorry about the CONFU
On Aug 18, 2009, at 6:04 PM, madzientist wrote:
hi,
i have to work with mac OS 9.2 for legacy reasons...is there a
compiled version of python for this os ? i need to get input about
variable values from the user and then print out some text files that
make use of this input. a gui would be nic
On Fri, 21 Aug 2009 14:14:32 -0400
Ronn Ross wrote:
> I want to split it into two fields one with the date formatted like this:
> -MM-DD 2009-08-02
>
> and the time to be 24 hour or military time. How every you call it. Similar
> to this:
> 15:22:00
>
> I found it easy to truncate off the (
On Aug 21, 1:33 pm, ryniek90 wrote:
> I've got some code that checks priviliges on two paths:
> First - chosen by user
> Second - hardcoded home directory represented by **os.getenv('HOME')** -
> (os.getenv('HOME') works both on Linux and Windows)
>
> Here's the code:
> "
> def __check_set_perm(se
I'm new to python and I'm getting a date time from a field in the database
that looks like this:
8/2/2009 8:36:16 AM (UTC)
I want to split it into two fields one with the date formatted like this:
-MM-DD 2009-08-02
and the time to be 24 hour or military time. How every you call it. Similar
t
On Aug 21, 12:12 pm, josef wrote:
> > > I need the object reference name (a,b,c,d) from dk to use as input for
> > > a file.
>
> > You'll have to track that yourself.
>
> I'm a bit shocked that there isn't a method for catching object
> reference names. I think that something like a = MyClass0(nam
On Aug 21, 12:21 am, Carrie Farberow wrote:
> I am trying to build a statically-linked Python based on directions at:
>
> http://yt.enzotools.org/wiki/CrayXT5Installation
>
> I have tried this on multiple systems. The first time I attempt to build
> python, 'make' runs fine but 'make install' fa
Simon Forman wrote:
On Aug 20, 3:06 pm, David <71da...@libero.it> wrote:
Hi all,
Is there some magic to make the 2.x CPython interpreter to ignore the
annoying octal notation?
No. You would have to modify and recompile the interpreter. This is
not exactly trivial, see "How to Change Python's
On Aug 21, 11:40 am, David <71da...@libero.it> wrote:
> Il Thu, 20 Aug 2009 15:18:35 -0700 (PDT), Mensanator ha scritto:
>
> > (Just kidding! That works in 2.5 also. How are you using it where
> > it's coming out wrong? I can see you pulling '012' out of a text
> > file and want to calculate with i
> "Diez B. Roggisch" (DBR) wrote:
>DBR> Jean-Claude Neveu schrieb:
>>> I'm looking for a recommendation about encryption/decryption packages for
>>> Python.
>>>
>>> I'm working on a project that will require me to store some values in a
>>> database in encrypted format. I'll be storing them
I've got some code that checks priviliges on two paths:
First - chosen by user
Second - hardcoded home directory represented by **os.getenv('HOME')** -
(os.getenv('HOME') works both on Linux and Windows)
Here's the code:
"
def __check_set_perm(self, rd_obj_path, backup_dest):
try:
On Fri, Aug 21, 2009 at 9:33 AM, Jamie wrote:
> My goal is to remotely remove the registry keys for McAfee. I don't
> know how winreg handles an exception if a key doesn't exist, but I
> setup my script to skip the exception. But it doesn't seem to work
> right.. I think the script should be self
catafest wrote:
> I don't extract data from jpegs. I wanna put some data in this
> (copyright of my site) ...
>
My wrap for freeimage, called freeimagepy :) can't, as now, wrote exif
information on the image, but since freeimage can do it, I think that
it's not so difficult to add this type of fe
David wrote:
Il Thu, 20 Aug 2009 22:24:24 +0200, Johannes Bauer ha scritto:
David schrieb:
If I want an octal I'll use oct()!
"Explicit is better than implicit..."
A leading "0" *is* explicit.
It isn't explicit enough, at least IMO.
Is this better?
Python 3.1 (r31:73574, Jun 26 2009,
Il Thu, 20 Aug 2009 15:18:35 -0700 (PDT), Mensanator ha scritto:
> (Just kidding! That works in 2.5 also. How are you using it where
> it's coming out wrong? I can see you pulling '012' out of a text
> file and want to calculate with it, but how would you use a
> string without using int()? Passin
Il Thu, 20 Aug 2009 22:24:24 +0200, Johannes Bauer ha scritto:
> David schrieb:
>
>> If I want an octal I'll use oct()!
>>
>> "Explicit is better than implicit..."
>
> A leading "0" *is* explicit.
It isn't explicit enough, at least IMO.
regards
David
--
http://mail.python.org/mailman/listi
My goal is to remotely remove the registry keys for McAfee. I don't
know how winreg handles an exception if a key doesn't exist, but I
setup my script to skip the exception. But it doesn't seem to work
right.. I think the script should be self explanitory, please help!
Please forgive me, but I'm a
On Aug 21, 4:26 am, Ben Finney wrote:
> josef writes:
> > To be clear, Python uses a "Pass By Object Reference" model.
>
> Yes. (I'm glad this concept has propagated to newcomers so well :-)
I found one really good discussion on python semantics versus other
languages. It gave me this gem of a q
On Aug 21, 11:36 pm, Jonathan Fine wrote:
> It might seem odd to use 'apply' as a decorator, but it can make sense.
Yes, it's an idiom I've used myself for property declarations, but one
I find myself using less often:
class ColourThing(object):
@apply
def rgb():
def fset(self, r
> Did you install Python to the network device from your XP box? That
> would explain why you can run it: the required registry settings &
> environment variables are added by the installer, none of which is
> occurring on any computer other than the one from which you installed.
In principle, Pyt
> Would someone be able to inform me how a category can be added to the
> pypy list of categories?
> I'd like to add a CAD & Geometry category.
> ( I develop PythonOCC, wrappers for the OpenCASCADE CAD kernel, which
> is why )
Make a specific proposal to catalog-...@lists.python.org, along with a
Hello,
does anyone know whether it is possible to draw three-phase-diagrams with
matplotlib?
A three-phase-diagram is a triangular diagram applied in chemistry e.g. for
slags where
one has three main components of a chemical substance at the corners and
points or lines
within the triangle marki
tsuraan schrieb:
I'd like to write a Fork class to wrap os.fork that allows something like this:
with Fork():
# to child stuff, end of block will automatically os._exit()
# parent stuff goes here
This would require (I think) that the __enter__ method of my Fork
class to be able to return a va
I'd like to write a Fork class to wrap os.fork that allows something like this:
with Fork():
# to child stuff, end of block will automatically os._exit()
# parent stuff goes here
This would require (I think) that the __enter__ method of my Fork
class to be able to return a value or raise an exc
On Aug 21, 2:07 am, josef wrote:
> To begin, I'm new with python. I've read a few discussions about
> object references and I think I understand them.
>
> To be clear, Python uses a "Pass By Object Reference" model.
> x = 1
> x becomes the object reference, while an object is created with the
> ty
Hi All,
Pydev and Pydev Extensions 1.4.8 have been released
Details on Pydev Extensions: http://www.fabioz.com/pydev
Details on Pydev: http://pydev.sf.net
Details on its development: http://pydev.blogspot.com
Release Highlights in Pydev Extensions:
---
Hi
It might seem odd to use 'apply' as a decorator, but it can make sense.
I want to write:
# Top level in module.
tags =
where the list is most easily constructed using a function.
And so I write:
@apply
def tags():
value = []
# complicated code
return
Hi,
I've done some Python programming, but I still consider myself a
Python newbie. I have a Mac Pro OS X 10.5.8 system and I installed
Python 2.6.2 (the latest package available for the Mac) yesterday.
I was working through Matt Wilson's article on using the logging
module:
http://blog.tplus1.c
shlex doesn't handle unicode input though, so, in general, it's not a
good solution.
Rick King
Southfield MI
http://docs.python.org/library/shlex.html
module shlex — Simple lexical analysis
New in version 1.5.2.
"The shlex class makes it easy to write lexical analyzers for simple
syntaxes res
Ben Finney wrote:
Jean-Michel Pichavant writes:
Can someone explain the difference with the shell argument ? giving
for instance an example of what True will do that False won't.
The ‘shell’ argument to the ‘subprocess.Popen’ constructor specifies
whether the command-line should be i
2009/8/21 Thomas Dickey :
> On Aug 20, 6:12 pm, Iñigo Serna wrote:
>> c = win.getch()
>
> You're using "getch", not "get_wch" (Python's ncurses binding may/may
> not have the latter).
> curses getch returns 8-bit values, get_wch would return wider values.
you are right, ncurses binding do
En Thu, 20 Aug 2009 07:02:26 -0300, ashwin.u@nokia.com
escribió:
We are currently trying to identify and fix all the memory leaks by just
doing Py_Initialize-PyRun_SimpleFile(some simple script)-Py_Finalize and
found that there are around 70 malloc-ed blocks which are not freed. One
Chris Rebert writes:
> module shlex — Simple lexical analysis
> New in version 1.5.2.
> "The shlex class makes it easy to write lexical analyzers for simple
> syntaxes resembling that of the Unix shell."
Exactly what I needed:
>>> import shlex
>>> user_configured_args = "--baz 'crunch cronch' -
Jean-Michel Pichavant writes:
> Can someone explain the difference with the shell argument ? giving
> for instance an example of what True will do that False won't.
The ‘shell’ argument to the ‘subprocess.Popen’ constructor specifies
whether the command-line should be invoked directly (‘shell=Fa
josef writes:
> To be clear, Python uses a "Pass By Object Reference" model.
Yes. (I'm glad this concept has propagated to newcomers so well :-)
> x = 1
> x becomes the object reference
It becomes *a* reference to that object, independent of any other
references to that same object.
> while a
Ben Finney wrote:
Miles Kaufmann writes:
I would recommend avoiding shell=True whenever possible. It's used in
the examples, I suspect, to ease the transition from the functions
being replaced, but all it takes is for a filename or some other input
to unexpectedly contain whitespace or a me
On Fri, Aug 21, 2009 at 2:08 AM, Ben Finney wrote:
> How can I take a string that is intended to be part of a command line,
> representing multiple arguments and the shell's own escape characters as
> in the above example, and end up with a sane command argument list for
> ‘subprocess.Popen’?
htt
Miles Kaufmann writes:
> I would recommend avoiding shell=True whenever possible. It's used in
> the examples, I suspect, to ease the transition from the functions
> being replaced, but all it takes is for a filename or some other input
> to unexpectedly contain whitespace or a metacharacter and
Aaron Scott a écrit :
I have a list of nodes, and I need to find a path from one node to
another. The nodes each have a list of nodes they are connected to,
set up like this:
class Node(object):
def __init__(self, connectedNodes):
self.connectedNodes = connectedNodes
n
Miles Kaufmann writes:
> On Aug 20, 2009, at 10:13 PM, Ben Finney wrote:
> > Why would I use ‘os.waitpid’ instead of::
> >
> >process = subprocess.Popen("mycmd" + " myarg", shell=True)
> >process.wait()
> >status = process.returncode
>
> Really, you can just use:
>
> process = subpr
On Aug 20, 6:12 pm, Iñigo Serna wrote:
> Hi again,
>
> 2009/8/20 Iñigo Serna
> > I have the same problem mentioned
> > inhttp://groups.google.com/group/comp.lang.python/browse_thread/thread/...some
> > months ago.
>
> > Python 2.6 program which usesncursesmodule in a terminal configured to use
En Thu, 20 Aug 2009 06:54:05 -0300, <""Michel Claveau -
MVP"> escribió:
Yes, the module sets is written, in doc, like "deprecated".
But:
- sets exist in Python 2.6 (& 2.5 or 2.4)
- documentation of sets (module) is better tha, documentation of set
(builtin)
The best: read the documenta
josef a écrit :
To begin, I'm new with python. I've read a few discussions about
object references and I think I understand them.
To be clear, Python uses a "Pass By Object Reference" model.
x = 1
x becomes the object reference, while an object is created with the
type 'int', value 1, and identi
I don't extract data from jpegs.
I wanna put some data in this (copyright of my site) ...
On Aug 20, 2:01 pm, MaxTheMouse wrote:
> On Aug 20, 10:23 am, catafest wrote:
>
> > On my photo jpg i have this :
>
> > Image Type: jpeg (The JPEG image format)
> > Width: 1224 pixels
> > Height: 1632 pixel
josef wrote:
To begin, I'm new with python. I've read a few discussions about
object references and I think I understand them.
To be clear, Python uses a "Pass By Object Reference" model.
x = 1
x becomes the object reference, while an object is created with the
type 'int', value 1, and identifie
Jan Kaliszewski wrote:
> 20-08-2009 o 13:01:29 Neal Becker wrote:
>
>> I meant #occurrences of characters from the set A in string B
>
> But:
>
> 1) separately for each element of A? (see Simon's sollution with
> defaultdict)
>
> 2) or total number of all occurrences of elements of A? (see be
1 - 100 of 101 matches
Mail list logo