Hi folks.
I want to build a pair of wheels - one for numpy, one for scipy. And
I want to statically link atlas (with blas and lapack) into these
wheels. I don't want to statically link numpy or scipy into the
Python interpreter.
The goal is to decrease the frequency with which new wheels need t
Is there a way of "adding" 4 hours and getting a jump of 5 hours on
March 8th, 2015 (due to Daylight Savings Time), without hardcoding
when to spring forward and when to fall back? I'd love it if there's
some library that'll do this for me.
#!/usr/bin/python
import pytz
import datetime
def main
e')
main()
On Tue, Mar 24, 2015 at 3:24 PM, Dan Stromberg wrote:
> Is there a way of "adding" 4 hours and getting a jump of 5 hours on
> March 8th, 2015 (due to Daylight Savings Time), without hardcoding
> when to spring forward and when to fall back? I'd love
On Fri, 17 Apr 2015 18:05:52 +0100, BartC wrote:
> (Actually *I* would quite like to know why languages don't have
> switchable syntax anyway to allow for people's personal preferences.)
You want LISP, the programmable programming language.
--
https://mail.python.org/mailman/listinfo/python-list
only tools I remember from those days all
ran inside UCSD Pascal and didn't expose much of the internals).
Slash rant. Sorry.
Now that we've settled on UTF-8 as a successor to ASCII, the
program=textfile system has a long future in front of it.
Dan
--
https://mail.python.org/mailman/listinfo/python-list
xlrd and python3-xlrd.
HTH,
Dan
--
https://mail.python.org/mailman/listinfo/python-list
d (but predictable) ways, and interrupts would have different
(unpredictable) latency depending on how much internal state of the CPU
had to be saved and restored.
Man, am I *old*.
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 22 May 2015 09:59:02 +0200, Cecil Westerhof wrote:
> Would Camelot be a good tool to get me started, or can I better bite
> the bullet and just start with Tkinter and SQLAlchemy?
Bite the bullet and learn SQL.
SQLAlchemy -> Database :: Python -> Assembly Language.
HTH,
D
I believe I heard that the PEP 484 type checker is to go into CPython 3.5.
Since type annotations have been there since 3.0, is it at all likely
that CPython versions < 3.5 will also be supported by this checker?
Thanks!
--
https://mail.python.org/mailman/listinfo/python-list
I have no idea about the protocol used by NI DataSockets, but you
might be able to reverse engineer the protocol by using the official
client with a sniffer.
Also, be aware that TCP/IP guarantees that you get the correct data in
the correct order, but it doesn't guarantee anything about the sizes
IMO, it's usually better to test for features and use them if they are
present, than to build a list of features available in specific
interpreters.
I see it as analogous to the difference between huge C #ifdef's on OS,
and autoconf.
On Sun, Jun 21, 2015 at 1:12 AM, Cecil Westerhof wrote:
> I in
I know that sounds strange: usually we look up values by key, not keys.
But suppose you have a strange key type that despite being "equal", is
not identical in some fields, and you need to see those fields.
Is there a way of getting the key used by the dictionary, short of
storing a reference to
On Tue, Jun 23, 2015 at 5:33 PM, Ben Finney wrote:
> Dan Stromberg writes:
>
>> Is there a way of getting the key used by the dictionary, short of
>> storing a reference to it in the value, or using a second dictionary?
>
> The dictionary knows its keys and can provide t
On Sun, 02 Aug 2015 16:11:14 -0500, Tim Chase wrote:
> On 2015-08-02 21:54, Ben Finney wrote:
>> So, both XML and JSON should be considered write-only, and produced
>> only for consumption by a computer; they are a poor choice for
>> presenting to a human.
[snip]
> I second Ben's thoughts again
tc.
>
> Grep can use regular expressions (and I do so with it regularly), but
> it's default mode is certainly not regular expressions ...
Its very name indicates that its default mode most certainly is regular
expressions.
Dan
--
https://mail.python.org/mailman/listinfo/python-list
Master.
Around that same time frame was Programma Improved Editor on an
Apple II. (Apple PIE. Get it?)
old'ly yours,
Dan
--
https://mail.python.org/mailman/listinfo/python-list
at this
point to see if it resonates... (or if it falls flat and goes "splat" ).
Thoughts?
Dan Strohl
New special method name to allow for more flexible object type casting/access,
and extend type() to cast objects using this special method name.
Overview:
Have a new special m
Its possible (likely) that I came into this in the middle, so sorry if this was
already thrown out... but have you looked at any of the following suggestions?
https://pypi.python.org/pypi?%3Aaction=search&term=pdf+convert&submit=search
http://stackoverflow.com/questions/6413441/python-pdf-library
('a_string')" it would work (and often doesn't).
The excessive indents of 31 and 15 spaces make the rest of this post
unnecessarily hard to read.
Sorry about that, damn outlook tabs being expanded to stupid numbers I guess.
I will do better next time..
Does any of that hel
I have some code for a web server. Right now, it uses
BaseHTTPRequestHandler with Basic Auth, but we want to be able to log
out, and there doesn't appear to be a general way to log out of
something using Basic Auth, short of turning to unportable JavaScript.
And this needs first and foremost to b
Is there a way of decorating method1 of class C using method2 of class C?
It seems like there's a chicken-and-the-egg problem; the class doesn't
seem to know what "self" is until later in execution so there's
apparently no way to specify @self.method2 when def'ing method1.
--
https://mail.python.
On 6/6/14, Ben Finney wrote:
> Dan Stromberg writes:
>
>> Is there a way of decorating method1 of class C using method2 of class
>> C?
>
> Can you give a concrete example (i.e. not merely hypothetical) where
> this would be a useful feature (i.e. an actual improvemen
untime
extensibility, atop the "obvious" spellings you take the time to include
in your software. And that's *not* a comment on your abilities; it's a
comment on the abilities and creativity of their ancestors.
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 15 Jun 2014 22:17:57 -0400, Roy Smith wrote:
> I don't believe HandGrenade implements throw(). It does, however,
> implement lobbeth().
And therein lies the problem with Object Oriented Programming:
instances of HandGrenade neither throw nor lobbeth.
One, Two, Five
separation than a blank line is provided by
> comments, not more whitespace.
>
> ChrisA
http://legacy.python.org/dev/peps/pep-0008/#id15 says: "Separate top-level
function and class definitions with two blank lines."
With docstrings occurring inside function definitions, this
On Thu, Jul 3, 2014 at 10:31 AM, Tobiah wrote:
> Coworker takes PEP8 as gospel and uses 4 spaces
> to indent. I prefer tabs.
I recently converted from tabs to spaces. I probably still have some
code that uses tabs, but most of my personal stuff has been converted.
I like tabs. Tabs work bette
On Mon, 07 Jul 2014 11:00:59 +1000, Ben Finney wrote:
> The makefile syntax is one of the excellent examples of why it's a
> terrible idea to use tab characters in source code. It's also an
> excellent example of how a poor design decision (a line beginning with
> U+0020 SPACE is semantically diff
On 7/7/14, Mark Lawrence wrote:
> On 07/07/2014 09:09, Chris Angelico wrote:
>> On Mon, Jul 7, 2014 at 6:00 PM, Steven D'Aprano
>> wrote:
>>> How do people feel about code like this?
>>>
>>> try:
>>> name = input("Enter file name, or Ctrl-D to exit")
>>> # On Windows, use Ctrl-Z [enter]
On Tue, Jul 8, 2014 at 12:19 PM, candide wrote:
> http://www.infoworld.com/d/application-development/python-bumps-java-top-learning-language-245774
As a sort of nano-celebration, here's a blast from Python's past (May, 1997):
https://web.archive.org/web/19970501011626/http://www.python.org/
--
h
Hi folks.
I'm having trouble with a strange AttributeError. I'm using RQ (Redis
Queue) and Django, both of which are new to me, so perhaps they are
somehow relevant.
Anyway, the traceback looks like:
Traceback (most recent call last):
File
"/home/ec2-user/miniconda/envs/sciencedb/lib/python2.
On Thu, Jul 10, 2014 at 9:41 AM, Dan Stromberg wrote:
> Hi folks.
>
> I'm having trouble with a strange AttributeError. I'm using RQ (Redis
> Queue) and Django, both of which are new to me, so perhaps they are
> somehow relevant.
>
> Anyway, the traceback looks
On Wed, May 28, 2014 at 12:23 PM, Larry Martell wrote:
> Somthing I came across in my travels through the ether:
>
> https://medium.com/@deliciousrobots/5d2ad703365d/
Hey kids, maybe if we all chant this enough times, we can make it
true! Wouldn't that be fun?
--
https://mail.python.org/mailman
This runs on 2.7 or 3.4, unmodified (other than the #!):
#!/usr/local/cpython-2.7/bin/python
#!/usr/local/cpython-3.4/bin/python
def lucky_sum(*list_):
lucky_total = 0
for element in list_:
if element == 13:
break
lucky_total += element
return lucky_total
On Sun, Jul 13, 2014 at 1:16 PM, Orochi wrote:
> Hi,
> I am beginner in Python
> I have Completed Basic Python Course from Codecademy.com .
> Now that I have a hands on the basics what is the next thing I should do.
> I mean should I learn more or start a small Project(Any Ideas are Welcomed)
> o
On Thu, Jul 17, 2014 at 7:49 PM, alex23 wrote:
> On 17/07/2014 1:14 PM, Steven D'Aprano wrote:
>>
>> There will never be a Python 2.8. When push comes to shove, the people
>> bitching about Python 3 will not do the work necessary to fork Python 2.7
>> and make a version 2.8.
>
>
> +1
>
> The idea
On Tue, Jul 22, 2014 at 5:41 PM, roys2005 wrote:
>
> Emile, thanks for the quick response.
>
> Does this mean Python cannot be or should not be installed at a central
> location?
> If so, what is the root cause for this?
Back when I was a sysadmin, I would install CPython to a few different
NFS
On Wed, Jul 23, 2014 at 7:15 AM, roys2005 wrote:
>
> Dan,
>
> Thanks for the information. So, one option is to build Python
> from source code to be able to install "/where/ever/..."
>
> I still wonder why there is no distribution package for *ix that
>
On Fri, Jul 25, 2014 at 5:21 PM, Skip Montanaro wrote:
>> OK, Eclipse with PyDev doesn't like this first line, with the function:
>> def add(self, (sub, pred, obj)):
>>
>> It complains about the parentheses just before sub.
>
> Seems like this code is Python 2.x.
For me, this code ran on all of 2
On Sun, Jul 27, 2014 at 11:49 AM, fl wrote:
> In Python, when should you use lists and when tuples?
>
> Sometimes you don't have a choice, for example if you have
>
> "hello %s you are %s years old" % x
> then x must be a tuple.
>
> But if I am the one who designs the API and gets to choose the da
On Sun, Jul 27, 2014 at 8:52 PM, 水静流深 <1248283...@qq.com> wrote:
> there is a simple file `mydown.py` saved in `D:\Python34\Lib\site-packages`
> there is only one line in mydown.py .
>
> import requests
>
>
>
> C:\Users\pengsir>d:\Python34\python
> Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 1
On Wed, Jul 30, 2014 at 5:16 AM, varun bhatnagar wrote:
> Hi,
>
> I have two xml files.
> I am trying to fetch an output file which looks like this:
>
> Output.xml
> The number of Procedure tag () can be different every time. So I
> have to read this tag every time from each xml and then merge i
I like to think of pylint as an expert system about how to write
better Python. Some of the warnings are pointless (superfluous-parens
really bugs me), but much of it is quite valuable. And for the
-really- pointless stuff, you can create a pylintrc to ignore them
forever. Personally, I prefer t
You're probably still better off finding an XSLT mailing list.
On Thu, Jul 31, 2014 at 12:31 AM, varun bhatnagar wrote:
> Hi Dan,
>
> Thanks a lot for the reply. I am using lxml for the transformation and I am
> parsing xsl file using lxml module, that is why posted in this lis
On Thu, Jul 31, 2014 at 4:24 AM, Dilu Sasidharan wrote:
> Hi,
>
> I am wondering why the dictionary in python not returning multi value key
> error when i define something like
>
> p = {'k':"value0",'k':"value1"}
>
> key is string immutable and sometimes shares same id.
>
> also if the key is immu
On Thu, Jul 31, 2014 at 8:08 PM, Dan Stromberg wrote:
>> p = {'1':"value0",'1.0':"value1"}
> For 1 and 1.0 - they simply hash differently. Dictionaries are
> resizeable hash tables.
I removed some quotes, and noticed that 1 and 1.0 hash t
I heard there was a presentation about web2py in my area tonight.
Trying to decide if I wanted to attend, I googled about web2py and
python3.
I was amazed by what I found. I've never seen a group so opposed to python3.
They make the old (and long-since lost) Solaris 2 wars seem tame.
I don't th
On Thu, Aug 14, 2014 at 5:44 PM, Mark Lawrence wrote:
> I really don't understand why people here are spoon feeding you when you
> still insist on top posting. Ever heard the term "manners"? Oh what a
> stupid comment, obviously not.
>
> *plonk*
Getting people to stop top-posting is a losing ba
On Mon, Aug 18, 2014 at 10:18 AM, Chiu Hsiang Hsu wrote:
> I know that Python use Timsort as default sorting algorithm and it is
> efficient,
> but I just wanna have a partial sorting (n-largest/smallest elements).
Perhaps heapq with Pypy? Or with nuitka? Or with numba?
--
https://mail.python
On Tue, Aug 19, 2014 at 12:37 PM, Chiu Hsiang Hsu wrote:
> On Tuesday, August 19, 2014 5:42:27 AM UTC+8, Dan Stromberg wrote:
>> On Mon, Aug 18, 2014 at 10:18 AM, Chiu Hsiang Hsu wrote:
>>
>> > I know that Python use Timsort as default sorting algorithm and it is
>&
On Tue, Aug 19, 2014 at 4:05 PM, Dan Stromberg wrote:
> When you use heapq, are you putting all the values in the heap, or
> just up to n at a time (evicting the worst value, one at a time as you
> go)? If you're doing the former, it's basically a heapsort which
> proba
On Tue, Aug 19, 2014 at 4:10 PM, Dan Stromberg wrote:
> On Tue, Aug 19, 2014 at 4:05 PM, Dan Stromberg wrote:
>> When you use heapq, are you putting all the values in the heap, or
>> just up to n at a time (evicting the worst value, one at a time as you
>> go)? If you'
On Wed, Aug 20, 2014 at 5:09 AM, luofeiyu wrote:
> i want to copy all the emails in the gmailbox of
> "[Gmail]/&kc2JgQ-" (the important mailbox in my gmail"
> into local directory "g:\emails",how can i do that in python code?
You could also try
http://wiki.vpslink.com/Mount_a_Gmail_Account_as
On Mon, Aug 18, 2014 at 1:35 PM, ElChino wrote:
> A newbie question to you; what is the difference between statements like:
> if x is not None:
> and
> if x != None:
>
> Without any context, which one should be preferred?
> IMHO, the latter is more readable.
You've got some good answers.
I'd li
Amusing.
It works in hexadecimal too:
numerator = 1
denominator = 0xffe001
shift = int(16 ** 30)
print(hex(int(numerator * shift / denominator)))
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Aug 22, 2014 at 11:44 AM, Neil D. Cerutti wrote:
> On 8/22/2014 2:19 PM, Seymore4Head wrote:
>>
>> Is there a way to indent everything again?
>>
>> Say I have a while statement with several lines of code and I want to
>> add a while outside that. That means indenting everything. Is there
On Fri, Aug 22, 2014 at 1:16 PM, Neil D. Cerutti wrote:
>> Emacs and vim both have huge learning curves that I've decided aren't
>> worth climbing. Notepad++ is an excellent GUI text editor for Windows.
>> Geany is nearly as good, and runs on anything.
>
>
> They do have a very long learning incl
On Thu, Aug 21, 2014 at 12:55 AM, wrote:
> Hi, just wanting to do a shot in the dark,but maybe this syntax is Pythonic
> (in a "we-are-all-grown-ups" fashion, ahem)enough to get its way into the
> language
> this is what yours truly thinks: don't we all know that ":" means the next
> token mus
On Thu, Aug 21, 2014 at 12:55 AM, wrote:
> Hi, just wanting to do a shot in the dark,but maybe this syntax is Pythonic
> (in a "we-are-all-grown-ups" fashion, ahem)enough to get its way into the
> language
> this is what yours truly thinks: don't we all know that ":" means the next
> token mus
On Mon, Aug 25, 2014 at 9:04 AM, Mark Lawrence wrote:
> On 25/08/2014 16:28, Parth Trivedi wrote:
>>
>> Dear All,
>>
>> I need some help of yours. I want to convert audio in MP3 format to
>> other formats including uncompressed raw format, WAV etc. and I am using
>> python 2.7. Is there any built-
On Wed, Aug 27, 2014 at 1:31 PM, wrote:
>
> Hi,
>
> Sorry about the simple question but I am very new to Python.
>
> Anyway, I have a function that will be used to call a stored procedure and
> I need to format the string with the correct number of parameter markers for
> the ODBC driver,
On Sun, Aug 31, 2014 at 11:45 AM, Tim Chase
wrote:
> Tinkering around with a little script, I found myself with the need
> to walk a directory tree and process mail messaged found within.
> Sometimes these end up being mbox files (with multiple messages
> within), sometimes it's a Maildir structur
uplicate)
Okay, so what is value? Is it 'foo'? Is it None?
(Yes, I can fix this. If I *know* that original is a float, then I
could use original.hex() instead of str(original).)
HTH,
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Sep 7, 2014 at 11:53 AM, Peter Pearson
wrote:
> On Sat, 6 Sep 2014 12:53:16 +0200, Manolo Martínez wrote:
>> On 09/06/14 at 08:38pm, Steven D'Aprano wrote:
>>> But even that's not how the specialists do it. If you want to check whether
>>> (say) 2**3000+1 is prime, you don't want to use tr
On Wed, Sep 24, 2014 at 9:54 AM, Chris Angelico wrote:
> Yes, it's another "how can I see if two numbers are approximately
> equal" thread, but this time I have a concrete definition of
> "approximately equal"... and they're Decimals, not floats.
>
> I have a number of files (this is an ongoing th
On Mon, Sep 29, 2014 at 4:47 AM, Steven D'Aprano
wrote:
> norman.i...@gmail.com wrote:
>
>> Hello list
>>
>> Python 3.4 applies.
>>
>> I have a project that involves distributing Python code to users in an
>> organisation. Users do not interact directly with the Python code; they
>> only know this
On Thu, Oct 2, 2014 at 12:15 PM, Ian Kelly wrote:
> On Thu, Oct 2, 2014 at 10:33 AM, wrote:
>> Ah, so at least there is a reason for it, I'm far from being a
>> mathematician though so it's not particularly obvious (for me anyway).
>
> You're not alone; a lot of people find the terminology not i
On Fri, Oct 3, 2014 at 1:01 PM, Skip Montanaro wrote:
> On Fri, Oct 3, 2014 at 1:36 PM, Croepha
> wrote:
>
>> Long running Python jobs that consume a lot of memory while
>> running may not return that memory to the operating system
>> until the process actually terminates, even if everything is
>
Try:
sys.path.append(os.path.expanduser('~/MyLib'))
On Thu, Oct 9, 2014 at 9:21 PM, Igor Korot wrote:
> Hi, ALL,
> When I am on Windows, I can write something like this:
>
> sys.path.append('C:\Users\Igor\Documents\MyLib')
>
> Now, when I'm on Linux, can I do this:
>
> sys.path.append('~/MyLib')
On Mon, Oct 13, 2014 at 10:38 AM, Rff wrote:
> Hi,
> I have a text file. Now it is required to select every other line of that
> text to
> generate a new text file. I have read through Python grammar, but still lack
> the
> idea at the beginning of the task. Could you tell me some methods to g
On Tue, Oct 14, 2014 at 7:13 PM, ryguy7272 wrote:
> I'm just learning Python. It seems like indents are EXTREMELY important. I
> guess, since there are no brackets, everything is controlled by indents.
> Well, I'm reading a couple books on Python now, and in almost all of the
> examples they
On Wed, Oct 15, 2014 at 3:50 PM, ryguy7272 wrote:
> I'm trying to run this script (using IDLE 3.4)
> I would be most appreciative if someone could respond to a few questions.
>
> The error that I get is this.
> 'invalid syntax'
You may get better help if you give the context of this message.
>
On Wed, Oct 15, 2014 at 5:40 PM, ryguy7272 wrote:
>
> ImportError: No module named 'urllib2'
http://stackoverflow.com/questions/2792650/python3-error-import-error-no-module-name-urllib
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Oct 15, 2014 at 5:44 PM, ryguy7272 wrote:
> Either this is the most brilliant thing ever invented, or it's the biggest
> piece of shit ever invented. I just can't tell. All I know for sure, is
> that it doesn't do ANYTHING that I tell it to do.
Maybe you should decide whether you wan
On Sat, Oct 18, 2014 at 6:11 PM, Nobody wrote:
> On Sat, 18 Oct 2014 12:32:07 -0500, Tim Chase wrote:
>
>> On 2014-10-18 17:55, Nobody wrote:
>>> On Fri, 17 Oct 2014 12:38:54 +0100, Empty Account wrote:
>>>
>>> > I am using netcat to listen to a port and python to read stdin and
>>> > print to the
On Sat, Oct 18, 2014 at 6:34 PM, Dan Stromberg wrote:
>> Once the "nc" process actually write()s the data to its standard
>> output (i.e. desriptor 1, not the "stdout" FILE*)
> I'm not sure why you're excluding stdout, but even if nc is using
> file
On Sun, Oct 19, 2014 at 9:45 PM, Marko Rauhamaa wrote:
> I found this comment in CPython's source code (pythonrun.c):
>
> /* stdin is always opened in buffered mode, first because it shouldn't
>make a difference in common use cases, second because TextIOWrapper
>depends on the
If I run the following in one tty:
nc -l localhost 9000 | /tmp/z
...where /tmp/z has just:
#!/usr/bin/python3
import sys
for line in sys.stdin.buffer:
print(line)
And then run the following in another tty on the same computer:
while read line; do echo $line; sleep 1;
On Mon, Oct 20, 2014 at 4:18 PM, Marko Rauhamaa wrote:
> Dan Stromberg :
>> ...then everything acts line buffered, or perhaps even character
>> buffered [...]
>>
>> That, or we're using two different versions of netcat (there are at
>> least two available
On Mon, Oct 20, 2014 at 9:41 PM, Marko Rauhamaa wrote:
> Dan Stromberg :
>
>> Often with TCP protocols, line buffered is preferred to character
>> buffered,
>
> Terminal devices support line buffering on write.
Yes, though that's not the only place it's usefu
On Mon, Oct 20, 2014 at 2:16 AM, Praveen Kumar
wrote:
> I am writing a very basic server side application[0] which get data
> from a client and create a virtual machine using provided data and
> also tells client about what's going on during *virt-install* command
> execution. Previously this basi
On Tue, Oct 21, 2014 at 7:49 PM, Nobody wrote:
> On Sat, 18 Oct 2014 18:42:00 -0700, Dan Stromberg wrote:
>
>> On Sat, Oct 18, 2014 at 6:34 PM, Dan Stromberg wrote:
>>>> Once the "nc" process actually write()s the data to its standard
>>>> o
The exception was the so-called Information
Cluster, a collection of functions surrounding a data store, the
predecessor to the modern day object-with-state and/or closure).
Not a Java fan'ly yours,
Dan
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 31 Oct 2011 13:16:25 -0700, extraspecialbitter wrote:
> cmd = 'ethtool %interface'
Do you perhaps mean:
cmd = 'ethtool %s' % (interface, )
--
http://mail.python.org/mailman/listinfo/python-list
Is there an opensource Python tool for creating RSS feeds, that doesn't
require large dependencies?
I found feedformatter.py on pypi, but it seems a little old, and its sole
automated test gives a traceback.
Is there a better starting point?
(I'd of course prefer something that'll run on 3.x and
or message 'e'. I'm sure there's a
> way and it's probably ridiculously simple.
"except" catches any exception that inherits from its argument, and all
MySQL exceptions inherit from MySQLError, so something like this will
catch only MySQL exceptions and nothing els
On Sun, Nov 20, 2011 at 4:46 PM, Travis Parks wrote:
> Hello:
>
> I am currently working on designing a new programming language. It is
> a compiled language, but I still want to use Python as a reference.
> Python has a lot of similarities to my language, such as indentation
> for code blocks, la
On 12/1/11, janedenone wrote:
> Hi,
>
> I would like to read from a pipe, parse the input and ask the user
> what to do next:
>
> message = sys.stdin.read()
> # message is parsed and URLs are printed as a list to choose from...
> selected_index = raw_input('Which URL to open?')
>
> Calling raw_inp
On 12/2/11, Antti J Ylikoski wrote:
>
> I'm in the process of learning Python. I already can code
> objet-oriented programs with the language. I have in my hands the
> O'Reilly book by Mark Lutz, Programming Python, in two versions: the
> 2nd Edition, which covers Python 2, and the 4th edition,
Two methods:
1) If you need your hash only once in an infrequent while, then save
the elements in a list, appending as needed, and sort prior to
hashing, as needed
2) If you need your hash more often, you could keep your elements in a
treap or red-black tree; these will maintain sortedness through
On 12/5/11, 8 Dihedral wrote:
> On Monday, December 5, 2011 1:50:08 PM UTC+8, Dan Stromberg wrote:
>> Two methods:
>> 1) If you need your hash only once in an infrequent while, then save
>> the elements in a list, appending as needed, and sort prior to
>> hashing
On 12/6/11, Steven D'Aprano wrote:
> I have some bit-twiddling code written in Java which I am trying to port
> to Python.:
>
> long newSeed = (seed & 0xL) * 0x41A7L;
> while (newSeed >= 0x8000L) {
> newSeed = (newSeed & 0x7FFFL) + (newSeed >>> 31L);
> }
> seed = (newSeed =
On 12/7/11, Mihai Badoiu wrote:
> ok, so the code is something like
> #process A
> p = Process(...)
> p.daemon = 1
> p.start() # starts process B
> ...
>
> If process A dies (say error, or ctrl-c), or finishes, then process B also
> dies. But if process A is killed with the "kill" command
How safe is this? I like the idea.
#!/usr/bin/python
UNSPECIFIED = object()
def fn(x, y=UNSPECIFIED):
if y is UNSPECIFIED:
print x, 'default'
else:
print x, y
fn(0, 1)
fn(0, None)
fn(0)
--
http://mail.python.org/mailman/listinfo/python-list
now I can have comments, again, too
x = ''"hello"'' # now x contains two double-quote characters
I'm sure that the implementation is trivial, and it's so much easier to
write strings that contain quotes (not to mention how easy it is to read
those strings back later).
--
Dan
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 04 Jan 2012 13:37:24 +1100, Chris Angelico wrote:
> And "import pickle" objectifies pickles ...
Not quite: "import pickle" merely readies the machinery that objectifies
pickles. In order to objectify a pickle, you have to call pickle.loads:
>>> import pickle # get ready to objectify
quot;with" statement, though, these loops are slowly
disappearing.
--
Dan
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 5, 2013 6:00 PM, "Steven D'Aprano" <
steve+comp.lang.pyt...@pearwood.info> wrote:
>
> Chris Angelico wrote:
>
> > Python is not an "excellent option". It's a bad fit for shell
> > scripting, it just happens to be way better than a weak shell. Having
> > grown up on command.com, I found OS/2'
Sent from my android phone.
On Feb 9, 2013 6:41 PM, "Terry Reedy" wrote:
>
> On 2/9/2013 6:53 PM, Michael Torrie wrote:
>>
>> On 02/09/2013 04:26 PM, Tim Roberts wrote:
>>>
>>> Most people would call bash a "scripting language", but it is also
clearly
>>> a programming language. It has syntax, va
Sent from my android phone.
On Feb 10, 2013 2:09 PM, "Vlasov Vitaly" wrote:
>
> суббота, 9 февраля 2013 г., 23:22:47 UTC+4 пользователь Terry Reedy
написал:
> > On 2/9/2013 6:23 AM, Vlasov Vitaly wrote:
>
> > --
> >
> > Terry Jan Reedy
>
> Thank you.
>
> I tried everything in my test script.
> win
On Mon, Mar 25, 2013 at 4:35 PM, Cousin Stanley wrote:
>
> Chris Angelico wrote:
>
> > The Python 3 merge of int and long has effectively penalized
> > small-number arithmetic by removing an optimization.
> >
> > The cost is clear.
> >
>
I thought I heard that Python 3.x will use machin
1401 - 1500 of 2387 matches
Mail list logo