iven)
Look at your __init__ method for Cone().
Look at your invocation.
Each call to Cone only supplies a single argument.
... Cone(1.1),Cone(1.2) ...
- -Martin
- --
Martin A. Brown
http://linux-ip.net/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: pgf-0.72 (ht
mv --target-directory "$dstdir" --
The --target-directory option is only available in GNU mv (and cp),
I believe.
I'll second the recommendation for 'shutil', although you can have
some fun playing with recursion by building your tree flattener
using os.wa
from your python
modules. Much easier than building your own.
Good luck,
- -Martin
[0] http://sphinx.pocoo.org/
http://sphinx.pocoo.org/contents.html
http://pypi.python.org/pypi/Sphinx
- --
Martin A. Brown
http://linux-ip.net/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9
t in an easily removable manner,
especially if performance is paramount.
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ere, JoJo. Maybe some
of the others on this list can help.
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
((1,))
for x in range(2, int(n**.5)+1):
factor, mod = divmod(n,x)
if mod == 0:
pd.update((x,factor))
return list(pd)
Have a great day,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
>>> word_table = dict()
>>> w = words[0]
>>> word_table[w] = words.count(w)
>>> word_table
{'in': 1}
>>> w = words[1]
>>> word_table[w] = words.count(w)
>>> word_table
{'the': 3, 'in': 1}
Onc
mask -= 1
return networks
if __name__ == '__main__':
for ip in sys.argv[1:]:
networks = list_networks( ip );
for network in networks:
print network
print
# -- end of file
- --
Martin A. Brown
http://linux-ip.net/
-BEGIN PGP SIGNATURE---
, 17, 12, 38, 4, 40, 17, 19 ]
l = map( filt_seq, l )
Good luck,
- -Martin
- --
Martin A. Brown
http://linux-ip.net/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: pgf-0.72 (http://linux-ip.net/sw/pine-gpg-filter/)
iD8DBQFKonmNHEoZD1iZ+YcRAme7AKDqThvHP6+3xbzBg1p48
#tz = fields[4]
d = int( time.mktime( time.strptime(fields[3], "[%d/%b/%Y:%H:%M:%S") ) )
print d, line,
- --
Martin A. Brown
http://linux-ip.net/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: pgf-0.72 (http://linux-ip.net/sw/pine-gpg-fi
'\n' )
Now, how would you call this function?
if __name__ == '__main__':
test(sys.stdin, sys.stdout, sys.argv[1])
And, suppose you were at a command line, how would you call that?
python tabbed-reader.py < "$MYFILE" 'key'
OK, so the above functio
faced with a problem like this in
the future, ask yourself not only about what tools like csv.reader
you may have at your disposal, but also what data structures are
suited to your questions of your data.
: I am in need of the solution as client breathing down
least, to understand the
operators you are trying to use:
http://docs.python.org/reference/expressions.html#unary-arithmetic-and-bitwise-operations
http://docs.python.org/reference/expressions.html#boolean-operations
http://docs.python.org/reference/expressions.html#summary
This may also
aybe he'll be out on probation.
Adjusting your code (instead of the dictionary approach I suggested
above), I'd suggest using your list variable directly!
varlist = []
for i in myfiles:
varlist.append( makeTuple( i ) )
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net
yes. I think you would benefit from
looking at what sort of string methods there are and what they do.
The strip() method is one of the first to learn. The split() should
be your second. Keep on going, and you'll find all sorts of goodies
in there. And, enjoy Python!
-Martin
--
Mart
h you answered. You might also find one or two of these
(mis)leading and might want to tell me about corner cases that you
as a developer have faced. That would also be interesting to me as
a technical interviewer.
-Martin
[0] http://www.quotationspage.com/quote/12220.html
--
Martin
lements that you wish to extract.
Chances are that somebody has already implemented a feature to do
this sort of thing. Doesn't it seem like a pretty rational sort of
thing to have a compute do? Select a bunch of elements randomly
from an input set?
So, let's try this one of two different ways. Using option A, you
can mix up your data and repeatedly pull out the same result
for the N items:
random.shuffle(series)
''.join(series[0:p])
In option B, you would get a different result each time:
''.join(random.sample(validchars,p))
So, I would rewrite your function to be (substituting 'charcount'
for 'p'):
#! /usr/bin/env python
import string
import random
def new_pass(charcount):
validchars = string.ascii_letters + string.digits + string.punctuation
series = list( validchars )
random.shuffle(series)
print ''.join(series[0:charcount])
if __name__ == '__main__':
new_pass(int(input("Enter the length you want your password to be: ")))
Two others have already suggested that you look at the string and
random modules. Here's just one example of how you could use them
together. Now, let's see what you do with MD5 and SHA. (You are
looking at 'hashlib', correct?)
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
s how to create/save anything other than ASCII without this
(slightly hackish) hint.
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
to a list of strings:
>>> [str(x) for x in range(10)]
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
Now, concatenate them and separate with some spacedash!
>>> vis
I can see no difference in the syntax, though there
: must clearly be one. :-(
:
: I am at a loss as to what to do next. (It is the next exercise
: that is supposed to have errors in for us to put right!!!)
:
: Pointers in the right direction very gratefully received!
Try again, keep w
ther than the string.
There are doubtless more experienced hands here who will suggest
concretely what you might do, but I would suggest that you use %s
(string) for anything that you want to show to an end user and %r
iif* you are planning to (re-)consume your own printed output.
-Martin
* iif = if and only if
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
, 'd')
:
: I tried with zip(), but get a list of tuples, which isn't the desired
: output. Anyone with a solution or push in the right direction?
Perhaps you did not know about enumerate?
t = ('a', 'b', '
f = open(fname,'r')
quotations = ''.join(f.readlines()).split('%')
[0] http://docs.python.org/library/stdtypes.html#file-objects
[1] http://www.faqs.org/docs/artu/ch05s02.html
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
upport for
homework, but, as tutors, we are very happy to help you understand
Python and how to make it do what you want.
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opt
')
for row in reader:
print 'The capital of %s is %s' % (row[0], row[1],)
The above is trivial, but if you would like some more substantive
assistance, you should describe your problem in a bit more detail.
-Martin
--
Martin A. Brown
http://linux-ip.net/
_
are a number of libraries that can help with
the mathematical operations and you will probably get many good
suggestions.
Welcome to the list,
-Martin
[0] http://wiki.python.org/moin/Python2orPython3
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Greetings Elaina,
I will echo Alan's remarks--it sounds like you are using a quite
specialized (specialised?) module. It is certainly not a module
with which I am familiar, not in the standard library, and not a
commonly encountered problem. I would classify this module as
domain-specific.
gt;> now
datetime.datetime(2012, 2, 16, 17, 15, 46, 655472)
>>> now + twohrsago
datetime.datetime(2012, 2, 16, 19, 15, 46, 655472)
>>> then = now + twohrsago
>>> then.strftime('%F-%T')
'2012-02-16-19:15:46'
I would add my voice to Ramit Prasad
ed to in perl.
>>> import collections
>>> d = collections.defaultdict(collections.defaultdict)
>>> a,b,c = range(3)
>>> d[a][b] = c
>>> d
defaultdict(, {0: defaultdict(None, {1: 2})})
Have a look at the collections module. Se
e you are using Linux, you may find strace useful
to see what Python is passing to your system for execution:
strace -e process python /path/to/your/python/script.py
Enjoy,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
d (well, anyway, not comma-separated). The
csv and pandas libraries allow for delimiter='\t' options to
most object constructor calls. So, you could do:
csv.reader(f,delimiter='\t')
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
w.python.org/dev/peps/pep-0008/
Good luck and enjoy Python,
-Martin
[0] http://shop.oreilly.com/product/9780596007973.do
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
though. I would agree, having a concrete task to approach is a good
way to learn.
Enjoy,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
onaries, so you
might benefit from looking at the other sorts of things that you can
do with dictionaries.
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
s, -Selby
Try the two techniques here (and the one Joel just posted):
http://mail.python.org/pipermail/tutor/2012-June/090025.html
-Martin
(You asked your question much more clearly this time and with a code
sample--so, keep it up and enjoy the Python.)
--
Marti
llections
summary = collections.defaultdict(int)
for line in lines:
words = line.strip().split()
for word in words:
summary[word] += 1
Lots of interesting features in the collections module...
-Martin
--
Martin A. Brown
http://linux-ip.net/
__
))
I would be quite surprised if there were not more efficient ways of
accomplishing this.
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
e above, but you can create it on the fly with a different
#value for the shift. You could also use a different alphabet.
#
def generate_caesar_cipher(alphabet,shift):
offset = shift - len(alphabet)
cipheralpha = ''.join((alphabet[offset:], alphabet[0:offset]))
return dict(zip(alphabet,cipheralpha))
caesar_shift = 3
values = dict()
values.update(generate_caesar_cipher(string.ascii_letters,caesar_shift))
One other thing to consider is that you can use the underutilized
function 'translate' from the string module. The 'maketrans'
function creates a translation table and the 'translate' function
applies that to input.
def alt_trans(plain_alpha,shift):
offset = shift - len(plain_alpha)
cipher_alpha = ''.join((plain_alpha[offset:], plain_alpha[0:offset]))
return string.maketrans(plain_alpha,cipher_alpha)
plaintext = 'Alea iacta est.'
shift_cipher = alt_trans(string.ascii_letters, caesar_shift)
ciphertext = string.translate(plaintext,shift_cipher)
Enjoy Python!
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
out
nuance, I would point out that this is no nuance but a significant
feature which can surprise you later if you do not understand what
is happening with the slicing notation.
Best of luck and enjoy a fried slice of Python!
-Martin
[0]
https://docs.python.org/3/library/stdtypes.h
a lowering cow.
to lower (v.i.), to be or become dark, gloomy, and threatening
(which is cognate to the contemporary German word 'lauern')
And, I dairy not chase this pun any further....
-Martin
[0] http://www.merriam-webster.com/dictionary/lower
--
Martin A. Brown
http://l
f the lines in the code under test which are
NOT yet tested; handy!
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
use the above, if you like it.
I wish you exceptional luck,
-Martin
[0] https://docs.python.org/2/library/difflib.html
[1] https://docs.python.org/3/library/exceptions.html#Exception
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillis
500 IPs).
May I wish you good luck resolving not just your addresses, but also
your problem!
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Hi there,
In [1]: help list
File "", line 1
help list
^
SyntaxError: invalid syntax.'
Question: What is the correct help command?
Try:
help(list)
Snipped from my ipython session:
In [1]: help(list)
Good luck,
-Martin
--
Martin A. Brown
http
s located at
http://tinyurl.com/odt9nhe
Also, I'm including your short data sample:
But soft what light through yonder window breaks
It is the east and Juliet is the sun
Arise fair sun and kill the envious moon
Who is already sick and pale with grief
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
fundamentally, he and I are
saying the same thing. Think about where you are initializing
your variables, and know that 'addresses = set()' in the middle
of the code is re-initializing the variable and throwing away
anything that was there before..
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ook my little
anemic laptop about 12.8 seconds to count through the loop. So,
before accounting for any work that you plan to undertake inside the
loop, you have a runtime of ~115 seconds.
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist
x27;d recommend playing with the data in an interactive console
session. You will be able to figure out exactly which xpath gets
you the data you would like, and then you can drop it into your
script.
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
_
maintained and designed outside of the Python program.
[3] https://groups.google.com/forum/#!forum/sqlalchemy
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ted items from
the input list? The random module provides random.sample() to
select n items from a sequence.
If so, try this out at the intercative prompt. Perhaps this is what
you are looking for?
>>> import random
>>> import string
>>> l = list(string.l
it's anonymous access, use HTTP.
If authenticated access, use ssh/scp/sftp.
Good luck,
-Martin
[0] http://www.networksorcery.com/enp/protocol/icmp/msg3.htm
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ous access, use HTTP.
If authenticated access, use ssh/scp/sftp.
Good luck,
-Martin
[0] http://www.networksorcery.com/enp/protocol/icmp/msg3.htm
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
;ab'?
If I understand you correctly, something like this:
>>> counts = {'ab':0,'ac':0,'bc':0,'ad':0,'ae':0,'de':0}
>>> for combo in it.combinations(counts.keys(),3):
... for pair in combo:
...counts[pair] += 1
...
>>> counts
{'ac&
players = list(string.ascii_uppercase)
random.shuffle(players)
# players = set('ABCDEFGHIJ')
pcount = 2 # players per game
gcount = 3 # games per match
rcount = 7
he] Python language.
You will always benefit from thinking deeply about what you hope to
accomplish before starting to code. (I have known quite a few
programmers with decades of experience who will not touch the
computer until they have written a description of the problem on
paper.)
Also: There is
-statistics
Thggere are other, richer tools in third-party libraries if you are
looking for more advanced tools. But, perhaps you only need to
start with the above.
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor
rst exactly his task
to be accomplished. But my knowledge goes only
as far as "Python for Infomatics" (by MOOC/Coursera) and "Practical
Programming" . I know there are a myriad of other
modules and tools etc. and there I need the help of "Pythonistas".
To where should I
ta(open(sys.argv[1], 'rb'), 'i')
print(len(data))
P.S. You'll see that I didn't have a mess of unsigned integers
hanging around in a file, so you can see how I generated and
stored them in write_data and gen_data).
--
Martin A. Brown
http://linux-ip.net/
_
l.
There is the benefit, then, of your code being agnostic (or
extensible) to the serialization tool.
By the way, did you know that pandas.to_csv() [0] also exists?
-Martin
[0]
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_csv.html
--
Martin A.
quot;check.txt", "r+")
I would, therefore write your program like this:
input1 = raw_input("Input1:")
f = open("check.txt", "w")
f.write(input1 + "\n")
f.close()
f = open("check.txt",
first position. A
minor improvement would be to only prepend the PYTHONPATH and
required colon if there's a value to PYTHONPATH already. So, this
little beautifully obnoxious bash parameter expansion gem will
accomplish that for you:
PYTHONPATH="${PYTH
ttps://docs.python.org/3/tutorial/
https://docs.python.org/3/tutorial/controlflow.html
If you have more specific details on what you are trying to
accomplish and/or learn, then send along those questions!
Good luck as you get started,
-Martin
--
Martin A. Brown
http://linux-ip.net/
, if all of your values (temperature) are within the
range you want to display, you don't need to mess with the axes.
See their tutorial:
http://matplotlib.org/users/pyplot_tutorial.html
Good luck and enjoy!
-Martin
[0] http://ipython.org/
[1] http://ipython.org/notebook.html
--
Mar
:
n = 94152743499601547 #untuk difaktorkan
faktor_1, faktor_2 = faktorisasi(n)
print faktor_1
print faktor_2
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
are different strategies depending on what you are doing with
the software and the environment in which you are working.
Good luck and have fun with Python in 2016, since you have arrived
there before the rest of us,
-Martin
P.S. Two questions: should I buy some some YHOO stock and should I
77'],
'key4': ['value77', 'value1']}
What would you expect to be returned here:
keys_of_interest = get_all_keys_if_value(newdic, 'value77')
Well, they should be:
['key3', 'key2', 'key4'] # -- keys_of_intere
ng all of that unprocessed data
in the variable 'data' in the dataRecv function.
Specifically, your problem is about breaking the data apart and
using it all. You might benefit from studying techniques for
breaking a text apart by paragraph. Think about how this applies to
your problem:
http://code.activestate.com/recipes/66063-read-a-text-file-by-paragraph/#c1
N.B. The code example may not be utterly perfect, but it is
precisely the same problem that you are having.
Good luck and enjoy,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
;s my answer:
from random import choice
def dish(options):
return choice(options)
Then, the function dish() will return exactly one element from the
options. Since each of soup, salads, main and beverage are lists
with string elements, the dish() function will return a string.
I would like to have some Onion soup, the Crab cake, Rum and a
Caesar, please.
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
xperienced Windows/POSIX user trying to understand
open() in Python if it were available in the standard documentation.
Thanks for mapping this to common operating systems. I had inferred
this already, but this is a great summary.
-Martin
--
Martin A. Brown
http://linux-ip.net/
situ modification magic tricks, they (and you)
will have no guarantees about what data they will receive. That
will be left up to the operating system (i.e. kernel).
So, take control of the data back into your own hands by taking
adavantage of the beauty of the filesystem.
Filesystem at
path(sys.argv[1])
>y = map(str.lower, path.split())
Next question: What exactly are you trying to do with that third
line? It looks confused.
Good luck,
-Martin
[0] https://docs.python.org/3/library/os.path.html#os.path.abspath
--
Martin A. Brown
h
ess concerned about filesystem interactions and really
just want an individual thingy that that behaves like a file, but
can be constructed in memory, use StringIO (or cStringIO).
Good luck!
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
just want an individual thingy that that behaves like a file, but
>> can be constructed in memory, use StringIO (or cStringIO).
>
>Isn't option D what Danny was using to make option B? Or are you
>saying keep things even simpler?
Oh dear--yes. Apologies, Danny and
ggest
that you convert the serialized representation of the data (a
string) into an object or datatype in memory that allows you to
perform the desired sorting, computation, calculation or
range-finding. Also, if you have a smaller block of code and data,
we may find it easier to make spe
s()
# -- class attribute can be overridden in instances
c.redefine_in_instance()
c.oh_there_it_is()
# -- newly defined instances will get the default class attribute
d = MyClass()
d.oh_there_it_is()
--
Martin A. Brown
http://linux-ip.net/
__
ps me to see my own errors.
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ss.
>but I get an error if I try
>
>from datetime.datetime import now, strftime
If you are mostly interested in shortening your import statement, I have seen
people use this sort of technique:
>>> from datetime import datetime as dt
>>> now = dt.now()
>>> now.strftime('%F-%T')
'2016-02-21-18:30:37'
Good luck and enjoy,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
come to the world of Python!
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
icontrol')
You should see the name 'uicontrol' and the contents of each tag,
stripped of all surrounding context.
The above snippet is really just an example to show you how easy it
is (from a coding perspective) to use lxml. You still have to make
the investment to understand how lx
ine that on my box, I can
only handle 988 calls to the same function before triggering the
maxmimum recursion depth exceeded error.
Given that your question was recursion, I chose to focus on that,
but I would recommend using the simplest tool for the job, and in
this case that wou
I do not know if other people have found this list behaviour
surprising when writing in both languages, but I do like the Python approach
better on the list handling.
The standard library contains a wider assortment of tools than the Perl
standard library, so when you are looking for a toolkit
with the different datatypes and functions.
If you have more questions, please ask here, there are quite a few
others who are happy to help.
Best of luck,
-Martin
Tutorial: https://docs.python.org/2/tutorial/introduction.html
on numbers: https://docs.python.org/2/tutorial/in
;__main__':
proggie, args = sys.argv[0], sys.argv[1:]
if len(args) == 1:
fname = args.pop()
sys.exit(cli_ris(fname))
elif len(args) == 2:
fname, step = args
step = int(step)
sys.exit(cli_ris(fname, step=
first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
(__main__.BillTest) ... ok
>test_input_not_float_raises_ValueError (__main__.BillTest) ... Not a float
>FAIL
Good luck!
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ry/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange
#
print 'slice out from your original data: ', data[1::2]
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
appens when you try these yourself:
>>> ham = list('spam')
>>> '-'.join(ham)
>>> ':'.join(ham)
>>> 'B'.join(ham)
>>> ''.join(ham)
Hopefully, you see that there's no magic here
clear resemblance to R. I think numpy is one of the oldest
scientific computational libraries available for Python.
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
at.S_IRWXU & os.stat('/usr/bin/python').st_mode
Better yet? Let os.access() [1] do the bitmath for you:
os.access('/usr/bin/python', os.X_OK)
Good luck,
-Martin
[0] http://docs.python.org/2/library/stat.html
[1] http://d
.scipy.org/
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
admittedly brain-dead function,
there's not a performance bottleneck. If you can find the parts of
your skymaps5.py code that are the bottleneck, then you could post
it here.
I hadn't thought of using interpolate, myself, as I didn't even know
it existed.
Thanks an
z, oo, text_contens
Good luck tracking down your peformance issue!
-Martin
[0] https://docs.python.org/2/library/logging.html
https://docs.python.org/3/library/logging.html
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
tandard library tools (urllib, and
urllib2) unless you need that finer control.
This has a nice abstraction and, from your description, I think this
would be a good fit:
http://docs.python-requests.org/en/latest/
-Martin
--
Martin A. Brown
http
Work for them. Keep reading. Hire them.
Keep writing. Keep reading.
[3] Oops. I learned on BASIC. I hope I do not get banned from
the list.
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or c
python.org/2/library/multiprocessing.html
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Greetings Alessandro,
: We are currently investigating different languages and technologies to
: develop an command line administration utility.
: Python is one of the options we are looking at for the job but currently we
: have no relevant skill set so I thought I'd post some question to ge
ys.argv[1], sys.argv[2:])
I happen to be the sort of person who always wants to point out the
IP-related tools available in Python hence my reply to your post.
Happy trails and good luck,
-Martin
[0]
https://apps.db.ripe.net/search/query.html?searchtext=25.0.0.0/8&source=RIPE#resultsAncho
bling blocks, so run 'python -V' to make
sure you are reading the correct documentation:
https://docs.python.org/2/ # -- Python-2.7.x
https://docs.python.org/3/ # -- Python-3.4.x
--
Martin A. Brown
http://linux-ip.net/
___
Tutor ma
vorpfeifen grasgarten.'
pattern = re.compile('ei', re.IGNORECASE)
matched = pattern.search(s,0)
while matched:
endpos = matched.end()
print(matched.group(0), matched.start(), matched.end())
tions/712791/what-are-the-differences-between-json-and-simplejson-python-modules
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
1 - 100 of 123 matches
Mail list logo