On 01/11/17 18:57, Stefan Ram wrote:
Ned Batchelder writes:
You should not optimize for the shortest time to paste a line of code.Â
You should take time and care writing your code, so that it reads best
and runs best. If you needed another os function, would you have two
__import__("os") in y
On Thu, 2 Nov 2017 08:02 am, Ben Bacarisse wrote:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> Wolfgang Maier writes:
>>>If you're worried bout having things on separate lines, you could write:
>>>import os; os.getcwd()
>>>,etc., which is actually saving a few characters :)
>>
>> Yes, b
On Thu, 2 Nov 2017 05:57 am, Stefan Ram wrote:
> I also have heard that there was a module cache, so I
> was hoping that a second import of the same module might
> not be such an effort for the implementation.
There is: sys.modules.
Although `import spam` is cheap when spam is in the cache, its
On Thu, 2 Nov 2017 04:25 am, Stefan Ram wrote:
> I started to collect some code snippets:
[...]
> __import__( "random" ).random()
>
> And so on. You get the idea.
>
> However, reportedly, all those snippets are anti-patterns
> because they use »__import_
On Thu, Nov 2, 2017 at 8:02 AM, Ben Bacarisse wrote:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> Wolfgang Maier writes:
>>>If you're worried bout having things on separate lines, you could write:
>>>import os; os.getcwd()
>>>,etc., which is actually saving a few characters :)
>>
>> Yes,
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Wolfgang Maier writes:
>>If you're worried bout having things on separate lines, you could write:
>>import os; os.getcwd()
>>,etc., which is actually saving a few characters :)
>
> Yes, but there still is the risk of the identifier »os«
> already
On 11/01/2017 06:25 PM, Stefan Ram wrote:
> import random
> ...
> random.random()
>
> Now, the user has to cut the import, paste it to the top
> of his code, then go back to the list of snippets, find
> the same snippet again, copy the expression, go to his code,
> then find the point whe
On Thu, Nov 2, 2017 at 7:17 AM, Stefan Ram wrote:
> Wolfgang Maier writes:
>>If you're worried bout having things on separate lines, you could write:
>>import os; os.getcwd()
>>,etc., which is actually saving a few characters :)
>
> Yes, but there still is the risk of the identifier »os«
> al
On 01.11.2017 18:25, Stefan Ram wrote:
I started to collect some code snippets:
Sleep one second
__import__( "time" ).sleep( 1 )
Get current directory
__import__( "os" ).getcwd()
Get a random number
__import__( "random" ).random()
And so on.
On 11/1/17 1:25 PM, Stefan Ram wrote:
I started to collect some code snippets:
Sleep one second
__import__( "time" ).sleep( 1 )
Get current directory
__import__( "os" ).getcwd()
Get a random number
__import__( "random" ).random()
And so on.
On 2017-11-01, Stefan Ram wrote:
> I started to collect some code snippets:
>
> Sleep one second
>
> __import__( "time" ).sleep( 1 )
>
> What I'm supposed to do instead, I guess, is:
>
> Sleep one second
>
> import time
> ...
> tim
On Sunday 02 March 2014 07:05:06 Alister did opine:
> On Sun, 02 Mar 2014 09:16:35 +1100, Chris Angelico wrote:
> > On Sat, Mar 1, 2014 at 1:31 AM, Grant Edwards
> >
> >
> > wrote:
> >> You drag out the lab scope, logic analyzer, spectrum analyzer, sweep
> >> generator, strip plotter, and the ma
On Sun, 02 Mar 2014 09:16:35 +1100, Chris Angelico wrote:
> On Sat, Mar 1, 2014 at 1:31 AM, Grant Edwards
> wrote:
>> You drag out the lab scope, logic analyzer, spectrum analyzer, sweep
>> generator, strip plotter, and the machine that goes "ping". You start
>> to get everything set up to nail
Grant Edwards wrote:
You drag out the lab scope, logic analyzer, spectrum analyzer, sweep
generator, strip plotter, and the machine that goes "ping". You start
to get everything set up to nail that problem securely to the
dissecting board. Long before you actually get to that point, the
proble
On Sat, Mar 1, 2014 at 1:31 AM, Grant Edwards wrote:
> You drag out the lab scope, logic analyzer, spectrum analyzer, sweep
> generator, strip plotter, and the machine that goes "ping". You start
> to get everything set up to nail that problem securely to the
> dissecting board. Long before you
On Saturday 01 March 2014 16:52:44 Grant Edwards did opine:
> On 2014-02-28, Chris Angelico wrote:
> > The problem does have to believe that the rubber duck/teddy
> > bear/figurine is an expert, though. I've had my siblings or parents
> > come to me with problems and, without saying a word or tou
On 2014-02-28, Chris Angelico wrote:
> The problem does have to believe that the rubber duck/teddy
> bear/figurine is an expert, though. I've had my siblings or parents
> come to me with problems and, without saying a word or touching the
> computer or anything, I've solved them. The problem itse
On Fri, Feb 28, 2014 at 9:15 AM, Ben Finney wrote:
> Since you'll be posting the code in-line, make sure it's short. Since
> it'll be short, make sure it's complete — we should need nothing else to
> run the code and expect to see the same behaviour you're seeing.
>
> Since you'll be making it sho
"Mark H. Harris" Wrote in message:
> my isp withdrew the post service (nntp) from their server at end of 2011...
> and I didn't notice till now! ha! So, I'm not using seamonkey any
> longer... using google groups/ and that has been a fit to get used to, but
> I'm making progress.
>
>
On Thursday, February 27, 2014 4:15:16 PM UTC-6, Ben Finney wrote:
>
> Post your code in-line with your message. This is for the sake of the
> people whose time you're requesting, and of later readers who will find
> the thread when searching the archives -- URLs to snippets are likely to
> be in
"Mark H. Harris" writes:
>Its been too long... can't remember... are there rules here about
>posting code snippets, or length considerations, and so forth?
Post your code in-line with your message. This is for the sake of the
people whose time you're requesting
On 2014-02-27 04:13, Mark H. Harris wrote:
> are there rules here about posting code snippets, or length
> considerations, and so forth? Seems like there was a place to share
> code snips outside of the message area?
This is the internet, so you're welcome to post code as you p
On Thursday, February 27, 2014 9:01:50 AM UTC-6, Jerry Hill wrote:
> --
>
> Jerry
Thanks guys, perfect. 'preciate it!
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Feb 27, 2014 at 7:13 AM, Mark H. Harris wrote:
> hi folks,
>Its been too long... can't remember... are there rules here about posting
> code snippets, or length considerations, and so forth?
Chris' advice about just posting your code inline with your message is
go
On Thu, Feb 27, 2014 at 11:13 PM, Mark H. Harris wrote:
> hi folks,
>Its been too long... can't remember... are there rules here about posting
> code snippets, or length considerations, and so forth?
>Seems like there was a place to share code snips outside of the mess
hi folks,
Its been too long... can't remember... are there rules here about posting
code snippets, or length considerations, and so forth?
Seems like there was a place to share code snips outside of the message
area?
A related question, is there a python repository for uplo
When visitors visit your site to post their code; often such posts ask
for username and email address; consider adding additional fields to
generate some Python documenting feature like Sphinx or epydoc.
and let your site inject the docstring (module string) into the
snippet; primarily, author, u
Considering that the site is going to grow over time, putting the snippets in a
drop-down menu isn't a wise idea in my opinion.
Snippets on a separate page like activestate python would make it more
convenient.
Nice initiative, and would be very helpful when it grows over time.
--
http://mail.
te is:
>
> http://www.pythonsnippet.com
>
> If you have anything to contribute or comment, please post it on the
> site or email me directly.
Great sentiment, but there is already http://code.activestate.com/,
http://code.google.com/p/python-code-snippets/ and
http://stackoverflo
I am looking to get reviews, comments, code snippet suggestions, and
feature requests for my site.
I intend to grow out this site with all kinds of real world code
examples to learn from and use in everyday coding.
The site is:
http://www.pythonsnippet.com
If you have anything to contribute or co
I got tired of Bloggers inadequate comment editor so wrote this for
transforming code snippets:
=
'''
blogspace.py
Turns leading spaces into HTML tokens which shows
as correct indentation on Blogger comment fields
(and maybe other blogs).
Donald. '
Wikicodia Admin wrote:
> Dears,
>
> Wikicodia is a wiki based project for sharing code snippets. We're
> collecting large number of code snippets for all code-based
> programming languages, scripts, shells and consoles. We wish you could
> help us. We're still BETA.
Dears,
Wikicodia is a wiki based project for sharing code snippets. We're
collecting large number of code snippets for all code-based
programming languages, scripts, shells and consoles. We wish you could
help us. We're still BETA. Your suggestions, ideas and criticisms are
very welco
33 matches
Mail list logo