esigned to be economical, but the resource of concern
is not computer memory, it's the programmer's time/effort. Computer
memory gets cheaper every year. My time gets more valuable every year
(hopefully).
--
Grant Edwards grant.b.edwardsYow! The entire CHINESE
On 2013-05-13, Sharon COUKA wrote:
> Hello, I'm new to python and i have to make a Mandelbrot fractal image for
> school but I don't know how to zoom in my image.
> Thank you for helping me.
It's a fractal image, so you zoom in/out with the following Python
instruction:
"taken because I've been told how things are" kind of
>> actions, which is exactly the opposite of the point I'm trying to state.
Firstly, watch your quoting, Steve D'Aprano didn't write that despite
your claim that he did.
Secondly, if a the person who named
is the "lowest level of its existence"?
>>
>> --Ned.
>
> All You People are making this way too hard. To understand how
> questions like the OPs ought be resolved, please read:
>
> http://pvspade.com/Sartre/cookbook.html
Yea, I'
the moment, there is nothing really comparable that is a realistic
>>> candidate to replace tkinter.
>>
>> FLTK? (http://www.fltk.org/index.php)
>
> tkinter is the Python wrapper of the tk library, just as wxpython is
> the python wrapper of the wx libr
ery large on a busy network,
>> but if you can quiet other traffic, you may not need to filter at
>> all.)
>
> Or simply filter. It's not hard -- the capture filter "host
> my-printer-hostname-or-address" is enough.
Indeed. Even a simple filter can make life seve
ly
> unusable for anything remotely resembling actual screenwork.
What is "screenwork"?
--
Grant Edwards grant.b.edwardsYow! Am I elected yet?
at
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
tp://code.google.com/p/pyfestival/
http://machakux.appspot.com/blog/44003/making_speech_with_python
--
Grant Edwards grant.b.edwardsYow!
at BI-BI-BI-BI-BI-BI
gmail.com
--
http://mai
ot specific to Python.
>
> Can you show me a value of x where x == 0.0 returns False, but x actually
> isn't zero?
I'm confused. Don't all non-zero values satisfy your conditions?
>>> x = 1.0
>>> x == 0.0
False
>>> x is 0.0
Fa
'\x00\n'
> b'\x00\x0b'
>
> I mean the 2nd and 3rd should be b'\x00\x09' and b'x00\x0a'.
> Anyway, how could I get the output in the forms I want?
Well, it would help if you told us what output form you want.
--
Grant Edwards
Once again USENET proves to be an unsuitable RPC protocol for
implementing irony. :)
[OTOH, perhaps Micheal wasn't being ironic...]
--
Grant Edwards grant.b.edwardsYow! Am I having fun yet?
at
en compare whether it
> gives you the result you expect:
>
> a = json.load("file-a")
> b = json.load("file-b")
> if a == b:
> print("file-a and file-b contain the same JSON data")
>
> If what you care about is the *data* stored in the JSON fil
o MS-DOS names. God forbid that this still holds on
> more modern Microsoft operating systems?
There are no more modern Microsoft operating systems. Only more
recent ones. There are still lots of reserved filenames in recent
versions of Windows.
--
Grant Edwards grant.b.edwards
On 2013-05-27, Mok-Kong Shen wrote:
> From an int one can use to_bytes to get its individual bytes,
> but how can one reconstruct the int from the sequence of bytes?
One way is using the struct module.
--
Grant Edwards grant.b.edwardsYow! Uh-oh!! I
On 2013-05-28, Wolfgang Keller wrote:
> Actually productive work of significant intensity at a computer screen.
Oh. You mean emacs.
--
Grant Edwards grant.b.edwardsYow! Will it improve my
at CASH F
inal(n):
m = 0
for b in n.to_bytes(6, 'big'):
m = 256*m + b
return m
else:
def original(n):
--
Grant Edwards grant.b.edwardsYow! Am I having fun yet?
at
solving some particular underlying problem isn't going to go
learn a new language so that they can understand your example and
figure out what you're trying to accomplish.
2) Programming languages differ. X may be the best way to solve the
problem in one lang
On 2013-05-28, Carlos Nepomuceno wrote:
> How do you have "invalid@invalid.invalid" instead of your email address?
I have this in my .slrnrc:
set hostname "invalid.invalid"
set username "grant"
set realname "Grant Edwards"
I'm not sure why
d to keep line numbers consistent.
I was wondering whether or not to mention m4. Since m4 is (in my
mind) inextricably linked to RATFOR and sendmail config files I try
to avoid thinking about it lest the flashbacks start again...
--
Grant Edwards grant.b.edwardsYo
On 2013-05-29, Chris Angelico wrote:
> On Thu, May 30, 2013 at 12:55 AM, Grant Edwards
> wrote:
>> On 2013-05-29, Dan Stromberg wrote:
>>
>>> And in case you still want a preprocessor for Python (you likely don't need
>>> one this time), here's a
re are still too many libraries that
don't support 3.x for me to consider using 3.x for real work.
--
Grant Edwards grant.b.edwardsYow! They collapsed
at ... like nuns in the
On 2013-05-29, Terry Jan Reedy wrote:
> On 5/29/2013 3:47 PM, Grant Edwards wrote:
>> On 2013-05-29, Ma Xiaojun wrote:
[...]
>>> Unforunately, pySerial project doesn't seem to have a good state. I
>>> find pySerial + Python 3.3 broken on my machine (Python 2.7 i
ctet" when referring a
value containing 8 bits.
Only recently has it become common to assume that an "byte" contains 8
bits.
--
Grant Edwards grant.b.edwardsYow! It's a lot of fun
at being alive ... I
On 2013-06-03, Dave Angel wrote:
> On 06/03/2013 10:31 AM, Grant Edwards wrote:
>> On 2013-06-03, Dennis Lee Bieber wrote:
>>> On Sun, 02 Jun 2013 21:25:45 +0200, Mok-Kong Shen
>>> declaimed the following in
>>> gmane.comp.python.general:
>>>
>&g
On 2013-06-03, Dan Stromberg wrote:
> On Mon, Jun 3, 2013 at 7:31 AM, Grant Edwards wrote:
>
>> That's a common assumption, but historically, a "byte" was merely the
>> smallest addressable unit of memory. The size of a "byte" on widely
>
y" still Von Neumann designs
from the programmer's point of view (there's only a single address
space for both data and instructions). The fact that there are two
sparate caches is almost entirely hidden from the user. If you start
to do stuff like write self-modifying code, th
aintined a few largish pieces of software for well over
a decade, I'm fairly convinced that's true -- especially if you also
consider post-deployment maintenance (since at that point you're
usually also trying to add features at the same time you're fixing
bugs).
--
Grant Edward
solved in Linux.
> Anyone currently doing this with Python 2.7 in windows and can share
> some guidance?
http://docs.python.org/2/library/subprocess.html
--
Grant Edwards grant.b.edwardsYow! All of life is a blur
at of
On 2013-06-10, Terry Jan Reedy wrote:
> Another principle similar to 'Don't add extraneous code' is 'Don't
> rebind builtins'.
OK, we've all done it by accident (especially when starting out), but
are there people that rebind b
ed for your shopping
convenience. Other than the fact that they're pre-imported for you,
they're no different than symbols imported from any other module.
--
Grant Edwards grant.b.edwardsYow! Could I have a drug
at ov
hat is a keyword.
You can't choose a vriable name that is a keyword: the compiler won't
allow it.
"list" isn't a keyword.
--
Grant Edwards grant.b.edwardsYow! Maybe I should have
at asked for my Neutron Bomb
er long words can inadverten be cropped.
Only the first 10 characters in variable names were significant when
you wrote Pascal programs (I don't remember if that was true for
FORTRAN, but I bet it was).
--
Grant Edwards grant.b.edwardsYow! I'm gliding over a
year ):
>> cur.execute( '''SELECT * FROM works WHERE
>> YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', year )
>
> There is so much you didn't tell us here, including which database you are
> using.
Are you guys _still_ on
go), Windows support for
get, bzr, and hg was definitely lacking compared to svn. The lack of
something like tortoisesvn for hg/git/bzr was a killer. It looks like
the situation has improved since then, but I'd be curious to hear from
people who do their development on Windows.
--
Grant
week or next month when a new privelege elevation
exploit is discovered for your OS.
> Are you implying that for example one could elevate his privileges to
> root level access form within a normal restricted user account?
Yes, that's what he's implying.
--
Grant Edwards
"single detail I am missing"
Seriously?
--
Grant Edwards grant.b.edwardsYow! What I want to find
at out is -- do parrots know
gmail.commuch about Astro-Turf?
--
http://mail.python.org/mailman/listinfo/python-list
t; Andrea i need to fix this my friend.
Then shut up, stop bothering us, and fix it.
--
Grant Edwards grant.b.edwardsYow! I'm into SOFTWARE!
at
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-06-13, Chris Angelico wrote:
> On Fri, Jun 14, 2013 at 3:06 AM, Grant Edwards
> wrote:
>
>> The last time we made the choice (4-5 years ago), Windows support for
>> get, bzr, and hg was definitely lacking compared to svn. The lack of
>> something like torto
requires a full-time administrator for every 10 or
so users. The other systems seemed to require almost no regular
administration, and what was required was handled by the developers
themselves (mayby a couple hours per month). The cost of ClearCase
was also sky-high.
--
Grant Edwards
On 2013-06-14, Nick the Gr33k wrote:
> Well i do not understand it.
Yea. We know.
--
Grant Edwards grant.b.edwardsYow! I feel like a wet
at parking meter on Darvon!
gmail.
On 2013-06-14, Nick the Gr33k wrote:
> On 13/6/2013 10:31 ????, Grant Edwards wrote:
>> On 2013-06-13, Nick the Gr33k wrote:
>>> On 13/6/2013 9:37 , Andreas Perstinger wrote:
>>>> On 13.06.2013 20:10, Nick the Gr33k wrote:
>>>> [nothing new]
>>
opyright", "credits" or "license" for more information.
>>> name="abcd"
>>> month="efgh"
>>> year="ijkl"
>>>
>>> "k" in (name and month and year)
True
>>> (name and month and
t can lead to some
hard-to-read code, so it's often discouraged as being too clever.
It's important to note that these are somewhat orthogonal:
You can have #1 and #2 (like Python).
You can have #1 without #2 (like C).
You can have #2 without
few random oddities:
>
>>>> bool(float("nan"))
> True
>
> I somehow expected NaN to be false. Maybe that's just my expectations
> that are wrong, though.
If you work with floating point long enough you realize that most of
your expectations are wrong. Sometimes
uot;truthness" and you can be guaranteed
that
if A or B or C:
will behave exactly the same way whether the "or" operator returns
True or it returns one of it's operands.
--
Grant Edwards grant.b.edwardsYow! Where do your SOCKS
)
I think the answer is to automatically kill all threads stared by
"him".
Unfortunately, I don't know if that's possible in most newsreaders.
--
Grant Edwards grant.b.edwardsYow! A dwarf is passing out
at somewhere in Detroit!
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-06-15, Denis McMahon wrote:
> On Fri, 14 Jun 2013 16:58:20 +0300, Nick the Gr33k wrote:
>
>> On 14/6/2013 1:14 , Cameron Simpson wrote:
>>> Normally a character in a b'...' item represents the byte value
>>> matching the character's Unicode ordinal value.
>
>> The only thing that i did
n that case.
> This message was sent with a CC, and you got only one copy.
I don't want _any_ copies from from Mailman. I don't subscribe to
whatever mailing list you're talking about. I'm reading this via an
NNTP server. Keep replies in the
On 2013-06-15, Nick the Gr33k wrote:
> On 15/6/2013 10:46 ??, Jarrod Henry wrote:
>> Nick, at this point, you need to hire someone to do your work for you.
>
> The code is completely ready.
OK. Good-bye then.
--
Grant Edwards grant.b.edwardsYow! Th
No. I first try and inevitably i fail.
But failing _isn't_ inevitible. If you take the time to actually
learn Python by reading the references people provide, by studying
small examples, and by experimenting with Python code, there's no
reason why you should fail.
--
Gr
to discuss questions
about internals (though we hopefully know enough not to depend on the
answers being the same tomorrow).
--
Grant Edwards grant.b.edwardsYow! What I want to find
at out is -- do parrots know
ess his unwillingness to read the
> documentation which was IMO rather apparant.
It's not only apparent, he explicitly stated that he refused to go
read the references he has been provided because he prefers to have
his questions answered by a "live" persion. IMO, anybody who beh
rithm that's way faster
than another O(log(n)) algorithm. [Though that becomes a lot less
likely as n gets large.]
--
Grant Edwards grant.b.edwardsYow! Where's SANDY DUNCAN?
at
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-06-18, Dennis Lee Bieber wrote:
> On Tue, 18 Jun 2013 13:38:40 + (UTC), Grant Edwards
>>On 2013-06-18, Chris Angelico wrote:
>>> On Tue, Jun 18, 2013 at 2:39 PM, alex23 wrote:
>>>> tl;dr Stop acting like a troll and we'll stop perceiving you as s
terminates(f, args) that I can use to determine whether a function
> will terminate before I actually call it.
I think it should be terminate_time() -- so you can also find out how
long it's going to run. It can return None if it's not going to
terminate...
--
Grant Edwards
tools.
--
Grant Edwards grant.b.edwardsYow! I'm shaving!!
at I'M SHAVING!!
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
you didn't have
to do it more that a few times.
--
Grant Edwards grant.b.edwardsYow! I'm a fuschia bowling
at ball somewhere in Brittany
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
own argument parsing class to service it, I can appreciate what the
> OP is trying to do (and it's clever IMO).
Unfortunately, when writing software, being "clever" turns out to be A
Bad Thing(tm) as often as not. ;)
--
Grant Edwards grant.b.edw
ue shipping IPv4-only stuff for many years to come, and all our
customers would be perfectly happy.
--
Grant Edwards grant.b.edwardsYow! My NOSE is NUMB!
at
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-07-03, Roy Smith wrote:
> In article ,
> Grant Edwards wrote:
>
>> On 2013-07-03, Roy Smith wrote:
>> > In article ,
>> > Chris Angelico wrote:
>> >
>> >> Of course, it's possible for there to be dark corners. But if you
On 2013-07-04, ?? wrote:
>
> If you guys want to use it i can send you a patch for it. I know its
> illegal thing to say but it will help you use it without buying it.
A new low. Now he's offering to help people steal others' work.
--
Grant
--
http://mail.python.org/mailman/listinfo
On 2013-07-04, Ferrous Cranus wrote:
> 4/7/2013 9:40 , ??/?? Grant Edwards :
>> On 2013-07-04, ?? wrote:
>>>
>>> If you guys want to use it i can send you a patch for it. I know its
>>> illegal thing to say but it will help y
dress and geographical
location. I know that users of the ISPs in hometown are consistently
mis-identified as being from towns 1500km away.
--
Grant Edwards grant.b.edwardsYow! If elected, Zippy
at pledges to each
;am from Europe/Thessaloniki (sub-capital of Greece)
>
> If we can pin-point the uvisitor more accurately plz let me know.
For the Nth time: you can't.
--
Grant Edwards grant.b.edwardsYow! HOORAY, Ronald!!
at
t; All my Greece visitors as Dave correctly said have the ISP address which
> here in Greece is Europe/Athens, so i have now way to distinct the
> cities of the visitors.
>
> Is there any way to pinpoint the visitor's exact location?
No.
--
Grant Edwards grant.b
t a Bosch combo model (both plunge and fixed base), and I'm
very happy with it:
http://www.boschtools.com/Products/Tools/Pages/BoschProductDetail.aspx?pid=1617EVSPK
It did take me a few days to find the extra 1/4" collet that came with
it since it had worked it's w
er-Cable 693 plunge base will work:
http://www.routerforums.com/introductions/41838-bosch-1604-question.html
http://forums.finewoodworking.com/fine-woodworking-knots/power-tools-and-machinery/pc-6931-plunge-base
--
Grant Edwards grant.b.edwardsYow! Where's the Coke
an OS environment intended
for software development rather than generating time-wasting
power-point presentations.
--
Grant Edwards grant.b.edwardsYow! Look! A ladder!
at Maybe it leads to heaven,
o run it present sit instantly.
So you've reached your conclusion on a sample size of one?
--
Grant Edwards grant.b.edwardsYow! I'm encased in the
at lining of a pure pork
gmail.com
>>> sys.getsizeof(x)
288
>>> math.log10(x)
619.8859949077654
It has 600+ digits and requires 288 bytes to store.
Counting from the left-hand side, starting '7' as digit 0, the 209th
digit in the base-10 representation is:
>>> str(x)[209]
'3'
--
Gran
2) You can post from the gmane web UI.
3) It offers both a threaded and a flat, blog-like version.
--
Grant Edwards grant.b.edwardsYow! We just joined the
at civil hair patrol!
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
stings.
I really can't recommend gmane.org highly enough.
[I don't actually read the python list using gmane.org, since I've
read it from a Usenet news server via the group comp.lang.python since
long before I discovered gmane.org.]
--
Grant Edwards
On 2013-07-21, Gilles wrote:
> Every once in a while, my ISP's SMTP server refuses to send
> perfectly legit e-mails because it considers them as SPAM.
>
> So I'd like to install a dead-simple SMTP server on my XP computer
> just to act as SMTP backup server. All I'd need is to change the SMTP
>
On 2013-07-22, Gilles wrote:
> On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards
> wrote:
>>Unless you've got a static IP address, a domain name, and a valid MX
>>record that will match up when they do a reverse DNS lookup, it's
>>pretty unlikely that you&
that didn't include Python as part of the
base installation.
> I just finished downloading, configuring, making and installing.
>
> The binary is now installed in :
> /usr/local/Python-2.7.5/bin/python2.7
Why not just apt-get install python?
--
Grant Edwards gra
ing floats.
You check for equality if equality is what you want to check. However
much of the time when people _think_ they want to check for FP
equality, they're wrong.
You'll have to consult with a spiritual advisor to determin what you
are "meant" to do...
-
On 2013-07-29, Devyn Collier Johnson wrote:
> On Python3, how can I perform bitwise operations? For instance, I want
> something that will 'and', 'or', and 'xor' a binary integer.
http://www.google.com/search?q=python+bitwise+operations
--
Grant E
I also find intializers for tables of data to be much more easily read
and maintained if the columns can be aligned.
--
Grant Edwards grant.b.edwardsYow! MMM-MM!! So THIS is
at BIO-NEBULATION!
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-07-31, Tim Chase wrote:
> On 2013-07-31 07:16, Joshua Landau wrote:
>> On 30 July 2013 18:52, Grant Edwards wrote:
>>> I also find intializers for tables of data to be much more easily
>>> read and maintained if the columns can be aligned.
>>
>> Why
On 2013-07-31, Neil Cerutti wrote:
> On 2013-07-31, Tim Chase wrote:
>> On 2013-07-31 07:16, Joshua Landau wrote:
>>> On 30 July 2013 18:52, Grant Edwards wrote:
>>>> I also find intializers for tables of data to be much more easily
>>>> read an
orts. Is some device emulating a serial port?
It shouldn't matter. If other apps can open COM4, then pyserial
should be able to open COM4.
>> Thanks, and yes, I am using VirtualBox. My laptop does not have a
>> serial port so I use a USB-to-serial converter, which is assigne
n to Win32. You can't open a serial port
that's already open. [Linux doesn't have that restriction.]
Why do you need to open it a second time?
--
Grant Edwards grant.b.edwardsYow! Send your questions to
at
On 2012-06-27, Adam wrote:
> "Grant Edwards" wrote:
>> On 2012-06-27, Adam wrote:
>>
>>> The Python script needed a call to ser.close() before ser.open() in
>>> order to work.
>>
>> IOW, the port opened OK, but when you tried to open it a
On 2012-06-27, Grant Edwards wrote:
> On 2012-06-27, Adam wrote:
>> "Grant Edwards" wrote:
>>> Why do you need to open it a second time?
>>
>> As far as I can tell, the wireless hardware connected to the
>> USB-to-serial converter is receiving data
ne)
self._isOpen = True
If you have to add the call "ser.close()" before you can open the port
with "ser.open()", then that means that the port _was_already_open_.
--
Grant Edwards grant.b.edwardsYow! World War III?
at No thanks!
gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
83
84 # open up the FTDI serial port to get data transmitted to xbee
85 ser = serial.Serial(SERIALPORT, BAUDRATE)
86 ser.open()
87
Just delete line 86.
See how simple it was to get the problem solved once you posted the
actual code?
--
Grant Edwards gr
ing about the tabs vs. spaces argument. In that
case, people who use 4 spaces per level are 'correct'; people who use
a different number of spaces are a bit less correct; people who use
tabs are wrong; and people who mix spaces and tabs -- well, we don't
talk about them in polite
On 2012-07-17, Ethan Furman wrote:
> In Foxpro if you do a
Foxpro?
--
Grant Edwards grant.b.edwardsYow! I am NOT a nut
at
gmail.com
--
http://mail.python.org/mailman/listi
was the definitive answer.
2) When I first learned Python it didn't have list comprehensions.
That said, "map" seems to be frowned upon by the Python community for
reasons I've never really understood, and most people are going to
prefer reading a list comprehension. "What
On 2012-07-29, Mark Lawrence wrote:
> Point taken, snag being I've never used any nix box in anger. This
> thread reminds of the good 'ole days when I were a lad using TPU on
> VMS. Have we got any VMS aficionados here?
It's been a long time, but I used eve/tpu as my main editor for
several y
llar microcontrollers
that are programmed in assembly language or in C without external
libraries (sometimes not even the "libc" that's included in the C
language definition). Those microcontrollers are everywhere in toys,
appliances, and all sorts of other "non-computer" t
on that where the FP format wasn't IEEE were
the DEC VAX and TI's line if 32-bit floating-point DSPs. I don't
think Python runs on the latter, but it might on the former.
--
Grant Edwards grant.b.edwardsYow! I was born in a
at
On 2012-07-30, Mark Lawrence wrote:
> On 30/07/2012 15:16, Grant Edwards wrote:
>> On 2012-07-30, Steven D'Aprano wrote:
>>
>>> 1) Are there any known implementations or platforms where Python floats
>>> are not C doubles? If so, what are they?
>>
&
e tricky, because I can't use queues and pipes to
>> communicate with a running process that it's noit my child, correct?
>>
> Yes, I think that is correct.
I don't understand why detaching a child process on Linux/Unix would
make IPC sto
rocesses that are holding
open file handles unmap/close them. So not only will detached
children not crash, they'll still be able to use the shared memory
objects to talk to each other.
--
Grant Edwards grant.b.edwardsYow! Why is it that when
child
process is detatched (which I'm assuming means being removed from the
process group and/or detached from the controlling tty).
But, I'm not aware of any underlying Unix IPC mechanism that breaks
when a child is detached, so I was curious about what would cause
multiprocessing
On 2012-08-06, Grant Edwards wrote:
> On 2012-08-06, Tom P wrote:
>> On 08/06/2012 06:18 PM, Nobody wrote:
>>> On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote:
>>>
>>>> consider a nested loop algorithm -
>>>>
>>>> for i in range(100)
,100) and then range(0,N)
In 2.x:
for i in range(M,100)+range(0,M):
for j in range(N,100)+range(0,N):
do_something(i,j)
Dunno if that still works in 3.x. I doubt it, since I think in 3.x
range returns an iterator, not?
--
Grant Edwards grant.b.e
uess it works in 2.x as well?
I don't know. Let me test that for you...
$ python
Python 2.6.8 (unknown, May 18 2012, 11:56:26)
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from i
On 2012-08-10, loial wrote:
> At the moment I do not start to read responses until the data has
> been sent to the printer. However it seems I am missing some
> responses from the printer whilst sending the data, so I need to be
> able to do the 2 things at the same time.
>
> Can I open a port on
1 - 100 of 4295 matches
Mail list logo