Got it worked with the following change.
PyUnicodeObject *p = ...whatever...;
char* tmp = (char *)p;
PyObject* arg = PyBytes_FromString (tmp);
function( (PyBytesObject*) arg);
>From : MathanK
To : "python-list"
Date : Sat, 15 May 2010 02:50:2
On 2010-05-16 12:27:21 -0700, christian schulze said:
On 16 Mai, 20:20, James Mills wrote:
On Mon, May 17, 2010 at 4:00 AM, Krister Svanlund
wrote:
On Sun, May 16, 2010 at 7:50 PM, AON LAZIO wrote:
How can I set up global variables for the entire python applications?
Like I can call an
I love how he just copied and pasted the assignment without any other
remarks.
--
http://mail.python.org/mailman/listinfo/python-list
Back9 wrote:
Hi,
I have a string like this:
0x340x5A0x9B0xBA
I want to extract 0x from the string but the first one.
How I can use re for this case?
The string size will vary.
TIA
Unless the use of a regular expression is a requirement I'd do it like this:
'0x%s' % s.split ('x', 1)[1].
On May 19, 12:04 am, Erik Max Francis wrote:
> Adam W. wrote:
> > I thought I knew how classes worked, but this code sample is making my
> > second guess myself:
>
> > import threading
>
> > class nThread(threading.Thread):
> > def __init__(self):
> > threading.Thread.__init__(self)
>
Alex Hall wrote:
Sorry, top-posting is a habit on some other lists I am on, and
sometimes it follows me to lists where in-line posting is the way to
do it.
Which list you're on shouldn't matter. You should cultivate
the habit of always quoting selectively and minimally, on
any list. It may tak
On 19/05/2010 03:05, gobnat wrote:
I am trying to release my first python program. I would like to be
able to create a download which will automatically do stuff like add
menu items (eg for KDE, GNOME and Windows). Is there anywhere which
explains how to do this?
Speaking from the Windows per
Alex Hall wrote:
So by calling submarine(craft) I am bringing
in all of craft's attribs (subclassing)? Or does calling craft's
__init__ method do that instead?
By making Submarine a subclass of Craft, you are inheriting
any methods, or other class attributes, defined in the
classes themselves.
Dave Angel wrote:
Inside the __init__() method of Submarine, simply call the __init__()
method of Craft, with appropriate parameters.
To elaborate on that a little, it looks like this:
class Craft:
def __init__(self, position):
self.position = position
class Submarine(Craft):
"Adam W." wrote:
>> If you don't intend to override the constructor in the parent class,
>> simply don't define it.
>
> Hummm, so lets say I wanted it pass all the variables to the parent
> constructor, how would I do that? I wouldn't have to list every
> variable it could possible receive woul
Erik Max Francis wrote:
Adam W. wrote:
class nThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
If you don't intend to override the constructor in the parent class,
simply don't define it.
Or if you do need to override it for some reason, you
need to
On May 19, 4:30 am, Gregory Ewing wrote:
> Or if you do need to override it for some reason, you
> need to accept the extra args and pass them on:
>
> class nThread(threading.Thread):
>
> def __init__(self, *args, **kwds):
> threading.Thread.__init__(self, *args, **kwds)
>
Hi All,
I use Ubuntu 64 bit and need to develop a programme (ideally in
Python) to work on data that is contained in a Microsoft Access 2003
database. I do not need to modify the database, simply read a few
columns of data from some tables.
Google hasn't been able to offer me a suitable solution
Or if you do need to override it for some reason, you
need to accept the extra args and pass them on:
class nThread(threading.Thread):
def __init__(self, *args, **kwds):
threading.Thread.__init__(self, *args, **kwds)
# your other stuff here
Since Thread is a
On 19 May 2010 10:28:15 UTC+1, Jimoid wrote:
> I use Ubuntu 64 bit and need to develop a programme (ideally in
> Python) to work on data that is contained in a Microsoft Access 2003
> database. I do not need to modify the database, simply read a few
> columns of data from some tables.
mxODBC migh
Dear all,
I've a list of float numbers and I would like to delete incrementally
a set of elements in a given range of indexes, sth. like:
for j in range(beginIndex, endIndex+1):
print ("remove [%d] => val: %g" % (j, myList[j]))
del myList[j]
However, since I'm iterating over the same list,
Javier Montoya ha scritto:
Dear all,
I've a list of float numbers and I would like to delete incrementally
a set of elements in a given range of indexes, sth. like:
for j in range(beginIndex, endIndex+1):
print ("remove [%d] => val: %g" % (j, myList[j]))
del myList[j]
However, since I'm
Does it make sense to be able to substitute the pickling action in the
multiprocessing module with google protocol buffers instead? If so,
has anyone thought how to do it? I wanted some operation more compact/
faster than pickling for ipc of data.
Also, has anyone built any wrappers for the mult
On 19/05/2010 11:53, Javier Montoya wrote:
Dear all,
I've a list of float numbers and I would like to delete incrementally
a set of elements in a given range of indexes, sth. like:
for j in range(beginIndex, endIndex+1):
print ("remove [%d] => val: %g" % (j, myList[j]))
del myList[j]
-Original Message-
From: python-list-bounces+shahmed=sfwmd@python.org
[mailto:python-list-bounces+shahmed=sfwmd@python.org] On Behalf Of
Simon Brunning
Sent: Wednesday, May 19, 2010 6:13 AM
To: python-list
Subject: Re: Reading data from a Microsoft Access 2003 database
On 19 May 2
Jimoid wrote:
I use Ubuntu 64 bit and need to develop a programme (ideally in
Python) to work on data that is contained in a Microsoft Access 2003
database. I do not need to modify the database, simply read a few
columns of data from some tables.
this worked like a charm for me:
http://code.a
On Wed, 2010-05-19 at 08:05 -0400, Les Schaffer wrote:
> Jimoid wrote:
>
> > I use Ubuntu 64 bit and need to develop a programme (ideally in
> > Python) to work on data that is contained in a Microsoft Access 2003
> > database. I do not need to modify the database, simply read a few
> > columns of
On Wed, 2010-05-19 at 02:28 -0700, Jimoid wrote:
> Hi All,
> I use Ubuntu 64 bit and need to develop a programme (ideally in
> Python) to work on data that is contained in a Microsoft Access 2003
> database. I do not need to modify the database, simply read a few
> columns of data from some tables.
Hello, and thank you for ALL the informations.
i think i was reading the wrong documents :)
For my use of ABC, i wanted to implement a plugin interface with the
ABC, in first i define a Base class (ABC) that other class
inherit(implement)
so that they can be interfaced as plugins.
but i did have
On 5/19/2010 6:53 AM, Javier Montoya wrote:
I've a list of float numbers and I would like to delete incrementally
a set of elements in a given range of indexes, sth. like:
for j in range(beginIndex, endIndex+1):
print ("remove [%d] => val: %g" % (j, myList[j]))
del myList[j]
However,
Adam Tauno Williams wrote:
The OP: "I use Ubuntu 64 bit"
woops, my bad ...
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 19 May 2010 03:53:44 -0700, Javier Montoya wrote:
> Dear all,
>
> I've a list of float numbers and I would like to delete incrementally a
> set of elements in a given range of indexes, sth. like:
>
> for j in range(beginIndex, endIndex+1):
>print ("remove [%d] => val: %g" % (j, myLis
I'm trying to figure out the best way to view python snippets /
smaller files on the itouch/iPhone.
I'm reading a new projects docs, but it's not easy to view the zip.
It can't view zip files. Say I want to read pyglet examples, I need
unzip at least one file and serve that. If it is text/HTML/py
Hello Folks:
Can you please point me to a decent Python script(s) that I could customize
to do automatic Website mirroring?
Thanks Much!
Kevin
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 19 May 2010 00:16:56 -0700, TomF wrote:
> Let's say you have a bunch of globals, one of which is a verbose flag.
> If I understand the difference, using a module gbls.py:
>
> # in gbls.py
> verbose = False
> # elsewhere:
> import gbls
> gbls.verbose = True
>
> Using a class:
>
> # In th
Hello I am new to Python programming. I need a write a script which
will delete files from a FTP server after they have reached a certain
age, like 7 days for example. I have prepared this code below, but I
get an error message:
The system cannot find the path specified: '/test123/*.*' Probably
som
On 5/19/2010 1:14 AM, Vincent Davis wrote:
I am sure this is easy but I am not sure how to do it and google was
failing me.
Lets say I have a class() with an def x() and def y() and I want
print(class.x) and (class.y) to have custom prints (__str__) how do I do
this
For example
class C(object):
On 5/19/2010 1:14 AM, Vincent Davis wrote:
> class C(object):
>> def __init__(self, new):
>> self.letter = dict(a=1,b=2,c=3, amin=np.amin)
>> self.new = new
>> self._x = None
>> self._Y = None
>>
>> @property
>> def x(self):
>> """I'm the 'x' property.""
On 5/19/2010 3:17 AM, CM wrote:
I love how he just copied and pasted the assignment without any other
remarks.
Yeah, that way he did not mess it up ;-).
--
http://mail.python.org/mailman/listinfo/python-list
On May 19, 4:06 pm, Steven D'Aprano wrote:
> On Wed, 19 May 2010 03:53:44 -0700, Javier Montoya wrote:
> > Dear all,
>
> > I've a list of float numbers and I would like to delete incrementally a
> > set of elements in a given range of indexes, sth. like:
>
> > for j in range(beginIndex, endIndex+1
pilgrim773 wrote:
Hello I am new to Python programming. I need a write a script which
will delete files from a FTP server after they have reached a certain
age, like 7 days for example. I have prepared this code below, but I
get an error message:
The system cannot find the path specified: '/test1
Hello,
I was looking for an ABC for generators in python. While there's a
types.GeneratorType type object - which can't be used directly and it's
not an abc - and many collections-related ABCs in the collections
module, there's no way to say a user-defined class as a generator, even
though it coul
Bonsoir !
La démarche me semble intéressante.
Je testerai le module quand j'aurai un peu de temps.
@-salutations
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
by kjon 2010-03-24T16:40:21+00:00.
> In Philip Semanchuk writes:
> >On Mar 24, 2010, at 12:05 PM, kj wrote:
> >> In the last couple of weeks, docs.python.org has been down repeatedly
> >> (like right now). Has anyone else noticed this?
> >http://downforeveryoneorjustme.com/docs.python.org
> Very h
On Wed, May 19, 2010 at 9:23 AM, Christian Mertes
wrote:
> by kjon 2010-03-24T16:40:21+00:00.
>> In Philip Semanchuk writes:
>> >On Mar 24, 2010, at 12:05 PM, kj wrote:
>> >> In the last couple of weeks, docs.python.org has been down repeatedly
>> >> (like right now). Has anyone else noticed this?
For the archives - solution posted at
http://stackoverflow.com/questions/2861548/how-to-determine-subprocess-popen-failed-when-shelltrue
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
On 5/18/2010 4:54 PM, Chris Rebert wrote:
Suggested reading: http://docs.python.org/library/functions.html#property
I've placed a revision to this official *property* documentation at:
http://wiki.python.org/moin/AlternativeDescriptionOfProperty
There's also a gentle (I hope) intro to t
In [39]: def f():
: return 42
:
In [40]: %psource f
No source found for f
In [41]:
i expected to see the source...
--
http://mail.python.org/mailman/listinfo/python-list
On 18-May-10 19:27 PM, Tim Chase wrote:
On 05/15/2010 05:34 PM, cjw wrote:
It seems that messages are coming from a number of sources, such as
gmane and google groups.
The problem is that many messages seem to get unlinked from their
threads.
I use Thunderbird 3.0.5 and wonder whether the prob
On 18-May-10 17:51 PM, Alex Hall wrote:
Hi again all,
More about classes. I am still looking into my battleship game, and I
will have several different craft. All craft have common attribs
(position, alive, and so on) but each craft may be a surface ship,
submarine, or airplane. All three are cra
On May 19, 8:42 am, Alan Franzoni
wrote:
> Hello,
> I was looking for an ABC for generators in python. While there's a
> types.GeneratorType type object - which can't be used directly and it's
> not an abc - and many collections-related ABCs in the collections
> module, there's no way to say a us
Hi;
I am about to get my feet wet with Python XML, there appears to be many
libraries ... can someone recommend
a good package to use on Ubuntu ???
regards;
Robert Somerville
--
http://mail.python.org/mailman/listinfo/python-list
On May 19, 2010, at 1:54 PM, Robert Somerville wrote:
Hi;
I am about to get my feet wet with Python XML, there appears to be
many libraries ... can someone recommend
a good package to use on Ubuntu ???
Hi Robert,
xml.etree.ElementTree is in the Python standard library as of version
2.5.
On Mi, 2010-05-19 at 09:54 -0700, member thudfoo wrote:
> Worked for me:
>
> ~/isos2burn> telnet docs.python.org 80
> Trying 82.94.164.162...
> Connected to docs.python.org.
> Escape character is '^]'.
> GET/HTTP/1.0
>
>
> 302 Found
>
> Found
> The document has moved http://www.python.org";>he
Hi,
When converting a hex value, I'd like to preserve the decimal
position.
For example, 0x0A is converted to 0A not just A in string.
How do I do this?
TIA
--
http://mail.python.org/mailman/listinfo/python-list
2010/5/19 pilgrim773 :
> Hello I am new to Python programming. I need a write a script which
> will delete files from a FTP server after they have reached a certain
> age, like 7 days for example. I have prepared this code below, but I
> get an error message:
> The system cannot find the path speci
On Wed, May 19, 2010 at 11:38 AM, Back9 wrote:
> Hi,
>
> When converting a hex value, I'd like to preserve the decimal
> position.
> For example, 0x0A is converted to 0A not just A in string.
>
> How do I do this?
>
> TIA
> --
> http://mail.python.org/mailman/listinfo/python-list
>
|109> '%02X' %
On Wed, 2010-05-19 at 11:38 -0700, Back9 wrote:
> Hi,
>
> When converting a hex value, I'd like to preserve the decimal
> position.
> For example, 0x0A is converted to 0A not just A in string.
>
> How do I do this?
>
> TIA
I'm not sure I understand what your use case is, but generally speaking,
... how many positive integers less than n have digits that sum up to m:
In [197]: def prttn(m, n):
tot = 0
for i in range(n):
s = str(i)
sum = 0
for j in range(len(s)):
sum += int(s[j])
if sum == m:
tot += 1
return tot
.:
On 5/19/10 12:11 PM, superpollo wrote:
In [39]: def f():
: return 42
:
In [40]: %psource f
No source found for f
In [41]:
i expected to see the source...
You will want to ask IPython questions on the IPython mailing list:
http://mail.scipy.org/mailman/listinfo/ipython-user
The re
On Wed, May 19, 2010 at 3:58 PM, superpollo wrote:
> ... how many positive integers less than n have digits that sum up to m:
...
> any suggestion for pythonizin' it?
This is how I would do it:
def prttn(m, n):
"""How many positive integers less than n have digits that sum up to m"""
tot
Robert Kern ha scritto:
On 5/19/10 12:11 PM, superpollo wrote:
In [39]: def f():
: return 42
:
In [40]: %psource f
No source found for f
In [41]:
i expected to see the source...
You will want to ask IPython questions on the IPython mailing list:
http://mail.scipy.org/mailman/list
superpollo ha scritto:
Robert Kern ha scritto:
On 5/19/10 12:11 PM, superpollo wrote:
In [39]: def f():
: return 42
:
In [40]: %psource f
No source found for f
In [41]:
i expected to see the source...
You will want to ask IPython questions on the IPython mailing list:
http://mai
On 5/19/10 3:10 PM, superpollo wrote:
Robert Kern ha scritto:
On 5/19/10 12:11 PM, superpollo wrote:
In [39]: def f():
: return 42
:
In [40]: %psource f
No source found for f
In [41]:
i expected to see the source...
You will want to ask IPython questions on the IPython mailing list
Am 19.05.2010 21:58, schrieb superpollo:
> ... how many positive integers less than n have digits that sum up to m:
>
> In [197]: def prttn(m, n):
> tot = 0
> for i in range(n):
> s = str(i)
> sum = 0
> for j in range(len(s)):
> sum += int(s[j])
>
Jerry Hill ha scritto:
On Wed, May 19, 2010 at 3:58 PM, superpollo wrote:
... how many positive integers less than n have digits that sum up to m:
...
any suggestion for pythonizin' it?
This is how I would do it:
def prttn(m, n):
"""How many positive integers less than n have digits th
René 'Necoro' Neumann ha scritto:
Am 19.05.2010 21:58, schrieb superpollo:
... how many positive integers less than n have digits that sum up to m:
In [197]: def prttn(m, n):
tot = 0
for i in range(n):
s = str(i)
sum = 0
for j in range(len(s)):
sum +=
Nima Mohammadi wrote:
> Well, I tried to run Python with -v option. It seems that python26.zip
> is partially loaded but can't be used, because zlib is "unavailable".
This is normal.
the zip library itself cannot be zipped, as it is needed to unzip and
extract th other libs.
>
> n...@nima-deskt
On Wed, May 19, 2010 at 4:25 PM, superpollo wrote:
> Jerry Hill ha scritto:
>> sumofdigits = sum(int(char) for char in str(testval))
>
> this line gives me this:
>
> TypeError: 'int' object is not callable
>
> is it some new feature in >2.5 ?
No, sum() has been a builtin since Python 2.3.
On May 19, 9:30 pm, superpollo wrote:
> René 'Necoro' Neumann ha scritto:
> > An idea would be:
>
> def prttn(m, n):
> > ... return sum(1 for x in range(n) if sum(map(int, str(x))) == m)
>
> TypeError: 'int' object is not callable
>
> on 2.5.4
The TypeError is almost certainly because
Jerry Hill ha scritto:
On Wed, May 19, 2010 at 4:25 PM, superpollo wrote:
Jerry Hill ha scritto:
sumofdigits = sum(int(char) for char in str(testval))
this line gives me this:
TypeError: 'int' object is not callable
is it some new feature in >2.5 ?
No, sum() has been a builtin sinc
Mark Dickinson ha scritto:
On May 19, 9:30 pm, superpollo wrote:
René 'Necoro' Neumann ha scritto:
An idea would be:
def prttn(m, n):
...return sum(1 for x in range(n) if sum(map(int, str(x))) == m)
TypeError: 'int' object is not callable
on 2.5.4
The TypeError is almost certainl
Am 19.05.2010 22:58, schrieb superpollo:
>
> In [277]: prttn(25, 1)
> Out[277]: 348
>
> In [278]: prttn2(25, 1)
> Out[278]: 348
>
> In [279]: prttn3(25, 1)
> Out[279]: 348
>
> ok, bye!
Just because I was curios:
nec...@zakarumiy ~ % python -m timeit "import test; test.prttn(25,100
On 5/19/10 7:24 PM, Carl Banks wrote:
> collections.Iterator
That would just support the next() method. But enhanced generators
interface - supporting coroutines as well - include send(), throw() and
close().
--
Alan Franzoni
contact me at pub...@[mysurname].eu
--
http://mail.python.org/mailma
On Wed, 19 May 2010 22:58:22 +0200, superpollo wrote:
> In [266]: del(sum)
del is a statement, not a function, so the brackets are pointless. This
is like writing:
x = (1)
instead of
x = 1
`del sum` is all you need.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 19 May 2010 21:58:04 +0200, superpollo wrote:
> ... how many positive integers less than n have digits that sum up to m:
>
> In [197]: def prttn(m, n):
Does the name "prttn" mean anything? I'm afraid I keep reading it as a
mispelling of "print n".
[...]
> s = str(i)
>
Can anyone explain the difference between f and d in struct unpack?
When using them, some data work in either one not both.
To me it seems to be same,
TIA
--
http://mail.python.org/mailman/listinfo/python-list
On 05/19/2010 02:53 PM, Back9 wrote:
Can anyone explain the difference between f and d in struct unpack?
When using them, some data work in either one not both.
To me it seems to be same,
TIA
'f' is single precision float (32 bits), and
'd' is a double precision float (64 bits)
Gary Herr
>>> compile("for i in [1,2,3]:\n pass\n#end\n", "test_file.py", "exec")
at 0x266a378, file "test_file.py", line 1>
>>> compile("for i in [1,2,3]:\n pass\n#end", "test_file.py", "exec")
Traceback (most recent call last):
File "", line 1, in
File "", line 2, in cptest
File "test_file.py", line 3
#e
Iuri gmail.com> writes:
> Any ideas about what is happening?
Until Python 2.7/3.2, compile() does't like sources which don't end in a
newline.
--
http://mail.python.org/mailman/listinfo/python-list
Probably need a little more info to help. Are you running both sites, are
there database involved?
If it is a simple site you could just transfer with ftp and have the script
updated any urls.
Vincent
On Wed, May 19, 2010 at 8:21 AM, Kevin Rea wrote:
> Hello Folks:
>
> Can you please point
Thanks, Benjamin.
I used Python 2.6 to these tests.
[]s
iuri
On Wed, May 19, 2010 at 7:31 PM, Benjamin Peterson wrote:
> Iuri gmail.com> writes:
> > Any ideas about what is happening?
>
> Until Python 2.7/3.2, compile() does't like sources which don't end in a
> newline.
>
>
>
> --
> http://m
On Mi, 2010-05-19 at 16:35 -0600, Vincent Davis wrote:
> If it is a simple site you could just transfer with ftp
Or rsync -a or wget -m ... like tools that were specifically made for
this task.
Therefore something like subprocess.call(["rsync", "-az", "-e", "ssh",
"--delete", source, target]) sh
Hi to all,
i need some hints about a console application i' m trying.
I want to make it act as a client and as a server at a same time.
And since it is a console application i' m using cmd library.
I want something that works like asterisk. while working with my app
i want to listen for incoming re
On Wed, 19 May 2010 17:23:18 +0100, Christian Mertes
wrote:
I reported docs.python.org as a broken page to the Opera devs but I'm
also Ccing this
mail to the server admin because this seems to be a more complex problem
than just
a broken (if at all) web browser.
It's been working fine f
In article ,
Christian Heimes wrote:
>>
>> class nThread(threading.Thread):
>> def __init__(self, *args, **kwds):
>> threading.Thread.__init__(self, *args, **kwds)
>> # your other stuff here
>
>Since Thread is a new style class, this should read:
>
>class NThre
In article ,
Christian Mertes wrote:
>
> $ telnet docs.python.org 80
> Trying 2001:888:2000:d::a2...
> Trying 82.94.164.162...
> Connected to docs.python.org.
> Escape character is '^]'.
IPv6 has sometimes been problematical -- try disabling it. Also, I
think you need to pass the host HTTP head
The Karlsruhe Python User Group (KaPy) meets again.
Friday, 2010-04-16 (May 21st) at 19:00 (7pm) in the rooms of Entropia
eV (the local affiliate of the
CCC). See http://entropia.de/wiki/Anfahrt on how to get there.
For your calendars: meetings are held monthly, on the 3rd Friday.
Bye, J
PS: S
On May 19, 2:27 pm, Alan Franzoni
wrote:
> On 5/19/10 7:24 PM, Carl Banks wrote:
>
> > collections.Iterator
>
> That would just support the next() method. But enhanced generators
> interface - supporting coroutines as well - include send(), throw() and
> close().
Hmm, don't know.
Maybe you could
On 5/19/2010 4:14 PM, superpollo wrote:
In [219]: %save tmp.py 218
File `tmp.py` exists. Overwrite (y/[N])? y
The following commands were written to file `tmp.py`:
def f():
return 42
In [220]: !cat tmp.py
def f():
return 42
In [221]: %psource f
No source found for f
maybe i got it:
In [230
On Wed, 19 May 2010 22:31:31 +, Benjamin Peterson wrote:
> Iuri gmail.com> writes:
>> Any ideas about what is happening?
>
> Until Python 2.7/3.2, compile() does't like sources which don't end in a
> newline.
Are you sure about that?
>>> x = compile("print __import__('sys').version, 'see
I noticed that that the link to that section is gone. The page
seems to be there when I use the url that is stored on my computer.
Unrelated but I will mention that It is sad to see that dr dobs python
newsletter has vanished, I enjoyed reading that from time to time.
--
http://mail.python.o
Steven, it works fine to some cases.
I have problem only when last line is a comment and before it I have an
indentation. It is a specific case, and it is not a common case.
>>> compile("for i in [1,2,3]:\n pass\n#end", "test_file.py", "exec")
What I understanded about Benjamin's answer is compi
On Wed, May 19, 2010 at 8:52 PM, Steven D'Aprano
wrote:
> On Wed, 19 May 2010 22:31:31 +, Benjamin Peterson wrote:
>> Iuri gmail.com> writes:
>>> Any ideas about what is happening?
>>
>> Until Python 2.7/3.2, compile() does't like sources which don't end in a
>> newline.
It appears to be thi
FYI.
-- Forwarded message --
From: Cameron Simpson
Date: Wed, May 19, 2010 at 6:18 PM
Subject: Re: question on logging module
To: frank zhu
On 19May2010 11:55, frank zhu wrote:
| Thanks Cameron. That was the problem. I copied the sample code and named
it
| logging.py. which wa
Hello,
My first attenpt at a simple python Tkinter application. I wanted to
see how to load file names into a listbox from a menu. This is what I
got until the part of displaying the file names in a listbox, which I
could not figfure out how to do?
Any help would be appreciated. Trying to do thi
For this kind of problem you should avoid all that stringification. I
find it best to deal with sequences of digits of a fixed length and go
from there. For example:
def count1(m, n, cache={}):
"""Number of digit sequences of length `n` summing to `m`."""
if n < 0 or m < 0:
return
I am new to Python and am trying to write a GUI wrapper script in python
2.5 to get username and passwords from Linux users to send as options to
run an app on a 2X terminal server. I came across the easygui module and
its multpasswordbox function, which made popping a dialog box and storing
th
On May 19, 9:27 pm, Carbon wrote:
> I am new to Python and am trying to write a GUI wrapper script in python
> 2.5 to get username and passwords from Linux users to send as options to
> run an app on a 2X terminal server. I came across the easygui module and
> its multpasswordbox function, which m
Patrick Maupin writes:
> On May 19, 9:27 pm, Carbon wrote:
> > subprocess.call(["/opt/2X/Client/bin/appserverclient", "-u
> > fieldValues [0]", "-p fieldValues[1]", "-s ts.mycompany.org:80", "-d
> > corp", "-S local", "-c 16", "-e 0xF", "-l 0x0409", "-a #1"])
As Patrick says, you need to give t
How can I unescape a raw string so that it behaves as a non-raw
string?
For example, if I read the string "\n\t A B C\" D E F \xa0
\u1234" from a text file, how can I convert (unescape?) this
string so that \n, \t, \", \x, and \u get converted to a newline,
tab, double quote, hex encoded and unico
On Wed, May 19, 2010 at 7:27 PM, Carbon wrote:
> I am new to Python and am trying to write a GUI wrapper script in python
> 2.5 to get username and passwords from Linux users to send as options to
> run an app on a 2X terminal server. I came across the easygui module and
> its multpasswordbox func
On Wed, May 19, 2010 at 8:34 PM, wrote:
> How can I unescape a raw string so that it behaves as a non-raw string?
That's not what the notion of raw strings in Python technically means,
but anyway...
> For example, if I read the string "\n\t A B C\" D E F \xa0 \u1234"
I'll assume you're quoting
On 5/19/2010 5:51 PM, Steven D'Aprano wrote:
On Wed, 19 May 2010 21:58:04 +0200, superpollo wrote:
Rather than iterating over an index j = 0, 1, 2, ... and then fetching
the jth character of the string, you can iterate over the characters
directly. So the inner loop is better written:
for c in
Looking for best practice advice on what string substitution
technique to use when using gettext(). Or do all techniques apply
equally?
I can think of at least 3 string techniques:
1. Classic "%" based formatting:
"My name is %(name)s" % locals()
2. .format() based formatting:
"My name is {nam
1 - 100 of 110 matches
Mail list logo