Hi,
If I use load_module for loading module, I can instantiate classes, defined in
that module. Is it possible to do the same, if load not a module, but package?
Python documentation for load_module contains description, that load_module can
load a package. But I can not find examples, how to
Hello
Article : Using Python inside Programming Without Coding Technology (PWCT)
environment.
http://www.codeproject.com/Articles/693408/Using-Python-inside-Programming-Without-Coding-Tec
In this article you will find information about using Python in the PWCT Visual
Programming Environment
On Tue, Dec 10, 2013 at 2:02 PM, Ethan Furman et...@stoneleaf.us wrote:
Doesn't sound like they do, as that's causing plenty of problems. In
today's world that level of knowledge isn't always necessary, especially if
your degree is not in CS. One of the (many) nice things about Python is one
On Wed, Dec 11, 2013 at 7:34 PM, Devin Jeanpierre
jeanpierr...@gmail.com wrote:
On Tue, Dec 10, 2013 at 2:02 PM, Ethan Furman et...@stoneleaf.us wrote:
Doesn't sound like they do, as that's causing plenty of problems. In
today's world that level of knowledge isn't always necessary, especially
Hi list,
can somebody explain me the difference between accessing attributes via
obj.attribute and getattr(obj, attribute)?
Is there a special reason or advantage when using getattr?
bg,
Johannes
--
Johannes Schneider
Webentwicklung
johannes.schnei...@galileo-press.de
Tel.: +49.228.42150.xxx
Hi.
On 11.12.2013. 9:23, Johannes Schneider wrote:
can somebody explain me the difference between accessing attributes via
obj.attribute and getattr(obj, attribute)?
Is there a special reason or advantage when using getattr?
You can not use obj.attribute if you have the word 'attribute'
2013/12/11 Johannes Schneider johannes.schnei...@galileo-press.de:
can somebody explain me the difference between accessing attributes via
obj.attribute and getattr(obj, attribute)?
Is there a special reason or advantage when using getattr?
You use getattr when the attribute name comes from a
On Wed, Dec 11, 2013 at 8:30 PM, Jurko Gospodnetić
jurko.gospodne...@pke.hr wrote:
Also, you can not test whether an object has an attribute when using the
object.attribute access method without raising/catching an exception and
then it can be hard to make sure no other code caused the
A few practical considerations, far away from theoretical
aspects. Mainly for non ascii, understand non native English
speakers.
Python is an ascii oriented product.
Platform. On Windows, the solely version which works
harmoniously with the system is Py 2.7 in a byte string
mode (ie non
On 11/12/2013 05:45, smilesonisa...@gmail.com wrote:
On Wednesday, December 11, 2013 10:23:34 AM UTC+5:30, John Gordon wrote:
In 93405ea9-6faf-4a09-9fd9-ed264e313...@googlegroups.com
smilesonisa...@gmail.com writes:
File aaa.py, line 5, in module
from ccc.ddd import sss
Python scripts can run without a main(). What is the advantage to using a
main()? Is it necessary to use a main() when the script uses command line
arguments? (See script below)
#!/usr/bin/python
import sys
def main():
# print command line arguments
for arg in sys.argv[1:]:
On 11/12/2013 09:39, wxjmfa...@gmail.com wrote:
A few practical considerations, far away from theoretical
aspects. Mainly for non ascii, understand non native English
speakers.
Python is an ascii oriented product.
Sheer unadulterated rubbish.
Platform. On Windows, the solely version which
thank you guys.
On 11.12.2013 10:36, Chris Angelico wrote:
2013/12/11 Johannes Schneider johannes.schnei...@galileo-press.de:
can somebody explain me the difference between accessing attributes via
obj.attribute and getattr(obj, attribute)?
Is there a special reason or advantage when using
JL lightai...@gmail.com writes:
Python scripts can run without a main(). What is the advantage to
using a main()?
Modular code – that is, implementing the program functionality in small,
well-defined units with narrow, strictly-defined interfaces – is good
design.
Practical benefits include
On Tue, 10 Dec 2013 17:57:50 +, Walter Hurry wrote:
On Tue, 10 Dec 2013 11:21:32 -0500, dan.rose wrote:
PLEASE NOTE: The preceding information may be confidential or
privileged. It only should be used or disseminated for the purpose of
conducting business with Parker. If you are not an
On Wed, Dec 11, 2013 at 9:26 PM, Ben Finney ben+pyt...@benfinney.id.au wrote:
except SystemExit, exc:
For new code, you'd of course want to write that as:
except SystemExit as exc:
which is compatible with Python 2.6, 2.7, and 3.x, while the other
syntax is 2.x only.
ChrisA
--
On Wed, Dec 11, 2013 at 7:43 PM, Chris Angelico ros...@gmail.com wrote:
When you tell a story, it's important to engage the reader from the
start.
On Wed, Dec 11, 2013 at 8:39 PM, wxjmfa...@gmail.com wrote:
A few practical considerations, far away from theoretical
aspects. Mainly for non
On Tue, 10 Dec 2013 11:21:32 -0500, dan.rose wrote:
I am running PYTHON 2.7.3 and executing a PYTHON program that uses
multi-threading. I am running this on a 64-bit Windows 2008 R2 server
(Service Pack 1).
Hi Dan, and despite the emails from a few others, welcome. My further
comments
On Wed, 11 Dec 2013 19:43:52 +1100, Chris Angelico wrote:
[1] http://tvtropes.org/pmwiki/pmwiki.php/Main/InMediasRes
TV Tropes? You utter, utter bastard.
Must... resist... call... of... TV Tropes...
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
On 11/12/2013 11:45, Chris Angelico wrote:
And then, shortly after the beginning of the story, you need to
introduce the villain. Thanks, jmf, for taking that position in our
role-play storytelling scenario! A round of applause for jmf, folks,
for doing a brilliant impression of the
Hi All,
I'm very happy to announce the a new release of Mush, a light weight
dependency injection framework aimed at enabling the easy testing and
re-use of chunks of code that make up scripts.
This release rounds out a some more rough edges after even more real
world use:
- The 'nothing'
On 11/12/2013 11:37, Steven D'Aprano wrote:
When did this forum become so intolerant of even the tiniest, most
minor breaches of old-school tech etiquette?
[... Giant Snip...]
Well said Steven. I've only been member of this list for (maybe) a
year, mainly lurking to learn about Python and
Hi Dave!
You were absolutely right.
I don't want to iterate the entire dict to get me the key/values
Let us say this dict would have 20.000 entries, but I want only those
with Aa to be grabed.
Those starting with these 2 letters would be only 5 or 6 then it would
take a lot of time.
In
On 11 December 2013 08:43, Chris Angelico ros...@gmail.com wrote:
On Wed, Dec 11, 2013 at 7:34 PM, Devin Jeanpierre
jeanpierr...@gmail.com wrote:
When you tell a story, it's important to engage the reader from the
start. Sometimes that means starting the story in the middle of the
action,
Looking for a script which will check connectivity of any or all of our
company URL's first thing in the morning to make sure none or our sites are
down. Any suggestions ? Thank You
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Dec 11, 2013 at 10:33 PM, Steve Simmons square.st...@gmail.com wrote:
On 11/12/2013 11:45, Chris Angelico wrote:
And then, shortly after the beginning of the story, you need to
introduce the villain. Thanks, jmf, for taking that position in our
role-play storytelling scenario! A
On Tue, Dec 10, 2013 at 9:16 PM, Denis McMahon denismfmcma...@gmail.com wrote:
On Tue, 10 Dec 2013 20:35:47 -0500, Dennis Lee Bieber wrote:
On Tue, 10 Dec 2013 18:25:48 +1300, Gregory Ewing
greg.ew...@canterbury.ac.nz declaimed the following:
That's like saying that when teaching woodwork we
Tamer Higazi wrote:
Hi Dave!
You were absolutely right.
I don't want to iterate the entire dict to get me the key/values
Let us say this dict would have 20.000 entries, but I want only those
with Aa to be grabed.
Those starting with these 2 letters would be only 5 or 6 then it would
On Wed, Dec 11, 2013 at 6:53 AM, Jeff James j...@jeffljames.com wrote:
Looking for a script which will check connectivity of any or all of our
company URL's first thing in the morning to make sure none or our sites are
down. Any suggestions ? Thank You
import urllib
sites =
please guide to make proxy type function in python
--
https://mail.python.org/mailman/listinfo/python-list
On 11/12/2013 13:02, Chris Angelico wrote:
On Wed, Dec 11, 2013 at 10:33 PM, Steve Simmons square.st...@gmail.com wrote:
On 11/12/2013 11:45, Chris Angelico wrote:
And then, shortly after the beginning of the story, you need to
introduce the villain. Thanks, jmf, for taking that position in
On Wed, Dec 11, 2013 at 10:46 PM, Oscar Benjamin
oscar.j.benja...@gmail.com wrote:
This definitely wouldn't work for my students but a friend of mine
studied CS (at Warwick?) and his course worked as Dijkstra describes.
In the first year they don't touch a real programming language or
write
I'm a Python beginner. I want to use it for stats work, so I downloaded
Anaconda which has several of the popular libraries already packaged for Mac OS
X.
Now I'd like to use the backtesting package from zipline (zipline.io), but
while running the test script in iPython, I receive the
I would agree with the previous post but also add that I've stopped
calling the main function main() and usually give it a more
descriptive name, such as bake_cookies() or whatever. I think that
that makes it clearer what it's doing when used as a library and the 'if
__name__ == '__main__'
On Wed, 11 Dec 2013 04:53:41 -0700, Jeff James wrote:
Looking for a script which will check connectivity of any or all of our
company URL's first thing in the morning to make sure none or our sites
are down. Any suggestions ?
Don't reinvent the wheel, use a tool already designed for this
Hi Peter!
I got the message
I know that I could have used a database. I am using for a good reason
the ZODB Database.
I am making things in the ZODB Database persistent, I don't like to
distribute among machines.
Making use of sqlite, won't give me the possibility to scale as the
amount
On 11/12/2013 12:28, Jai wrote:
please guide to make proxy type function in python
Write some code after looking at the documentation
http://docs.python.org/3/.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
On Wed, 11 Dec 2013 04:44:53 -0800, sal wrote:
Now I'd like to use the backtesting package from zipline (zipline.io),
.io is not normally a file extension for Python files. Are you sure
that's Python code?
but while running the test script in iPython, I receive the following
error:
On 11/12/2013 12:44, s...@nearlocal.com wrote:
I'm a Python beginner. I want to use it for stats work, so I downloaded
Anaconda which has several of the popular libraries already packaged for Mac OS
X.
Now I'd like to use the backtesting package from zipline (zipline.io), but
while running
Reordering to un-top-post.
On 11.12.2013 06:47, Dave Angel wrote:
On Wed, 11 Dec 2013 02:02:20 +0200, Tamer Higazi wrote:
Is there a way to get dict by search terms without iterating the
entire
dictionary ?!
I want to grab the dict's key and values started with 'Ar'...
Your wording
On 2013-12-11 13:27, Steven D'Aprano wrote:
On Wed, 11 Dec 2013 04:44:53 -0800, sal wrote:
Now I'd like to use the backtesting package from zipline (zipline.io),
.io is not normally a file extension for Python files. Are you sure
that's Python code?
That's a package name, not a filename.
On Wed, 11 Dec 2013 12:07:08 +0200, Tamer Higazi wrote:
Hi Dave!
You were absolutely right.
I don't want to iterate the entire dict to get me the key/values
Let us say this dict would have 20.000 entries, but I want only those
with Aa to be grabed.
Those starting with these 2 letters
On 09.12.2013 14:25, Chris Angelico wrote:
I found this puzzle again and was thinking about: How would I code a
brute-force approach to this problem in Python?
Ooooh interesting!
Ha, I thought so too :-)
Well, here's a start: There's no value in combining the same value in
an AND or an
In article 32615c9a-b983-4399-bb55-6df6c230f...@googlegroups.com,
JL lightai...@gmail.com wrote:
Python scripts can run without a main(). What is the advantage to using a
main()? Is it necessary to use a main() when the script uses command line
arguments? (See script below)
In article mailman.3895.1386766655.18130.python-l...@python.org,
mar...@letterboxes.org wrote:
I would agree with the previous post but also add that I've stopped
calling the main function main() and usually give it a more
descriptive name, such as bake_cookies() or whatever. I think that
On Wednesday, December 11, 2013 7:47:34 PM UTC+5:30, Roy Smith wrote:
JL wrote:
Python scripts can run without a main(). What is the advantage to using a
main()? Is it necessary to use a main() when the script uses command line
arguments? (See script below)
#!/usr/bin/python
import
On 2013-12-11 13:44, Steven D'Aprano wrote:
If necessary, I would consider having 26 dicts, one for each
initial letter:
data = {}
for c in ABCDEFGHIJKLMNOPQRSTUVWXYZ:
data[c] = {}
then store keys in the particular dict. That way, if I wanted keys
starting with Aa, I would only
On Wednesday, December 11, 2013 5:16:50 PM UTC+5:30, Oscar Benjamin wrote:
The Electrical Engineering students will subsequently do low-level
programming with registers etc. but at the earliest stage we just want
them to think about how algorithms and programs work before going into
all the
In article 3efc283f-419d-41b6-ad20-c2901c3b9...@googlegroups.com,
rusi rustompm...@gmail.com wrote:
The classic data structure for this is the trie:
General idea: http://en.wikipedia.org/wiki/Trie
In python:
http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
I agree
On Tue, 10 Dec 2013 23:28:31 -0800 (PST), Sergey sh0...@gmail.com
wrote:
def get_obj():
pkg = load_package_strict(tmp, basedir)
from tmp import main
return main.TTT()
It is working, but if package code changes on disc at runtime and I
call get_obj again, it returns instance of class,
On 2013-12-11, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
That's like saying that when teaching woodwork we shouldn't
let people use hammers, we should make them use rocks to
bang nails in, because it will make them better carpenters
in the long run.
NAILS
Nails were
On Wednesday, December 11, 2013 8:16:12 PM UTC+5:30, Roy Smith wrote:
rusi wrote:
The classic data structure for this is the trie:
General idea: http://en.wikipedia.org/wiki/Trie
In python:
http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
I agree that a
On Thu, Dec 12, 2013 at 1:44 AM, rusi rustompm...@gmail.com wrote:
It is this need to balance that makes functional programming attractive:
- implemented like any other programming language
- but also mathematically rigorous
Attractive *to the mathematician*. A more imperative style makes
On 2013-12-11 09:46, Roy Smith wrote:
The problem is, that doesn't make a whole lot of sense in Python.
The cited implementation uses dicts at each level. By the time
you've done that, you might as well just throw all the data into
one big dict and use the full search string as the key. It
On 12/11/2013 4:55 AM, JL wrote:
What is the advantage to using a main()?
In addition to what's been said I add:
It separates all the global activities: defining of functions and
classes, importing modules, etc. from the doing the actual task of the
program.
It also ensures that the
On Wednesday, December 11, 2013 8:54:30 PM UTC+5:30, Chris Angelico wrote:
On Thu, Dec 12, 2013 at 1:44 AM, rusi wrote:
It is this need to balance that makes functional programming attractive:
- implemented like any other programming language
- but also mathematically rigorous
Attractive
On 2013-12-11, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
On Tue, 10 Dec 2013 18:25:48 +1300, Gregory Ewing
greg.ew...@canterbury.ac.nz declaimed the following:
On Monday, December 9, 2013 5:53:41 PM UTC+5:30, Oscar Benjamin wrote:
5) Learning to program should be painful and we should
On Thu, Dec 12, 2013 at 2:42 AM, bob gailer bgai...@gmail.com wrote:
It also ensures that the defining all the classes and functions happens
before referencing them (less bookkeeping for me).
These two allow me to write the main program first, and follow it with all
the global stuff.
I
On 11/12/2013 15:41, rusi wrote:
When the ten becomes ten-thousand, written by a nut who's left you with
code whose semantics is dependent on weird dependencies and combinatorial
paths through the code you start wishing that
... he'd not been a Led Zeppelin fan, whereby every
On 12/11/2013 3:43 AM, Chris Angelico wrote:
When you tell a story, it's important to engage the reader from the
start...explain This is how to print Hello World to the
console and worry about what exactly the console is (and how
redirection affects it)
Highly agree. I was once given FORTRAN
On Thu, Dec 12, 2013 at 2:41 AM, rusi rustompm...@gmail.com wrote:
Yes its always like that:
When you have to figure 2 (or 10) line programs its a no-brainer that
the imperative style just works.
When the ten becomes ten-thousand, written by a nut who's left you with
code whose semantics is
On 11/12/2013 00:02, Tamer Higazi wrote:
Hi people!
Is there a way to get dict by search terms without iterating the entire
dictionary ?!
Let us assume I have:
{'Amanda':'Power','Amaly':'Higgens','Joseph':'White','Arlington','Black','Arnold','Schwarzenegger'}
I want to grab the dict's key
On 11/12/2013 16:01, bob gailer wrote:
One student (PhD in Physics) looked at X = X + 1 and said no it doesn't.
Someone I worked with used x := x - x - x to invert a number.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark
On Thu, Dec 12, 2013 at 3:01 AM, bob gailer bgai...@gmail.com wrote:
One student (PhD in Physics) looked at X = X + 1 and said no it doesn't.
Yeah, which is why some languages (I first met it with Pascal) spell
that as X *becomes* X + 1... but regardless of what you call it,
there's a
On 11/12/2013 16:04, Chris Angelico wrote:
I strongly believe that a career
programmer should learn as many languages and styles as possible, but
most of them can wait.
I chuckle every time I read this one. Five years per language, ten
languages, that's 50 years I think. Or do I rewrite my
In 58f7bd2a-ef82-4782-b4fb-db824f9c8...@googlegroups.com
smilesonisa...@gmail.com writes:
File aaa.py, line 5, in module
from ccc.ddd import sss
ImportError: No module named ccc.ddd
directory structure as follows:
ccc
|
ddd
|
aaa.py
On Thu, Dec 12, 2013 at 3:18 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
On 11/12/2013 16:04, Chris Angelico wrote:
I strongly believe that a career
programmer should learn as many languages and styles as possible, but
most of them can wait.
I chuckle every time I read this one. Five
On Wednesday, December 11, 2013 9:31:42 PM UTC+5:30, bob gailer wrote:
On 12/11/2013 3:43 AM, Chris Angelico wrote:
When you tell a story, it's important to engage the reader from the
start...explain This is how to print Hello World to the
console and worry about what exactly the console is
On Wed, 11 Dec 2013 08:27:23 -0800, rusi wrote:
[BTW: From the theoretical POV, imperative programming is 'unclean'
because of assignment statements. From the practical POV of a teacher,
the imperativeness of print is a bigger nuisance in students' thinking
patterns ]
+1 on this
Trying to
On Thu, Dec 12, 2013 at 3:27 AM, rusi rustompm...@gmail.com wrote:
However when we have an REPL language like python, one has the choice
of teaching the hello-world program as:
print (Hello World)
or just
Hello World
The second needs one more assumption than the first, viz that we are in
On Dec 11, 2013, at 5:31 AM, rusi rustompm...@gmail.com wrote:
The classic data structure for this is the trie:
General idea: http://en.wikipedia.org/wiki/Trie
In python:
http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
My thoughts exactly!
If you wade through
On 11/12/2013 17:19, Travis Griggs wrote:
On Dec 11, 2013, at 5:31 AM, rusi rustompm...@gmail.com wrote:
The classic data structure for this is the trie:
General idea: http://en.wikipedia.org/wiki/Trie
In python:
http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
On Dec 11, 2013, at 12:50 AM, Dan Stromberg drsali...@gmail.com wrote:
Now the question becomes: Why did chardet tell me it was windows-1255? :)
As it says on the tin: chardet guesses the encoding of text files. The
operative word is ‘guesses’.
--
Hi,
On Wed, 11 Dec 2013 04:53:41 -0700
Jeff James wrote:
Looking for a script which will check connectivity of any or all of our
company URL's first thing in the morning to make sure none or our sites are
down. Any suggestions ? Thank You
This really is not a suggestion because the
On 12/10/13 6:50 PM, Dan Stromberg wrote:
On Tue, Dec 10, 2013 at 1:07 PM, Petite Abeille
petite.abei...@gmail.com mailto:petite.abei...@gmail.com wrote:
On Dec 10, 2013, at 6:25 AM, Dan Stromberg drsali...@gmail.com
mailto:drsali...@gmail.com wrote:
The IMDB flat text file
I know the problem is with the for loop but don't know how to fix. Any help
with explanation would be appreciated.
#!/bin/env python
import csv
import sys
if len(sys.argv) 3:
print('Please specify a filename and column number: {} [csvfile]
[column]'.format(sys.argv[0]))
sys.exit(1)
On 2013-12-11 11:10, brian cleere wrote:
filename = sys.argv[1]
column = int(sys.argv[2])
for line in filename() , column ():
elements = line.strip().split(',')
values.append(int(elements[col]))
1) you need to open the file
2) you need to make use of the csv module on that file
On Thu, Dec 12, 2013 at 6:10 AM, brian cleere briancle...@gmail.com wrote:
I know the problem is with the for loop but don't know how to fix. Any help
with explanation would be appreciated.
Your problem is akin to debugging an empty file :) It's not so much a
matter of fixing what's not
Hello All,
I am looking for a library that can help me trace the status of a live
python script execution. i.e if I have a python script `x.py` with 200
lines, when I execute the script with `python x.py`, is there a way to
trace the status of this execution in terms of number of lines executed
On 11/12/2013 19:10, brian cleere wrote:
I know the problem is with the for loop but don't know how to fix. Any help
with explanation would be appreciated.
#!/bin/env python
import csv
You never use the csv module.
import sys
if len(sys.argv) 3:
print('Please specify a filename and
On Thu, Dec 12, 2013 at 6:26 AM, Shyam Parimal Katti spk...@nyu.edu wrote:
I am looking for a library that can help me trace the status of a live
python script execution. i.e if I have a python script `x.py` with 200
lines, when I execute the script with `python x.py`, is there a way to trace
On 11/12/2013 19:22, Chris Angelico wrote:
On Thu, Dec 12, 2013 at 6:10 AM, brian cleere briancle...@gmail.com wrote:
I know the problem is with the for loop but don't know how to fix. Any help
with explanation would be appreciated.
Your problem is akin to debugging an empty file :) It's not
On Thu, Dec 12, 2013 at 6:41 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
Square brackets in a usage description often mean optional. You may
want to be careful of that. There's no really good solution though.
There is, https://pypi.python.org/pypi/docopt/0.6.1 :)
That appears to use x
On 11/12/2013 19:46, Chris Angelico wrote:
On Thu, Dec 12, 2013 at 6:41 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
Square brackets in a usage description often mean optional. You may
want to be careful of that. There's no really good solution though.
There is,
On Thu, Dec 12, 2013 at 7:00 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
I use the alternative X for a mandatory argument X.
Also common, but how do you specify a keyword, then? Say you have a
command with subcommands:
$0 foo x y
Move the foo to (x,y)
$0 bar x y z
Go to bar X, order a Y,
On 12 December 2013 03:25, Chris Angelico ros...@gmail.com wrote:
On Thu, Dec 12, 2013 at 3:18 AM, Mark Lawrence breamore...@yahoo.co.uk
wrote:
On 11/12/2013 16:04, Chris Angelico wrote:
I strongly believe that a career
programmer should learn as many languages and styles as possible,
On 2013-12-12 07:03, Chris Angelico wrote:
Also common, but how do you specify a keyword, then? Say you have a
command with subcommands:
$0 foo x y
Move the foo to (x,y)
$0 bar x y z
Go to bar X, order a Y, and Z it [eg 'compress', 'gzip', 'drink']
How do you show that x/y/z are
On 11/12/2013 20:03, Chris Angelico wrote:
On Thu, Dec 12, 2013 at 7:00 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
I use the alternative X for a mandatory argument X.
Also common, but how do you specify a keyword, then? Say you have a
command with subcommands:
$0 foo x y
Move the foo
On Wed, Dec 11, 2013 at 6:38 AM, Robert Kern robert.k...@gmail.com wrote:
On 2013-12-11 13:27, Steven D'Aprano wrote:
On Wed, 11 Dec 2013 04:44:53 -0800, sal wrote:
Now I'd like to use the backtesting package from zipline (zipline.io),
.io is not normally a file extension for Python files.
On 12/11/2013 5:26 AM, Ben Finney wrote:
Better design is to make the argument list a parameter to the ‘main’
function; this allows constructing an argument list specially for
calling that function, without ‘main’ needing to know the difference.
You'll also want to catch SystemExit and return
On 12/11/2013 12:34 AM, Devin Jeanpierre wrote:
On Tue, Dec 10, 2013 at 2:02 PM, Ethan Furman et...@stoneleaf.us wrote:
Doesn't sound like they do, as that's causing plenty of problems. In
today's world that level of knowledge isn't always necessary, especially if
your degree is not in CS.
On Wed, Dec 11, 2013 at 10:35 AM, Ned Batchelder n...@nedbatchelder.comwrote:
On 12/10/13 6:50 PM, Dan Stromberg wrote:
Now the question becomes: Why did chardet tell me it was windows-1255? :)
It probably told you it was Windows-1252 (I'm assuming the last 5 is a
typo).
Windows-1252 is a
I have an ethernet-rs232 adapter which allows me to connect to a measurement
instrument by means of netcat on a linux system.
e.g. entering nc 10.128.59.63 7000
allows me to enter e.g.
*IDN?
after which I get an identification string of the measurement instrument back.
I thought I could
Long ago, I saw a C program that took another C program as input. It would
output a copy of the original C program, interspersed with fprintf's that
would display the text of the line current being executed.
You might write something similar for Python, perhaps outputting the line
being executed
On Wed, Dec 11, 2013 at 3:08 PM, Jean Dubois jeandubois...@gmail.comwrote:
I have an ethernet-rs232 adapter which allows me to connect to a
measurement instrument by means of netcat on a linux system.
e.g. entering nc 10.128.59.63 7000
allows me to enter e.g.
*IDN?
after which I get an
On Wed, 11 Dec 2013 15:07:35 -0800, Dan Stromberg wrote:
$ chardet mpaa-ratings-reasons.list
mpaa-ratings-reasons.list: windows-1255 (confidence: 0.97)
I'm aware that chardet is playing guessing games, though one would hope
it would guess well most of the time, and give a reasonable
On Wed, Dec 11, 2013 at 3:24 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Wed, 11 Dec 2013 15:07:35 -0800, Dan Stromberg wrote:
$ chardet mpaa-ratings-reasons.list
mpaa-ratings-reasons.list: windows-1255 (confidence: 0.97)
I'm aware that chardet is playing
Jean Dubois jeandubois...@gmail.com writes:
I have an ethernet-rs232 adapter which allows me to connect to a
measurement instrument by means of netcat on a linux system.
e.g. entering nc 10.128.59.63 7000
allows me to enter e.g.
*IDN?
after which I get an identification string of the
I have some code which produces a list from an iterable using at least
one temporary list, using a Decorate-Sort-Undecorate idiom. The algorithm
looks something like this (simplified):
table = sorted([(x, i) for i,x in enumerate(iterable)])
table = [i for x,i in table]
The problem here is that
On 12/11/2013 01:41 PM, Mark Lawrence wrote:
On 11/12/2013 19:22, Chris Angelico wrote:
There is, https://pypi.python.org/pypi/docopt/0.6.1 :)
+1 for docopt. It makes everything very clear. Just type out your usage
string, and then run docopt(usage_str) on it to get a dict of your args.
1 - 100 of 214 matches
Mail list logo