for x in range( 0,10 ):
stars = ""
count = 0
while count < x:
stars += "x"
count += 1
print( stars )
x
xx
xxx
x
xx
xxx
x
You've got already an "x" placed in your variable stars that's why.
-Oorspronkelijk bericht-
Van: Python-list
Outlook voor Android downloaden<https://aka.ms/ghei36>
Van: Francois van Lieshout
Verstuurd: maandag 4 november 2019 18:19
Aan: python-list@python.org
Onderwerp: permission denied using python 3.8
Hi, i installed python 3.8 the latest version but it d
Le vendredi 15 juin 2018 12:36:40 UTC+2, Steven D'Aprano a écrit :
> On Fri, 15 Jun 2018 01:01:03 -0700, francois.rabanel wrote:
>
> > I work with a file which contains millions lines, a simply file.read()
> > and I'm running out of memory
>
> Assuming each line is on average a hundred characters
Le vendredi 15 juin 2018 02:42:12 UTC+2, Cameron Simpson a écrit :
> On 15Jun2018 00:24, Steven D'Aprano
> wrote:
> >On Fri, 15 Jun 2018 10:00:59 +1000, Cameron Simpson wrote:
> >> Francois, unless your regex can cross multiple lines it is better to
> >> searc
Hi,
Here is my script :
It propose to replace some words in a file with a regular expression.
It create a copy to write on it, and if there isn't an error, it delete the
original by the copy with "os.rename" at the end.
My problem is, if I work on a huge file, I'll try to avoid to read the file
Le 07/08/2013 01:18, Francois Lafont a écrit :
> For the inheritance of common options, I'll used something like
> that (even if I prefer the oriented object side of the argparse
> module):
But I admit that this is a very simple and intelligent module. ;-)
--
François L
Hi,
On relfection, it's clear that:
1. the "(-a -b VALUE-B | -c -d VALUE-D)" syntax is not
implemented by the argparse module;
2. and get this syntax with "argparse + hacking" is not very clean.
So, finally I'll use the docopt module version 0.6.1.
For the inheritance of common options, I'll us
Le 05/08/2013 22:01, Rafael Durán Castañeda a écrit :
> I think you are looking for exclusive groups:
>
> http://docs.python.org/2.7/library/argparse.html#argparse.add_mutually_exclusive_group
Yes... but no. The doc explains you can do this:
my-script (-b VALUE-B | -d VALUE-D)
ie mutally excl
Le 05/08/2013 16:11, Miki Tebeka a écrit :
> You can probably do something similar using sub commands
> (http://docs.python.org/2/library/argparse.html#sub-commands).
Yes, but this is not the same syntax. I want this syntax :
my-script (-a -b VALUE-B | -c -d VALUE-D)
I don't want this syntax:
Hello,
Up. ;-)
Le 04/08/2013 04:10, Francois Lafont a écrit :
> Is it possible with argparse to have this syntax for a script?
>
> my-script (-a -b VALUE-B | -c -d VALUE-D)
>
> I would like to do this with the argparse module.
>
> Thanks in advance.
I have f
Hi,
Is it possible with argparse to have this syntax for a script?
my-script (-a -b VALUE-B | -c -d VALUE-D)
I would like to do this with the argparse module.
Thanks in advance.
--
François Lafont
--
http://mail.python.org/mailman/listinfo/python-list
Great thank you
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
In the following example, I don't understand why attribute 'data' is
not reset when I get the new instance of Bag
It works if I make a copy (data[:]) but I want to understand why
Thanks
class Bag(object):
def __init__(self, data = []):
self.data = data
Hi,
I try to match the following url with one regex
/hello
/hello/
/hello/world
/hello/world/
world is a variable, I can put toto instead
Thanks !
--
http://mail.python.org/mailman/listinfo/python-list
(second try with an enhanced version)
Executive summary : What idiom do you use for resetting a list ?
lst = |] # (1)
lst[:] = [] # (2)
del lst[:] # (3)
Consider the following code :
#!/usr/bin/env python
# -*- coding: latin_1 -*-
"""
container.py how to clear a container
"""
c
Consider the following code :
#!/usr/bin/env python
# -*- coding: latin_1 -*-
"""
container.py how to clear a container
"""
class Container(object):
def __init__(self):
self.elts = {}
self.parts = []
def clear(self):
self.elts.clear() # for a dictionary it's cl
No the change of sign is due to a fake copy and past,
My question was related to decimal calculation.
Thanks,
Francois Liot
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul McGuire
Sent: Friday, January 04, 2008 1:46 PM
To: python-list@python.org
Thanks in advance,
Francois Liot
--
http://mail.python.org/mailman/listinfo/python-list
"Lawson Hanson" <[EMAIL PROTECTED]> a écrit dans le message de
news: [EMAIL PROTECTED]
> Nicholas Bastin wrote:
>> On 10/4/07, Jean-Francois Canac <[EMAIL PROTECTED]> wrote:
>>> [EMAIL PROTECTED]
>>>> I would draw dots on a suitably sized Tk
I am very new in Python and I would like to write an application which takes
records from a COM port (or from a file to replay) and draw a real time
Plot.
But I am confused I have looked at Matplotlib, and a little at hippodraw, I
have seen that there are many plot interfaces . But I really don
"Hendrik van Rooyen" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Jean-Francois Canac wrote:
>
>>I am reading a large amount of data from a COM port (or from a file) at a
>>rate
> of 20 records per second. It is about >pos
I am reading a large amount of data from a COM port (or from a file) at a
rate of 20 records per second. It is about positioning of a vehicle on a
race track.
In each record we have time, position (lat and long) speed, course all from
GPS equipment. I would like to Produce a graph in real time wi
Duncan Booth wrote :
> francois.petitjean at bureauveritas.com wrote:
>> After much head scrating and experimenting with dis.dis() I have found
>> that chaining comparisons (with is or ==) a == b == c in Python is
>> never a good idea. It is interpreted as
>> ( a == b ) and ( b == c)
>> Such a m
In the python-ideas mailing list
http://mail.python.org/pipermail/python-ideas/2007-March/thread.html there
was a discussion about the fact that python has opeartors 'and', 'or' and
'not' (keywords of the language) but 'bool' is a type. Naturally we have
(not not x) == bool(x) # always True
If
This taxonomy is described in the Python Cookbook 2nd Ed,. Chapter 6,
Introduction written by Alex Martelli, on page 234. The author explains
that "multiple inheritance frees you from these contraints" - of
fitting into a single taxonomy.
--
http://mail.python.org/mailman/listinfo/python-list
ion) to prevent ambiguity rather than
depending on heuristics. Also "consistency" meant doing things as
uniformly as possible (for example always call a function with the same
syntax, whether the variable referencing it is the original name or an
alias).
-- Francois
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> What happened to 3)?
>
"4)" should have read "3)". I found the typo after I posted. I guess I
lack "rigor" myself !
--
http://mail.python.org/mailman/listinfo/python-list
hod) to prevent ambiguity rather than
depending on heuristics. Also "consistency" meant doing things as
uniformly as possible (for example always call a method with the same
syntax, whether the variable referencing it is the original name or an
alias).
-- Francois
--
http://mail.python.org/mailman/listinfo/python-list
I discovered Python a few months ago and soon decided to invest time in
learning it well. While surfing the net for Python, I also saw the hype
over Ruby and tried to find out more about it, before I definitely
embarked on studying and practicing Python. I recently found two
sufficient answers for
riter/
We use the latter one in the past. As long as
your output is plain enough. It's effective
and MS-free.
The former should be more powerful. Not tested
here.
Hope this helps
Francois
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
>Francois De Serres wrote:
>
>
>
>>I'll pick ('%c' * len(t)) % t, for it's readability and the fact that
>>join() is on the deprec'd list.
>>
>>
>
>''.join() is certainly not deprecated. What m
Francois De Serres wrote:
>hiho,
>
>what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to
>the string 'spam'?
>
>TIA,
>Francois
>
>
thanks to all!
I'll pick ('%c' * len(t)) % t, for it's readability and the
hiho,
what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to
the string 'spam'?
TIA,
Francois
--
http://mail.python.org/mailman/listinfo/python-list
ta->deviceIndex,
data->timestamp, data->buffer, data->size);// 0, 0, "test", 4);//
result = PyEval_CallObject(my_callback, arglist);
Py_DECREF(arglist);
Py_DECREF(result);
PyGILState_Release(gil);
Simon Dahlbacka wrote:
>Re: assigning a PyStr object to __doc__, take a look at Py_InitModule3,
>which does that for you.
>
>
>
got it, thx.
>Then you have the PyDoc_STRVAR macro in python.h that you might want to
>use (see definition below). But as Robert already told you, you'll need
>to prov
Robert Kern wrote:
>Francois De Serres wrote:
>
>
>>Hiho,
>>
>>I can't seem to find a proper way to document my extension module.
>>Following the C API doc:
>>
>>static PyMethodDef ioMethods[] = {
>>{"o_count", o_c
function parameters
Also, I'd like to know if there's a typical format for the help string
(but in C), compatible with docstring's
"""short desription
long description"""
Any pointers please?
TIA,
Francois
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
>Francois De Serres wrote:
>
>
>>Francois De Serres wrote:
>>
>>
>>>Having a string: "dothat"
>>>and a tuple: (x, y)
>>>1. What's the best way to build a function call like: dothat(x,y)?
>>
Duncan Booth wrote:
>Francois De Serres wrote:
>
>
>
>>Sorry, I was unclear about the fact that the args are formals. I'm
>>trying to do something like:
>>
>>func = "dothat"
>>args = ('x','y')
>>localcontext =
Steven D'Aprano wrote:
>On Wed, 13 Jul 2005 06:16:54 -0700, Robert Kern wrote:
>
>
>
>>Duncan Booth wrote:
>>
>>
>>>Francois De Serres wrote:
>>>
>>>
>>>
>>>>Having a string: "dothat"
Francois De Serres wrote:
>Hiho,
>
>Having a string: "dothat"
>and a tuple: (x, y)
>1. What's the best way to build a function call like: dothat(x,y)?
>
>Assuming dothat is def'd in the same module,
>2. is: eval("dothat(x,y)", None, ((
Michael Hoffman wrote:
>Peter Hansen wrote:
>
>
>>Francois De Serres wrote:
>>
>>
>>
>
>
>
>>>*args is documented in the Tutorial. I reckon **kwargs represents a
>>>dictionary of arguments. But I don't quite get the semant
Peter Hansen wrote:
>Roland Heiber wrote:
>
>
>>Not the best (not at all) but one way:
>>
>>def dothat(x,y):
>> print "Called with:", x, y
>>
>>c = (1,2)
>>
>>locals().get("dothat")(*c)
>>
>>
>
>As you say, not the best, but in fact not really advisable under any
>circumstances. locals()
Roland Heiber wrote:
>Francois De Serres wrote:
>
>
>>Hiho,
>>
>>Having a string: "dothat"
>>and a tuple: (x, y)
>>1. What's the best way to build a function call like: dothat(x,y)?
>>
>>
>
>Not the best (not at
se, I wish I was, but I'm
not a scientist).
TIA,
Francois
--
http://mail.python.org/mailman/listinfo/python-list
it executed?
If dothat is def'd in another module:
3. what would be the right way to initialize the globals to pass to eval ?
TIA,
Francois
--
http://mail.python.org/mailman/listinfo/python-list
:
while True:
print q.get()
if __name__ == '__main__':
spam.setCallback(callback)
t = threading.Thread(job)
t.start()
raw_input()
Please point me to what I'm doing wrong...
TIA,
Francois
PS: I've already submitted my issue under "(Win32 API) callback to
Python, threading hiccups", but I guess it was poorly formulated.
--
http://mail.python.org/mailman/listinfo/python-list
Christopher Subich wrote:
>Francois De Serres wrote:
>
>
>>- so, on callback, I create a new thread, after checking that the
>>previous one has returned already (WaitOnSingleObject(mythread)) so we
>>only have one thread involved.
>>
>>
>
>
ll I figure out what's really happening.
Could someone save my precious and already sparse sleeping time, by
pointing me to what I'm missing here?
WinXP SP1
Python 2.4.1
MinGW GCC 3.4.2
TIA,
Francois De Serres
--
http://mail.python.org/mailman/listinfo/python-list
sed
applications (such as wxpython-based ones).
Regards to you
Francois
--
http://mail.python.org/mailman/listinfo/python-list
Peter,
May my I apologize for knocking against your information, as well.
> For what it is worth, my experience is as follows: Using a PIII
> 550MHz, 256MB RAM, running WinNT 4.0 and Python 2.3.4 and connecting
> to a Sybase Adaptive Server Anywhere 8.0 database, mx.ODBC took
> approximately 8 wal
51 matches
Mail list logo