On 09/05/2012 11:34 AM, Chris Angelico wrote:
> On Thu, Sep 6, 2012 at 1:22 AM, Ian Kelly wrote:
>> The lack of an ORDER BY is the least of the problems with that SQL.
>> He's also using LIMIT without OFFSET, so the only thing that the
>> 'item' argument changes is how many rows are returned (all
On 09/05/2012 12:47 PM, Hans Mulder wrote:
> On 5/09/12 17:09:30, Dave Angel wrote:
>> But by claiming that id() really means address, and that those addresses
>> might move during the lifetime of an object, then the fact that the id()
>> functions are not called simultaneo
On 09/05/2012 01:47 PM, Grant Edwards wrote:
> On 2012-09-05, Terry Reedy wrote:
>> On 9/4/2012 11:22 PM, Ramchandra Apte wrote:
>>
>>> I was actually planning to write a bug on this.
>> If you do, find the right place to submit it.
>> bugs.python.org is for issues relating to the cpython reposito
On 09/05/2012 02:27 PM, Terry Reedy wrote:
> On 9/5/2012 8:48 AM, Ramchandra Apte wrote:
>
>> Seeing this thread, I think the is statment should be removed.
>> It has a replacement syntax of id(x) == id(y)
>
> The thread is wrong then.
>
> If the implementation reuses ids, which CPython does,
> is
On 09/06/2012 04:33 AM, Steven D'Aprano wrote:
>
>
> I may have been overly-conservative earlier when I said that on
> average string equality has to compare half the characters. I thought
> I had remembered that from a computer science textbook, but I can't
> find that reference now, so possibly
On 09/06/2012 06:45 AM, shaun wrote:
> Hi all,
>
> I have a class which I create an object from in a different script but when
> its run I get an error at the last part of this method:
>
> CODE///
>
> def databasebatchcall(self,tid, bid):
>
> con=cx_Oracle
On 09/06/2012 08:00 AM, shaun wrote:
> Hi all,
>
> So I'm trying to to OO a script which is currently in place on work. It
> connects to the database and makes multiple strings and sends them to a
> server.
>
> But I'm having major problems since I am new to python I keep trying to do it
> as I
On 09/06/2012 09:34 AM, Ramchandra Apte wrote:
> Translator means what precisely?
Examples of translators include compilers, assemblers, and
interpreters. They also include implementations like cfront, which
translates from one high-level language to another lower-level
language. (high and low b
On 09/06/2012 09:43 AM, Johannes Bauer wrote:
>
> Yes, worst-case is O(N), best case O(1). Average is O(n log n).
Can't see how you came up with an average of n log(n). Fourteen minutes
before you made this post, you demonstrated it was less than 2 for any N.
And I previously posted that for a
On 09/06/2012 09:53 AM, Ramchandra Apte wrote:
> On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel wrote:
>> On 09/06/2012 09:34 AM, Ramchandra Apte wrote:
>>
>>> Translator means what precisely?
>>
>>
>> Examples of translators include com
On 09/06/2012 10:42 AM, Johannes Bauer wrote:
> On 06.09.2012 16:23, Dave Angel wrote:
>> On 09/06/2012 09:43 AM, Johannes Bauer wrote:
>>>
>>> Yes, worst-case is O(N), best case O(1). Average is O(n log n).
>> Can't see how you came up with an average of n l
On 09/06/2012 01:59 PM, tinn...@isbd.co.uk wrote:
> I want to print a series of list elements some of which may not exist,
> e.g. I have a line:-
>
> print day, fld[1], balance, fld[2]
>
> fld[2] doesn't always exist (fld is the result of a split) so the
> print fails when it isn't set.
>
> I
On 09/06/2012 03:27 PM, John Nagle wrote:
> In Python 2.7:
>
>I want to parse standard ISO date/time strings such as
>
> 2012-09-09T18:00:00-07:00
>
> into Python "datetime" objects. The "datetime" object offers
> an output method , datetimeobj.isoformat(), but not an input
> parser. Th
On 09/06/2012 04:33 PM, Dennis Lee Bieber wrote:
>
> Note that this difference mainly applies to how the processes are
> themselves are created... How the library wraps shared data is
> possibly different (I've never understood how a "fork" process can
> avoid memory conflicts if it has write acc
On 09/06/2012 08:55 PM, ruck wrote:
> (This with Python 2.7.2 on Windows 7)
>
> os.stat() won't recognize a filename ending in period.
> It will ignore trailing periods.
> If you ask it about file 'goo...' it will report on file 'goo'
> And if 'goo' doesn't exist, os.stat will complain.
>
> creat
On 09/06/2012 08:01 PM, jimbo1qaz wrote:
> Is it faster to use bitshifts or floor division?
Yes, and yes. Without doing any measurement, I'd expect that in
CPython, it makes negligible performance difference for ordinary ints
(under 2**31, more or less). Ordinary ints can be done with single
inst
On 09/06/2012 09:30 PM, jimbo1qaz wrote:
> On Thursday, September 6, 2012 5:01:12 PM UTC-7, jimbo1qaz wrote:
>> Is it faster to use bitshifts or floor division? And which is better, & or %?
>>
>> All divisors and mods are power of 2, so are binary operations faster? And
>> are they considered bad
On 09/07/2012 09:42 AM, M Whitman wrote:
> Good Morning,
>
> I have been recently trying to define all of the features in a list but have
> been running into errors.
How proficient are you in Python? Could you possibly use terms which
make sense to someone who doesn't know this arcGIS program?
On 09/07/2012 11:21 AM, M Whitman wrote:
> Dave- By features I was refering to items in the list. For background the
> arcpy module is used for geoprocessing of geographic information. I'm using
> my script to get totals for features in a dataset that I receive on a regular
> basis- for exampl
On 09/07/2012 12:59 PM, rusi wrote:
> On Sep 7, 9:32 am, Paul Rubin wrote:
>> rusi writes:
>>> On an 8086/8088 a MUL (multiply) instruction was of the order of 100
>>> clocks ... On most modern processors (after the pentium) the
>>> difference has mostly vanished. I cant find a good data sheet
On 09/07/2012 01:56 PM, Travis Griggs wrote:
> I'm relatively new to Python (coming from strong C and Smalltalk
> backgrounds). I've written a couple of relatively small apps (one or two .py
> files). I'm using PyCharm (I love it).
>
> I'm curious what the pythonic approach is to creating your ow
On 09/07/2012 01:56 PM, Travis Griggs wrote:
> I'm relatively new to Python (coming from strong C and Smalltalk
> backgrounds). I've written a couple of relatively small apps (one or two .py
> files). I'm using PyCharm (I love it).
>
> I'm curious what the pythonic approach is to creating your ow
On 09/08/2012 06:02 AM, tinn...@isbd.co.uk wrote:
> Dave Angel wrote:
>> Would you like to define "exists" ? A list is not sparse, so all items
>> exist if their subscript is less than the length of the list. So all
>> you need to do is compare 2 to len(fld).
>
On 09/08/2012 03:19 PM, David Shi wrote:
> Hi, All,
>
> Can anyone send me the link for downloading ArcPY?
>
> I came across it before, but can not find it anymore.
>
> Regards.
>
> David
>
Try this link; it looks promising.
http://www.arcgis.com/home/item.html?id=3a790cd717514f4689ae197c7920580
See the identical thread you posted on tutor, where it was a better match.
--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list
On 09/09/2012 12:04 PM, hamilton wrote:
> On 9/9/2012 6:39 AM, Dave Angel wrote:
>> See the identical thread you posted on tutor, where it was a better
>> match.
>>
>>
>>
> Would you please post that link for those of us that did not see that
> one.
>
&
On 09/11/2012 03:13 PM, ruck wrote:
>
>
> I'm not sure how I could have known that ntpath was already imported, since
> *I* didn't import it, but that was the key to my confusion.
>
import sys
print sys.modules
--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list
On 09/12/2012 11:26 AM, janis.judvai...@gmail.com wrote:
> Hi, and I'm sorry for using this old thread, but I'm experiencing the same
> problem, except, that I wan't to execute any shell script or exe without
> blank terminal window.
> Is there any way in python to supress blank console screen w
On 09/12/2012 12:56 PM, Jabba Laci wrote:
> Thanks for the answers. I decided to use numbers in the name of the
> functions to facilitate function calls. Now if you have this menu
> option for instance:
>
> (5) install mc
>
> You can type just "5" as user input and step_5() is called
> automaticall
On 09/16/2012 07:56 AM, Νικόλαος Κούρας wrote:
> Τη Κυριακή, 16 Σεπτεμβρίου 2012 2:34:34 μ.μ. UTC+3, ο χρήστης Steven D'Aprano
> έγραψε:
>>
>>
>> No. That's not how mailing lists work. Every email gets posted to all
>> members, unless they go onto "No Mail", in which case they get no emails
>>
On 09/16/2012 09:07 PM, Jadhav, Alok wrote:
> Hi Everyone,
>
>
>
> I have a simple program which reads a large file containing few million
> rows, parses each row (`numpy array`) and converts into an array of
> doubles (`python array`) and later writes into an `hdf5 file`. I repeat
> this loop fo
On 09/16/2012 11:25 PM, alex23 wrote:
> On Sep 17, 12:32 pm, "Jadhav, Alok"
> wrote:
>> - As you have seen, the line separator is not '\n' but its '|\n'.
>> Sometimes the data itself has '\n' characters in the middle of the line
>> and only way to find true end of the line is that previous charact
On 09/17/2012 07:47 AM, Steven D'Aprano wrote:
> On Mon, 17 Sep 2012 06:46:55 -0400, Dave Angel wrote:
>
>> On 09/16/2012 11:25 PM, alex23 wrote:
>>> def readlines(f):
>>> lines = []
>>> while "f is not empty":
>>&
On 09/17/2012 05:55 PM, Fernando Jiménez wrote:
> Hi guys!
>
> I'm noob in python and I would know how to correctly use the property. I
> have read some things about it but I do not quite understand.
>
> I found this:
>
> class C(object):
> def __init__(self):
> self._x = None
>
> @
On 09/17/2012 07:34 PM, Terry Reedy wrote:
> On 9/17/2012 6:12 PM, Chris Angelico wrote:
>> On Tue, Sep 18, 2012 at 7:55 AM, Fernando Jiménez
>> wrote:
>>> Hi guys!
>>>
>>> I'm noob in python and I would know how to correctly use the
>>> property. I
>>> have read some things about it but I do not
On 09/17/2012 09:08 PM, David Smith wrote:
> Hello, I'm essentially a newbie in Python.
> My problem in searching the archives is not knowing what words to use
> to ask.
>
> I'm converting windows bat files little by little to Python 3 as I
> find time and learn Python.
> The most efficient method
On 09/18/2012 01:08 AM, Terry Reedy wrote:
> On 9/17/2012 9:08 PM, David Smith wrote:
>> Hello, I'm essentially a newbie in Python.
>> My problem in searching the archives is not knowing what words to use to
>> ask.
>>
>> I'm converting windows bat files little by little to Python 3 as I find
>> ti
On 09/18/2012 08:47 PM, Nathan Spicer wrote:
> -- Forwarded message --
> From: Nathan Spicer
> Date: Tue, Sep 18, 2012 at 8:32 PM
> Subject: Programming Issues
> To: webmas...@python.org
>
>
> Hello,
>
> My name is Nathan Spicer. I'm taking a computer programming class using
> pyth
On 09/19/2012 06:24 AM, Pierre Tardy wrote:
> One thing that is cooler with java-script than in python is that dictionaries
> and objects are the same thing. It allows browsing of complex hierarchical
> data syntactically easy.
You probably need some different terminology, since a dictionary is
On 09/19/2012 08:28 AM, Dan Katorza wrote:
> בתאריך יום רביעי, 19 בספטמבר 2012 12:11:04 UTC+3, מאת Dan Katorza:
>>
>> hi, ll like
>> found a solution,
>> it's not quite like Chris advised but it works.
Not at all like Chris advised. But it also doesn't help you understand
programming. Two conce
On 09/19/2012 07:01 PM, Nathan Spicer wrote:
> Dave,
>
You sent this response privately, which isn't the way the mailing list
works. Private responses are good for thank-yous and for personal
remarks of no interest to others. But you're short-circuiting the
helping process if you don't let ever
On 09/20/2012 06:04 PM, Jason Swails wrote:
> On Thu, Sep 20, 2012 at 5:06 PM, Gelonida N wrote:
>
>> I'd like to implement the equivalent functionality of the unix command
>> /usr/bin/which
>>
>> The function should work under Linux and under windows.
>>
>> Did anybody already implement such a fu
On 09/21/2012 09:36 AM, echo.hp...@gmail.com wrote:
> may i know how to shift the bits using only looping and branching??
Yes, show us your code, and what isn't working, and we'll try to help
you complete the assignment. It'd probably also be good to specify the
rest of the homework, like what ve
On 09/21/2012 11:54 AM, Steven D'Aprano wrote:
> On Fri, 21 Sep 2012 14:50:36 +0100, Mark Lawrence wrote:
>
>> On 21/09/2012 14:13, xliiv wrote:
>>> Why is this '2 years release cycle'?
>>>
>>>
>> Because there aren't enough volunteers to get it done any faster?
> Because if it were any faster, it
On 09/21/2012 12:01 PM, Alister wrote:
> On Fri, 21 Sep 2012 15:14:53 +, Grant Edwards wrote:
>
>> On 2012-09-21, mikcec82 wrote:
>>> Hallo to all,
>>>
>>> I'm using Python 2.7.3 with Windows 7 @ 64 bit and an Intel Core i3
>>> -2350M CPU @2.30GHz 2.3GHz.
>>>
>>> Sometimes, when I'm programmin
On 09/22/2012 06:53 AM, Alister wrote:
> On Fri, 21 Sep 2012 18:47:57 -0400, Dave Angel wrote:
>
>>
>>
>> That's not true at all. You'd re thinking of Windows 3, Windows 95, 98,
>> and ME, which were hacked on top of MSDOS. But Windows NT3.5, 4, 2000,
>
On 09/22/2012 05:05 PM, Tim Roberts wrote:
> Dennis Lee Bieber wrote:
>> On 22 Sep 2012 01:36:59 GMT, Steven D'Aprano wrote:
>>> For non IEEE 754 floating point systems, there is no telling how bad the
>>> implementation could be :(
>> Let's see what can be found...
>>
>> IBM 360: Same
On 09/23/2012 05:44 PM, jimbo1qaz wrote:
> On Sunday, September 23, 2012 2:31:48 PM UTC-7, jimbo1qaz wrote:
>> I have a nested list. Whenever I make a copy of the list, changes in one
>> affect the other, even when I use list(orig) or even copy the sublists one
>> by one. I have to manually copy
On 09/24/2012 05:35 PM, zipher wrote:
> For some time now, I've wanted to suggest a better abstraction for the
> type in Python. It currently uses an antiquated C-style interface for moving
> around in a file, with methods like tell() and seek(). But after attributes
> were introduced to Pyth
(forwarding to the list)
On 09/24/2012 06:23 PM, Mark Adam wrote:
> On Mon, Sep 24, 2012 at 4:49 PM, Dave Angel wrote:
>> On 09/24/2012 05:35 PM, zipher wrote:
>>> For some time now, I've wanted to suggest a better abstraction for the
>>> type in Python. I
On 09/24/2012 05:59 PM, MrsEntity wrote:
> Hi all,
>
> I'm working on some code that parses a 500kb, 2M line file
Just curious; which is it, two million lines, or half a million bytes?
> line by line and saves, per line, some derived strings into various data
> structures. I thus expect that m
On 09/25/2012 12:21 AM, Junkshops wrote:
>> Just curious; which is it, two million lines, or half a million bytes?
>
> Sorry, that should've been a 500Mb, 2M line file.
>
>> which machine is 2gb, the Windows machine, or the VM?
> VM. Winders is 4gb.
>
>> ...but I would point out that just beca
front of the quoted portions. This next
section is by me, but you don't say so. That's because you copy/pasted
it from elsewhere in the reply, and didn't copy the "... Dave Angel
wrote" part.
Much easier is to take the reply, and remove the parts you're not going
to re
On 09/26/2012 08:31 PM, alex23 wrote:
> On Sep 27, 5:19 am, php...@gmail.com wrote:
>> http://bin.x.yyy/p.zip
>>
>> by WatchMan
> Context? Description? Virus propagation?
Why would you propagate that link? When I saw the original, I just
deleted it immediately from the local folder.
On 09/29/2012 08:23 AM, Amit Saha wrote:
> On Sat, Sep 29, 2012 at 10:18 PM, Georg Brandl wrote:
>>
>>
>> For a more extensive list of changes in 3.3.0, see
>>
>> http://docs.python.org/3.3/whatsnew/3.3.html
> Redirects to http://docs.python.org/py3k/whatsnew/3.3.html: 404 Not Found.
>
>
Wor
On 09/29/2012 10:19 AM, Alexis Lopez-Garcia wrote:
> Hi.
>
> I installed Python3.3.0 with python-3.3.0.amd64.msi on a win7 machine.
>
> While using this funcion (see below) from a script called by double
> clicking on the .py file I get a "invalid variable "right" referenced
> before assignment" er
On 09/29/2012 09:27 PM, Kevin Anthony wrote:
> I have a list of filenames, and i need to find files with the same
> name, different extensions, and split that into tuples. does anyone have
> any suggestions on an easy way to do this that isn't O(n^2)?
>
>
Sure, collect them in a collections.defau
On 09/30/2012 08:11 PM, Jason Friedman wrote:
First comment: I don't know anything about an "environment file." An
environment is an attribute of a process, and it's inherited by
subprocesses that process launches. This is not a Python thing, it's an
OS thing, for whatever OS you're running.
>
On 09/30/2012 08:35 PM, Peter Farrell wrote:
You top-posted, which means there's no context; the message is now out
of order. Please put your responses after the parts you're quoting, or
don't bother quoting.
> Thanks for trying to help, everybody. Sorry I didn't post the whole error
> message
On 09/30/2012 09:35 PM, Peter Farrell wrote:
> On Sunday, September 30, 2012 6:25:29 PM UTC-7, Steven D'Aprano wrote:
>> On Sun, 30 Sep 2012 17:35:02 -0700, Peter Farrell wrote:
>>
>>
>>
>>> Thanks for trying to help, everybody. Sorry I didn't post the whole
>>> error message. Now my problem is I j
On 09/30/2012 11:06 PM, Edward Diener wrote:
> On 9/30/2012 3:38 PM, Andrew Berg wrote:
>> On 2012.09.30 14:14, Edward Diener wrote:
>>> The situation is so confusing on Windows, where the file associations,
>>> registry entries, and other internal software which allows a given
>>> Python release t
On 10/02/2012 04:43 AM, subhabangal...@gmail.com wrote:
> Dear Group,
>
> I am using Python on Windows 7 SP-1 (64 bit).
>
> I have two versions of Python installed 2.7 and 3.2.
>
> I want to install networkx in both.
>
> How may I do that?
>
> If any one may kindly let me know.
>
Doing a search fo
On 10/02/2012 10:03 PM, contro opinion wrote:
> code1
def foo():
> ... a = 1
> ... def bar():
> ... b=2
> ... print a + b
> ... bar()
> ...
> ...
foo()
> 3
>
> code2
def foo():
> ... a = 1
> ... def bar():
> ... b=2
> ... a = a + b
On 10/03/2012 01:54 AM, Demian Brecht wrote:
> On 12-10-02 07:26 PM, Dave Angel wrote:
>>
>> if you're stuck with Python2.x, you can use a mutable object for a, and
>> mutate it, rather than replace it. For example,
>>
>>
>> def foo():
>>
On 10/04/2012 05:29 PM, Mike wrote:
> I get below error
>
> NameError: name 'functools' is not defined
>
functools is a module in the standard library. You need to import it.
import functools
--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list
On 10/05/2012 04:51 AM, Luca Sanna wrote:
> the code is output the error of the ubuntu
>
> from bluetooth import *
>
> target_name = "My Phone"
> target_address = None
>
> nearby_devices = discover_devices()
>
> for address in nearby_devices:
> if target_name == lookup_name( address ):
>
On 10/05/2012 04:09 PM, Mike wrote:
> Terry,
>
> I am not using the mail client. I am just posting on the site.
And which site would that be (that you're using)? There are a few. I'm
guessing you use google-groups. And all of them get gatewayed to the
actual list, with differing numbers of bugs
On 10/06/2012 02:27 AM, Manuel Pégourié-Gonnard wrote:
> Hi,
>
> I was looking at the example found here [1] which begins with:
>
> [1] http://docs.python.org/py3k/library/imp.html#examples
>
> def __import__(name, globals=None, locals=None, fromlist=None):
> # Fast path: see if the module has
On 10/08/2012 10:07 AM, iMath wrote:
> To get the accurate value of 1 - 0.999 ,how to implement the
> python algorithm ?
> BTW ,Windows’s calculator get the accurate value ,anyone who knows how to
> implement it ?
Windows calculator is an application, not a programming language. Lik
On 10/08/2012 11:00 AM, Chris Angelico wrote:
> On Tue, Oct 9, 2012 at 1:48 AM, Dave Angel wrote:
>> import decimal
>> a = decimal.Decimal(4.3)
>> print(a)
>>
>> 5.0996447286321199499070644378662109375
> Ah, the delights of copy-paste :)
>
&g
On 10/08/2012 09:45 PM, Terry Reedy wrote:
> On 10/8/2012 11:13 AM, Dave Angel wrote:
>
>>> Isn't it true, though, that Python 3.3 has a completely new
>>> implementation of decimal that largely removes this disadvantage?
>
>> I wouldn't know, I'm on
On 10/09/2012 02:07 AM, Bob Martin wrote:
> in 682592 20121008 232126 "Prasad, Ramit" wrote:
>> Thomas Bach wrote:=0D=0A> Hi there,=0D=0A> =0D=0A> On Sat, Oct 06, 2012 at =
>> 03:08:38PM +, Steven D'Aprano wrote:=0D=0A> >=0D=0A> > my_tuple =3D my_=
>> tuple[:4]=0D=0A> > a,b,c,d =3D my_tuple if
On 10/09/2012 10:02 AM, loial wrote:
> I am trying to match a string that containing the "<" and ">" characters,
> using the string contains function, but it never seems to find the lines
> containing the string
>
> e.g if mystring.contains("") :
>
> Do I need to escape the characters...and if so
On 10/09/2012 10:23 AM, Dave Angel wrote:
> On 10/09/2012 10:02 AM, loial wrote:
>> I am trying to match a string that containing the "<" and ">" characters,
>> using the string contains function, but it never seems to find the lines
>> conta
On 10/09/2012 11:36 AM, Michele Simionato wrote:
> On Tuesday, October 9, 2012 5:24:17 PM UTC+2, Peter Otten wrote:
>> Seriously, you shouldn't use the main script as a library; it is put into
>>
>> the sys.modules cache under the "__main__" key. Subsequent imports under its
>>
>> real name will
On 10/10/2012 04:51 AM, Joon Ki Choi wrote:
> Hello Pythonistas,
>
> i have a very large textfile with contents like:
>
> @INBOOK{Ackermann1999-b,
> author = {Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and
> Ackermann,
> K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and A
On 10/11/2012 07:24 AM, Gisle Vanem wrote:
> Hello list. I'm a newbie when it comes to Python.
>
> I'm trying to turn this:
>
> def print_sys_path():
>i = 0
>for p in sys.path:
> print ('sys.path[%2d]: %s' % (i, p))
> i += 1
>
> into a one-line python command (in a .bat file):
>
>
On 10/11/2012 10:16 AM, Juergen Bartholomae wrote:
> Hello.
> I have quite a peculiar problem.
>
> A little overview of our situation:
> Our program enables our users to write their own python code (which they
> use extensively).
> Unfortunately, (due to us actually encouraging this in an earlier r
On 10/11/2012 09:40 AM, Gisle Vanem wrote:
> "Dave Angel" wrote:
>
>> it has nothing to do with being on a command line. You're using
>> semicolon to combine several statements, and there are restrictions on
>> what can be combined that way. One restrictio
On 10/11/2012 04:48 PM, Kevin Anthony wrote:
> I have a class that contains a list of items
> I can set items using __setitem__ but if i want to set the while list, i
> changes the variable from a myclass to a list. How can i accomblish this
> Example
C = myclass()
C[0] = 57
type(C)
On 10/12/2012 11:36 AM, Wanderer wrote:
> I'm trying to write some code that will load one of three dll depending on
> the one available. I've tried the code below, but it doesn't work. The try
> except doesn't catch the exception. Is there a way to do this?
>
> try:
> self.dl
On 10/12/2012 06:51 PM, Herman wrote:
> python -c "import os; while True: print('hello')"
> File "", line 1
> import os; while True: print('hello')
> ^
> SyntaxError: invalid syntax
See the recent thread:
"for-loop on cmd-line"
The problem has nothing to do with the com
On 10/14/2012 08:48 AM, Roy Smith wrote:
> In article <507a3365$0$6574$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>
>> Remember using PEEK and POKE commands with BASIC back in
>> 1978? Pretty much impossible in Python.
> But, trivial to implement as an extension :-)
PEEK and
On 10/15/2012 08:29 AM, Chris Rebert wrote:
> On Mon, Oct 15, 2012 at 5:12 AM, Neal Becker wrote:
>> Is there a way to specify to format I want a floating point written with no
>> more
>> than e.g., 2 digits after the decimal? I tried {:.2f}, but then I get all
>> floats written with 2 digits, e
On 10/15/2012 09:05 AM, Ulrich Eckhardt wrote:
> Hi!
>
> I need a little nudge in the right direction, as I'm misunderstanding
> something concerning string literals in Python 2 and 3. In Python 2.7,
> b'' and '' are byte strings, while u'' is a unicode literal. In Python
> 3.2, b'' is a byte strin
On 10/15/2012 09:55 AM, Debashish Saha wrote:
> how to insert random error in a programming?
I don't see how this phrase makes any sense without a lot more context.
If I add the words "I'd like to know" in front of the phrase, and
"session." at the end (and add the word "a" as appropriate), the
On 10/15/2012 12:34 PM, MRAB wrote:
> On 2012-10-15 17:22, John Gordon wrote:
>> In MRAB
>> writes:
>>
>>> > Why wasn't the message printed out?
>>>
>>> You didn't add a __str__ method:
>>
>>> class PvCamError(Exception):
>>> def __init__(self, msg):
>>> self.msg = msg
>>> def
On 10/16/2012 09:51 AM, Pradipto Banerjee wrote:
> I am trying to define class, where if I use a statement a = b, then instead
> of "a" pointing to the same instance as "b", it should point to a copy of
> "b", but I can't get it right.
>
>
The __eq__ method is called for equals comparison, like
On 10/16/2012 09:54 PM, Kevin Anthony wrote:
> I've been teaching myself list comprehension, and i've run across something
> i'm not able to convert.
>
> here's the original code for matrix multiplcation
>
> retmatrix = Matrix(self.__row,other.__col)
> for m in range(0,retmatrix.__row):
> for n
On 10/17/2012 12:43 AM, Kevin Anthony wrote:
> Is it not true that list comprehension is much faster the the for loops?
>
> If it is not the correct way of doing this, i appoligize.
> Like i said, I'm learing list comprehension.
>
(Please don't top-post; it ruins the ordering. In these forums,
On 10/17/2012 10:06 AM, rusi wrote:
> On Oct 17, 5:33 pm, Dave Angel wrote:
>> On 10/17/2012 12:43 AM, Kevin Anthony wrote:> Is it not true that list
>> comprehension is much faster the the for loops?
>>
>>> If it is not the correct way of doing this, i appolig
On 10/17/2012 10:31 AM, nwaits wrote:
> I'm very impressed with python's wordlist script for plain text. Is there a
> script for finding words that do NOT have certain diacritic marks, like acute
> or grave accents (utf-8), over the vowels?
> Thank you.
if you can construct a list of "illegal
On 10/17/2012 08:22 PM, Rita wrote:
> Hi,
>
> Currently, I use a shell script to test how my system behaves before I
> deploy an application. For instance, I check if fileA, fileB, and fileC
> exist and if they do I go and start up my application.
>
> This works great BUT
>
> I would like to use py
On 10/18/2012 02:19 AM, rusi wrote:
>
>
> IOW the robustness principle http://en.wikipedia.org/wiki/Robustness_principle
> is as good for human networking as for computers.
>
>
The catch to that is that the software that is liberally accepting
anything is quite vulnerable to attacks. Windows has
On 10/18/2012 10:10 AM, Jeff Jeffries wrote:
> Hello everybody
>
> When I set "AttributeChanges" in my example, it sets the same value for all
> other subclasses. Can someone help me with what the name of this behavior
> is (mutable class global?) ? I don't know any keywords... having
> troubl
On 10/18/2012 12:26 PM, Chris Angelico wrote:
> On Fri, Oct 19, 2012 at 3:16 AM, Evan Driscoll wrote:
>>Python isn't as bad as C++ though (my main other language), where
>>80 characters can go by *very* quickly.
>>
>> 2. Backslash continuations are *terrible*. I hate them with a firery
>>
On 10/18/2012 12:58 PM, Chris Kaynor wrote:
> On Thu, Oct 18, 2012 at 9:47 AM, Dave Angel wrote:
>
>>
>> But both C++ and Python have automatic concatenation of adjacent
>> strings. So you can just start and end each line with a quote, and
>> leave off the backs
On 10/18/2012 09:20 PM, Steven D'Aprano wrote:
> On Thu, 18 Oct 2012 12:47:48 -0400, Dave Angel wrote:
>
>> I never use the backslash at end-of-line to continue a statement to the
>> next. Not only is it a readability problem, but if your editor doesn't
>
On 10/20/2012 12:09 AM, contro opinion wrote:
> how can i use regular expression in python to change the string
> "a test of capitalizing"
> into
> "A Test Of Capitalizing"?
>
>
is that (regex) part of the assignment, or just how you assumed you'd
want to do it?
There is a str method already
On 10/21/2012 08:02 PM, Anatoli Hristov wrote:
> Hello,
>
> I need an advice about a small script I run 24/24 7/7.
>
> It's a script converted to EXE using py2exe and this script takes -
> grows 30kb RAM on each loop which means that for 10hours it grows up
> with 180mb memory. is there something I
301 - 400 of 2696 matches
Mail list logo