On Wed, 30 Dec 2015 11:51:19 +, Charles T. Smith wrote:
> Hi,
>
> How can I get *all* the names of an object's attributes? I have legacy
> code with mixed new style classes and old style classes and I need to
> write methods which deal with both. That's the imm
On Wed, 30 Dec 2015 11:51:19 +, Charles T. Smith wrote:
> Hi,
>
> How can I get *all* the names of an object's attributes? I have legacy
> code with mixed new style classes and old style classes and I need to
> write methods which deal with both. That's the imm
Hello,
I thought __getitem__() was invoked when an object is postfixed with an
expression in brackets:
- abc[n]
and __getattr__() was invoked when an object is postfixed with an dot:
- abc.member
but my __getitem__ is being invoked at this time, where there's no
subscript (going into a s
On Wed, 30 Dec 2015 23:50:03 +1100, Chris Angelico wrote:
> On Wed, Dec 30, 2015 at 11:40 PM, Charles T. Smith
> wrote:
>> Oh!
>>
>> Although the referenced doc says:
>>
>> "For compatibility reasons, classes are still old-style by default."
>
On Thu, 31 Dec 2015 00:11:24 +1100, Chris Angelico wrote:
> On Wed, Dec 30, 2015 at 11:57 PM, Charles T. Smith
> wrote:
>> Hello,
>>
>> I thought __getitem__() was invoked when an object is postfixed with an
>> expression in brackets:
>>
>> - abc[n]
&
On Wed, 30 Dec 2015 14:10:14 +, Mark Lawrence wrote:
> On 30/12/2015 11:51, Charles T. Smith wrote:
>> Hi,
>>
>> Does anyone know *why* the __members__ method was deprecated, to be
>> replaced by dir(), which doesn't tell the truth (if only it took an
&
On Wed, 30 Dec 2015 08:35:57 -0700, Ian Kelly wrote:
> On Dec 30, 2015 7:46 AM, "Charles T. Smith"
> wrote:
>> As is so often the case, in composing my answer to your question, I
>> discovered a number of problems in my class (e.g. I was calling
>> __getitem__()
On Wed, 30 Dec 2015 13:40:44 -0700, Ian Kelly wrote:
> On Wed, Dec 30, 2015 at 9:58 AM, Charles T. Smith
>> The problem is that then triggers the __getitem__() method and I don't
>> know how to get to the attributes without triggering __getattr__().
>>
>> It
On Wed, 30 Dec 2015 22:54:44 +, Charles T. Smith wrote:
> But I concede I must be doing something fundamentally wrong because this
> assert is triggering:
> def __getattr__ (self, name):
> print "attrdict:av:__getattr__: entered for ", name
> ass
On Thu, 31 Dec 2015 10:13:53 +1100, Ben Finney wrote:
> "Charles T. Smith" writes:
>
>> I don't understand this distinction between an "attribute" and a "dict
>> item".
>
> When did you most recently work through the Python tutorial
&
On Thu, 31 Dec 2015 10:58:17 +1100, Steven D'Aprano wrote:
(some very good information)
Thank you.
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 31 Dec 2015 10:50:53 +1100, Steven D'Aprano wrote:
> I'm not sure what distinction you're referring to, can you explain?
Ian Kelly had said:
>> How precisely are you trying to store these: as an attribute, or as a
>> dict item? If it's supposed to be in the dict, then why is your
>> __ge
On Thu, 31 Dec 2015 11:21:59 +1100, Ben Finney wrote:
> Steven D'Aprano writes:
>
>> On Thu, 31 Dec 2015 10:13 am, Ben Finney wrote:
>>
>> > You may be familiar with other languages where the distinction
>> > between “attribute of an object” is not distinct from “item in a
>> > dictionary”. Pyth
On Wed, 30 Dec 2015 17:31:11 -0700, Ian Kelly wrote:
>> In any case, I thought that class attributes were, in fact, items of
>> __dict__?
>
> That's correct, but as I said in my previous message, self.attrs and
> self.attrs.__dict__ are two different dicts, and you're confusing one
> for the othe
On Thu, 31 Dec 2015 12:12:43 +, Oscar Benjamin wrote:
> When you write x.attr the name 'attr' is looked up on the object x. This
> calls x.__getattribute__('attr'). In turn this checks the dict
> associated with the object x i.e. x.__dict__['attr']. This in turn calls
> x.__dict__.__getitem__
while ($str != $tail) {
$str ~= s/^(head-pattern)//;
use ($1);
}
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 15 Jan 2016 11:42:24 +0100, Wolfgang Maier wrote:
> On 15.01.2016 10:43, Peter Otten wrote:
>> Charles T. Smith wrote:
>>
>>> while ($str != $tail) {
>>> $str ~= s/^(head-pattern)//;
>>> use ($1);
>>> }
>>
>
On Fri, 15 Jan 2016 11:04:32 +, Charles T. Smith wrote:
> capability, somehow, but that was apparently overlooked. For example,
> by storing string state in the match object and having a *sub* method without
> a string parameter.
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 15 Jan 2016 14:20:17 +0100, Wolfgang Maier wrote:
> pattern = pattern_str.compile()
> try:
> matches = pattern.findall(some_str, endpos=some_str.index(tail))
> except ValueError:
> # do something if tail is not found
> pass
Oh! I think that's it!
matches = findall (patte
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type(0) is int
True
...
(PDB)type(0) is int
False
(PDB)type(1) is int
False
(PDB)p 5 + 0
5
(PDB)class c (object): pass
(PDB)type (c()) is c
T
On Tue, 19 Jan 2016 03:19:59 +1100, Chris Angelico wrote:
> On Tue, Jan 19, 2016 at 3:11 AM, Charles T. Smith
> wrote:
>> $ python
>> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2
>> Type "help", "copyright", "credits&quo
What does "from (module) import (func)" do?
Please don't tell me that I shouldn't ask because real programmers
know not to have circular dependencies ...
I have no idea what was imported before. I just want to import hexdump().
Unfortunately, this does not work:
from utilities import hexdump
On Thu, 21 Jan 2016 07:52:17 -0700, Ian Kelly wrote:
>> I have no idea what was imported before. I just want to import
>> hexdump(). Unfortunately, this does not work:
>>
>> from utilities import hexdump
>>
>> ImportError: cannot import name hexdump
>
> What is utilities? Is it a module on
On Thu, 21 Jan 2016 15:31:45 +, John Gordon wrote:
> The most likely explanation here is that the 'utilities' module simply
> does not contain something named 'hexdump'.
>
> Have you inspected the 'utilities' module? Does it, in fact, contain
> something named 'hexdump'?
Yes
--
https://ma
On Thu, 21 Jan 2016 15:44:43 +, John Gordon wrote:
> How did this error come up? Did the code work previously? If so, what
> changed?
The developers of this legacy code had this as well as other functions
duplicated throughout the system, in order to avoid confronting these
issues. I'm tr
On Thu, 21 Jan 2016 15:44:43 +, John Gordon wrote:
> In that case, the problem is most likely a circular import issue, as you
> mentioned. The only way to fix it is to reorganize your modules.
>
> How did this error come up? Did the code work previously? If so, what
> changed?
What I nee
On Thu, 21 Jan 2016 08:59:39 -0700, Ian Kelly wrote:
> What happens if you just do 'import utilities'. Can you then call
> utilities.hexdump? Can you see anything in the utilities module?
Yes, that works! That's what I'm doing as a work around.
I was trying to avoid doing that because I figured
On Thu, 21 Jan 2016 16:30:30 +, Charles T. Smith wrote:
>> Side observation: 'int' is a bad name for a package, because it will
>> shadow the name of the 'int' built-in.
>
>
> Boy oh boy have I experienced that now! :)
(it wasn't me! ;)
On Fri, 22 Jan 2016 12:19:50 +0200, Marko Rauhamaa wrote:
> We need similar code sanity management. Developers are given much too
> much power to mess up the source code. That's why "legacy" is considered
> a four-letter word among developers.
When I started in this business, in the mid-70s, ther
Hey!
I have been goggling around for the last few days and tried out many python
codes.
I want to merge two csv files, say thought_probe1.csv and thought_probe2.csv. I
want them to merge column-wise in a new csv file 'new_file.csv'.
What coding is smart to use in order to achieve it?
I would r
Hey!
I want to merge column-wise two csv files, say: file1.csv and file2.csv, both
containing two columns, into a new csv file.
I could not find a good code for doing this. It never really worked.
If you could show me the code with this example, I would highly appreciate it.
Best wishes,
Tib
When might a "global" statement be used in the outermost level of a module?
(whereby, I assume a module is equivalent to a python file, correct?)
TIA for any thoughts.
cts
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 11 Mar 2016 19:29:20 +1100, Chris Angelico wrote:
> Usefully? Never.
>
> Simple question - simple answer :)
>
> ChrisA
Right, that was the expected answer as well. I just ran into that in
legacy code, checked out the documentation and couldn't really make that
out. So I figured I bet
On Fri, 11 Mar 2016 08:31:22 +, Mark Lawrence wrote:
> Never. Hopefully this
> http://www.python-course.eu/python3_global_vs_local_variables.php can
> explain it better than I can :)
The article is good, I'm glad to have confirmed what I have so empirical
stumbled over.
... Irrespective of t
>From the performance point of view, which is better:
- hasattr()
- x in y
TIA
cts
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 11 Mar 2016 21:44:27 +, Charles T. Smith wrote:
> From the performance point of view, which is better: - hasattr()
> - x in y
>
> TIA
> cts
I just realized that "in" won't look back through the class hierarchy...
that clearly makes them not interc
On Fri, 11 Mar 2016 22:00:41 +, Grant Edwards wrote:
> Since they behave differently, perhaps the question ought to be "which
> does what you want to do?"
For parsed msgs, I had this:
elif hasattr (msg.msgBody, 'request'):
It occurred to me that this was less abstruse:
I've really learned to love working with python, but it's too soon
to pack perl away. I was amazed at how long a simple file search took
so I ran some statistics:
$ time python find-rel.py
./find-relreq *.out | sort -u
TestCase_F_00_P
TestCase_F_00_S
TestCase_F_01_S
TestCa
On Thu, 17 Mar 2016 18:34:06 +0200, Marko Rauhamaa wrote:
> n-vs-perl-performance
Okay, that was interesting.
Actually, I saw a study some years ago that concluded that python
could be both slower and faster than perl, but that perl had much
less deviation than python. I took that and accepted
On Thu, 17 Mar 2016 17:47:55 +0200, Marko Rauhamaa wrote:
> Can't comment on the numbers but the code segments are not quite
> analogous. What about this one:
>
> #!/usr/bin/env python
> # vim: tw=0
> import sys
> import re
>
> isready = re.compile("(.*) is ready")
> for
On Thu, 17 Mar 2016 09:21:51 -0700, Ethan Furman wrote:
>> well, I don't want to forgo REs in order to have python's numbers be
>> better
>
> The issue is not avoiding REs, but using Python's strengths and idioms.
> Write the code in Python's style, get the same results, then compare
> t
On Thu, 17 Mar 2016 17:48:54 +0200, Marko Rauhamaa wrote:
> "Charles T. Smith" :
>
>> On Thu, 17 Mar 2016 15:29:47 +, Charles T. Smith wrote:
>>
>> And for completeness, and also surprising:
>>
>> time sed -n -e '/ is ready
On Thu, 17 Mar 2016 18:07:12 +0200, Marko Rauhamaa wrote:
> "Charles T. Smith" :
> Ok. The LANG=C setting has a tremendous effect on the performance of
> textutils.
>
>
> Marko
Good to know, thank you...
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 17 Mar 2016 10:26:12 -0700, Ethan Furman wrote:
> On 03/17/2016 09:36 AM, Charles T. Smith wrote:
>
>> Yes, your point was to forgo REs despite that they are useful.
>> I could have thought the search would have been better as:
>>
>> 'release[
On Thu, 17 Mar 2016 18:30:29 +0200, Marko Rauhamaa wrote:
> "Charles T. Smith" :
>
>> I need the second check to also be a RE because it's not
>> separate tokens.
>
> The string "in" check doesn't care about tokens.
>
>
> Marko
On Thu, 17 Mar 2016 10:52:30 -0500, Tim Chase wrote:
>> Not saying this will make a great deal of difference, but these two
> items jumped out at me. I'd even be tempted to just use string
> manipulations for the isready aspect as well. Something like
> (untested)
well, I don't want to forgo RE
On Thu, 17 Mar 2016 19:08:58 +0200, Marko Rauhamaa wrote:
> "Charles T. Smith" :
>
>
> Compare Perl (http://www.perlmonks.org/?node_id=98357>):
>
>my $str = "I have a dream";
>my $find = "have";
>my $replace = "h
On Thu, 17 Mar 2016 15:29:47 +, Charles T. Smith wrote:
And for completeness, and also surprising:
time sed -n -e '/ is ready/{s///;h}' -e '/release_req/{g;p}' *.out | sort -u
TestCase_F_00_P
TestCase_F_00_S
TestCase_F_01_S
TestCase_F_02_M
real0m10.998s
u
On Thu, 17 Mar 2016 21:18:43 +0530, srinivas devaki wrote:
> please upload the log file,
Sorry, it's work stuff, can't do that, but just take any big set of files
and change the strings appropriately and the numbers should be equivalent.
>
> and global variables in python are slow, so just ke
Op 21-03-16 om 17:51 schreef Adam:
"Adam" wrote in message
news:ncikss$tks$1...@news.albasani.net...
Host OS:Ubuntu Desktop 14.04 LTS / Unity
System crashed while using PyCharm / Python3.
Booting takes forever and stuck at the purple screen with
the Ubuntu logo and the five dots cycling.
Now, I'm getting these errors:
ImportError: cannot import name ...
and
AttributeError: 'module' object has no attribute ...
(what is 'module'?)
Is there a way to resolve this without having to restructure my code
every couple of days?
I thought using imports of the form:
from module i
On Sun, 16 Nov 2014 08:14:05 +0100, dieter wrote:
> "Charles T. Smith" writes:
>> Now, I'm getting these errors:
>>
>> ImportError: cannot import name ...
>>
>> and
>>
>> AttributeError: 'module' object has no attrib
On Mon, 17 Nov 2014 08:08:40 +0100, dieter wrote:
> "Charles T. Smith" writes:
>> ...
>> Are others equally frustrated by this or is there a trick or principle
>> that I'm missing. At this point, I guess the way I'll have to proceed
>> is to put e
On Tue, 18 Nov 2014 00:00:42 -0700, Michael Torrie wrote:
> On 11/17/2014 03:45 PM, Steven D'Aprano wrote:
>
>> Circular dependencies are not just a problem in Python, they are a
>> problem throughout most of software design.
>
> Personally I find that duck typing eliminates a lot of the circula
I'm looking to just have a simple program that will do a SQLite query pull
a random record and then copy that record too the clipboard the system. I'm
not quite seeing how to do this perhaps this is already been done elsewhere
but I spent quite a bit of time trying to figure out how to do that and
People are naturally competitive. People naturally don't like to hear the
word know. People love to get what they want. Combine all of these things
together and you have all of the elements necessary to eventually create
another conflict. Just because it doesn't happen immediately doesn't mean
it's
I am maintaining some old code where the programmer used 1 for True because
booleans hadn't been added to Python yet. I'm getting some weird behaviour, so
I created some simple tests to illustrate my issue.
>>> 1 in {1:1}#test1
True
>>> 1 in {1:1} == 1 #test2
False
>>> (1 in {1:1}) ==
On Wednesday, September 16, 2015 at 8:54:07 AM UTC-4, Jussi Piitulainen wrote:
> The second test, test2, is interpreted (almost) as
>
> (1 in {1:1}) and ({1:1} == 1)
>
> which is obviously False.
Ah, that makes sense. It didn't occur to me that Python would interpret it
that way, and I'
On Wednesday, September 16, 2015 at 9:08:54 AM UTC-4, jmp wrote:
> x = 5
> 3 < x < 10
That's a great example. I use this case all the time and didn't think to apply
the same principal to the in/== case. I assumed that "in" was evaluated first,
and then the == comparison was made. Thanks!
--
On Mon, 03 Oct 2011 10:09:59 -0700, sillyou su wrote:
> 啊!!
>
> I should use 127.0.0.1 instance of 0.0.0.0
Theoretically either one should be fine. If you use 127.0.0.1 it will
only expose the service to your local machine. If you use 0.0.0.0 ut will
expose the service to other computers on t
On 12/1/11 4:53 AM, Mark wrote:
Hi there,
I'm a complete beginner to Python and, aside from HTML and CSS, to coding in
general. I've spent a few hours on it and think I understand most of the syntax.
However, I'm wondering a bit about For Loops. I know that the basic syntax for
them is to def
Basically, I'm thinking about building a robot which can be controlled by
programs which I write, I'm going to interface to the robot through the
parallel port (like in this tutorial here:
linuxfocus.org/English/May2001/article205.shtml). However, I know that this
will probably need to be done in l
Heiko Wundram wrote:
> Maybe it's what you're looking for.
Thanks for that. I've never actually built a robot or anything like that
before, so I'm welcome to any advice I can get! I've heard programming via
USB is hard, so that's why I'm using the parallel port (serial ports are
said to be slow wh
Johhny wrote:
> Any advice would be great.
Have you had a look at Python's re module? If you've not, I suggest you do
so - it contains all of Python's regex tools which you'll need.
Regards,
--
Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for everyone's tips and hints. I WILL MAKE THIS WORK! I think I'll
take your advice and use the serial port instead of the parallel port - I
won't have that much data to send (in comparison with, for example,
industrial level applications). As for on-board chips though, does this
require low
linuxfreak wrote:
> Was wanting to write a text based application in python seems
> curses module is the way to go... anyone knows of any good tutorials
> apart from the one written by esr
Not off the top of my head, no. However, you will find that the functions
needed will be very similar to
Thanks - now I just have to convince my parents that I should be allowed to
etch circuit boards in my room :-) .
Thanks again.
Regards,
Isaac
--
http://mail.python.org/mailman/listinfo/python-list
I created a new Python T-shirt:
http://www.cafepress.com/import_re
I have been looking for this shirt ever since I fell
in love with the slogan a few years ago. I gave up
looking and decided to fumble through Photoshop for
many hours to make my own.
>From today through February 14th, $1.00 f
I want to save some sensitive data (passwords, PIN numbers, etc.) to
disk in a secure manner in one of my programs. What is the
easiest/best way to accomplish strong file encryption in Python? Any
modern block cipher will do: AES, Blowfish, etc. I'm not looking for
public key stuff; I just want
Some Other Guy <[EMAIL PROTECTED]> wrote:
> vdicarlo wrote:
>> I am a programming amateur and a Python newbie who needs to convert
>> about 100,000,000 strings of the form "1999-12-30" into ordinal dates
>> for sorting, comparison, and calculations. Though my script does a ton
>> of heavy calculati
Paul D Ainsworth <[EMAIL PROTECTED]> wrote:
> Greetings everyone. I'm a relative newcomer to python and I have a technical
> problem.
> I want to split a 32 bit / 4 byte unsigned integer into 4 separate byte
> variables according to the following logic: -
> bit numbers 0..7 byte 1
> bit numbers
manatlan <[EMAIL PROTECTED]> wrote:
> I was a fan of "SimpleGladeApp/tepache way" to build a pygtk app.
> I've build a new efficient/dynamic way to build a pygtk app ...
> Here is an example :
> =
> class Fen(GladeApp):
>"""
>Window win
>
[EMAIL PROTECTED] wrote:
> On May 11, 10:16 pm, Paul McGuire <[EMAIL PROTECTED]> wrote:
>> On May 11, 9:41 pm, [EMAIL PROTECTED] wrote:
[... much ellided ...]
["ellided" is a fancy word for "left out" or "replaced
with ellipses."]
> I was looking around in my Python folder and
Karlo Lozovina <[EMAIL PROTECTED]> wrote:
> manatlan wrote:
>> I can't find the trick, but i'm pretty sure it's possible in an easy
>> way.
> It's somewhat easy, boot looks ugly to me. Maybe someone has a more
> elegant solution:
> In [6]: import new
> In [13]: class Button:
>: def
Ross Boylan <[EMAIL PROTECTED]> wrote:
> I would like my different threads to log without stepping on each
> other.
> Past advice on this list (that I've found) mostly says to send the
> messages to a Queue. That would work, but bypasses the logging
> module's facilities.
> The logging module it
tereglow <[EMAIL PROTECTED]> wrote:
> Hello,
> I am a complete newbie to Python and am accustomed to coding in PHP/
> Perl/Shell. I am trying to do the following:
> I have a string:
> cpuSpeed = 'Speed: 10'
> What I would like to do is extract the '10' from the string,
> and di
Richard Rossel <[EMAIL PROTECTED]> wrote:
> Hi Fellows,
> I have a problem with process termination. I have a python code that
> apache runs through a django interface.
> The code is very simple, first, it creates a process with the
> subprocess.Popen call, and afterwards, (using a web request) the
Robert Bauck Hamar <[EMAIL PROTECTED]> wrote:
> Jerry Hill wrote:
>> On 6/15/07, HMS Surprise <[EMAIL PROTECTED]> wrote:
>>> I want to print a count down timer on the same line. I tried
>>> print '\r', timeLeft,
>>> which just appends to the same line.
>> Sounds to me like whatever you're p
George Sakkis <[EMAIL PROTECTED]> wrote:
> On May 15, 5:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
>> George Sakkis <[EMAIL PROTECTED]> wrote:
>>> I'm trying to figure out why Popen captures the stderr of a specific
>>> command when it runs through the shell but not without it. IOW:
>>>
Hamilton, William <[EMAIL PROTECTED]> wrote:
>> From: Beliavsky
> On May 15, 1:30 am, Anthony Irwin <[EMAIL PROTECTED]> wrote:
>>
>>> #5 someone said that they used to use python but stopped because the
>>> language changed or made stuff depreciated (I can fully remember
>>> which) and old code
On Apr 18, 8:55 pm, Dan Stromberg <[EMAIL PROTECTED]> wrote:
> Are there any open source search engines written in python for indexing a
> given collection of (internal only) html pages? Right now I'm talking
> about dozens, but hopefully it'll be hundreds or thousands at some point.
>
> I'm think
Want to show off your programming skills? Your favorite programming
language?
Your best programming tools?
Join the ICFP Programming Contest 2007! The 10th ICFP Programming
Contest
celebrates a decade of contests. This is one of the world's most
advanced and prestiguous programming contest you can
re:
!>>>Top posting
!>> Did not. I replied to the message at the bottom of the thread.
!> Congratulations, you've now made a fool of yourself in public.
OK, cut it out.
Top or bottom posting is a user choice.
No need to flame someone for using either.
Juan T. Llibre,
On May 4, 8:53 am, redcic <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've just downloaded scipy v 0.5.2 and I would like to be able to draw
> plots. I've tried:
> import scipy.gplt
> import scipy.plt
> import scipy.xplt
>
> and none of them work. Are these modules still included in scipy ? If
> not,
Tonight I discovered something odd in the __doc__ for tempfile
as shipped with Python 2.4.4 and 2.5: it says:
This module also provides some data items to the user:
TMP_MAX - maximum number of names that will be tried before
giving up.
templat
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Wed, 09 May 2007 06:50:38 -, "James T. Dennis"
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>> In fact I realized, after reading through tempfile.py in /usr/lib/...
>> that th
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, James T. Dennis wrote:
>> Tonight I discovered something odd in the __doc__ for tempfile
>> as shipped with Python 2.4.4 and 2.5: it says:
>>
>> This
Marc Christiansen <[EMAIL PROTECTED]> wrote:
> James T. Dennis <[EMAIL PROTECTED]> scribis:
>> In fact I realized, after reading through tempfile.py in /usr/lib/...
>> that the following also doesn't "work" like I'd expect:
>># foo.py
I've been thinking about the Python mmap module quite a bit
during the last couple of days. Sadly most of it has just been
thinking ... and reading pages from Google searches ... and
very little of it as been coding.
Mostly it's just academic curiosity (I might be teaching an "overview
of
johnny <[EMAIL PROTECTED]> wrote:
> I need to get the content inside the bracket.
> eg. some characters before bracket (3.12345).
> I need to get whatever inside the (), in this case 3.12345.
> How do you do this with python regular expression?
I'm going to presume that you mean something like:
[EMAIL PROTECTED] wrote:
> I'm writing a driver in Python for an old fashioned piece of serial
> equipment. Currently I'm using the USPP serial module. From what I can
> see all the serial modules seem to set the timeout when you open a
> serial port. This is not what I want to do. I need to change
Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> Hi,
>I would like to track the cpu usage of a couple of
>programs using python. Maybe it works somehow with
>piping 'top' to python read the cpu load for a greped
>application and clocking the the first and last
>appearence. Is t
please let me know.
> I will ignore the "server" part...
>> Here is the code that I am using (it runs exactly the same as the linux
>> app
>> 'arcgen').
>> [...]
>> t = i-1
>> filename=string.replace(filename,".-%s&quo
You'd think that using things like gettext would be easy. Superficially
it seems well documented in the Library Reference(*). However, it can
be surprisingly difficult to get the external details right.
* http://docs.python.org/lib/node738.html
Here's what I finally came up with a
James T. Dennis <[EMAIL PROTECTED]> wrote:
... just to follow-up my own posting --- as gauche as that is:
> You'd think that using things like gettext would be easy. Superficially
> it seems well documented in the Library Reference(*). However, it can
> be surprisingly
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> walterbyrd a ?crit :
>> With PHP, libraries, apps, etc. to do basic CRUD are everywhere. Ajax
>> and non-Ajax solutions abound.
>> With Python, finding such library, or apps. seems to be much more
>> difficult to find.
>> I thought django might be
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On May 16, 12:38 pm, Krypto <[EMAIL PROTECTED]> wrote:
>> I have been using python shell to test small parts of the big program.
>> What other ways can I use the shell effectively. My mentor told me
>> that you can virtually do anything from testing yo
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> HMS Surprise a ?crit :
>> Trying not to be a whiner but I sure have trouble finding syntax in
>> the reference material. I want to know about list operations such as
>> append.
> The only thing you have to know is that it doesn't exists. Python
>
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
...
> Python does NOT support pass by reference. Nor does it do pass by value.
> Both of those models might describe what other languages do, but they
> don't describe what Python does.
> Python's passing model is different from both pass by reference
Duncan Booth <[EMAIL PROTECTED]> wrote:
> lazy <[EMAIL PROTECTED]> wrote:
>> I want to pass a string by reference. I understand that strings are
>> immutable, but Im not
>> going to change the string in the function, just to aviod the overhead
>> of copying(when pass-by-value) because the
>> strin
301 - 400 of 439 matches
Mail list logo