ted
libraries to make your job easier, as are many of these other data
serialization libraries.
I hope the above was helpful in explaining some of the concepts.
-Martin
[0] https://en.wikipedia.org/wiki/Serialization#Pickle
[1] Please note, there are probably better places to read about J
did anything with
environment variables, I would add that here.
You will also see that I don't mess with sys.stderr. In general, I
like to stay away from redirecting that unless there's a strong
need.
Benefits:
* you can call cli() in your testing programs with different lists
-- warning, we are about to change the value for Foo.x')
print()
Foo.x = 6.022141e-23
print('# -- f.x retrieves class value, f.y instance value')
print('f.x = %s, f.y = %s, Foo.x = %s' % (f.x, f.y, Foo.x))
print()
f.removeinstancex()
print('# --
So should we always use sets or dictionaries if possible? Are these more
efficient because of not keeping track of their position?
On Fri, Oct 19, 2018 at 10:47 AM Pat Martin wrote:
> That's correct sorry, I reassigned with replace back to string2, I forgot
> that in my retyping of
Mats Wichmann wrote:
>
> > On 10/19/2018 10:12 AM, Pat Martin wrote:
> >> Sorry my first email didn't have a subject line
> >>
> >> TLDR; How do you figure out if code is inefficient (if it isn't
> >> necessarily obvious) and how do you find
Sorry my first email didn't have a subject line
TLDR; How do you figure out if code is inefficient (if it isn't necessarily
obvious) and how do you find a more efficient solution?
I use code wars sometimes to get some practice with Python, there was a
challenge to compare two strings and if strin
TLDR; How do you figure out if code is inefficient (if it isn't necessarily
obvious) and how do you find a more efficient solution?
I use code wars sometimes to get some practice with Python, there was a
challenge to compare two strings and if string1 had enough characters to be
rearranged to make
7;MIBMMCCO', 'YOWHHOY', 'OFHCMLIP', 'OFHCMLIPZ', 'FHCMLIP', 'NEGBQJKR']
needle = set('OFHCMLIP')
for haystack in farm:
partial = needle.intersection(haystack)
exact = needle.intersection(haystack) == needle
prin
Hello all,
I am writing a script that will be using an API to connect to some systems
to pull info for a search. Since it will be a script I will be running
through cron I won't be able to type the password at time of running. I
also am going to be putting this in source control, using git specifi
Thank you all for the ideas and comments, it is appreciated.
I have some refactoring to do now.
On Fri, Mar 30, 2018 at 2:22 AM, Peter Otten <__pete...@web.de> wrote:
> Pat Martin wrote:
>
> > I have written the following program. It generates a template for Pelican
&
st', metavar="")
parser.add_argument("-t", "--tags", type=str, required=True,
help="Tags for post", metavar="")
parser.add_argument("-a", "--author", type=str, default="Pat Martin",
Hello,
I have recently written a program to add switches and hosts to my ssh
config file, I use argparse for some switches like user name and such and
it has been working pretty well.
I was thinking of turning this into a web app (one that is just run on my
local machine) something like have a f
user types '0r' it will be removed from the beginning of the
>queue.
Once you have the addition of items to the queue and the looping
worked out to your satisfaction, maybe you could share your progress
and there might be somebody to provide a bit mor
t and have written a couple useful scripts but still very
much a beginner and there are definite holes in my knowledge. Hoping this
class fills in some of the holes.
Thanks again all for the suggestions and the tips.
On Wed, Sep 6, 2017 at 8:01 AM, Pat Martin wrote:
> I knew it was an assi
s
for that as well.
The reason I haven't used regex/methods/etc is it hasn't been covered yet,
we have only covered basic types, for, while and if statements.
On Wed, Sep 6, 2017 at 1:54 AM, Alan Gauld via Tutor
wrote:
> On 06/09/17 06:34, Pat Martin wrote:
>
> > but my s
Hello all,
I am trying to write a program for a programming class that finds the
number of a specific string (bob) in a string of characters. I am using one
of the sample strings they give me and it should find 2 instances of bob
but my script returns 0. Since they want it to find 2 from the bobob
o find a path?
What does the path (through this graph) tell you?
What do (x, y) represent in that picture?
Good luck, Michael, in exploring Python for playing with graphs. I
think you may find that networkx will address almost anything you
can throw at it for quite some time. And, we
mind that you are creating a tuple when you include
the comma in the line that ends with: (self.ucc),
I have, therefore, a few small suggestions:
1. Put all of the variables replacements at the end.
thing = ("var x=%s\nvar y=%s" % (x,y))
2. When creating the replacements,
ample of using "in":
>In other words, why is the data such that you *need* to know whether it
>is a set versus a string, before using it? Can the data be handled
>differently such that the condition you describe isn't a prerequisite?
And, this is the key question.
Good luc
Greetings,
>Thank you very much Martin; you filled in a lot of details. I had an
>overall understanding of what unittest does, but you have now enhanced
>that understanding substantially.
Happy to help! I'll introduce you to my little menagerie below!
>I'm still iffy
from the class
>TestFuncAcceptsSequenceMixin, those classes don't have any methods
>that they call on that class, so how does its code get run? I suspect
>that the mixin's concepts is where I am stumbling. I have yet to find
>a reference that is making things clear to me,
untrust IP ''"Example
> 172.20.2.3/28"'':')
You might try using the ipaddress library in the following way:
>>> i = ipaddress.ip_interface(u'172.20.2.3/28')
>>> i.ip
IPv4Address(u'172.20.2.3')
>>
.256 is not an IP.
192.v.12.7 is not an IP.
text is not an IP.
fe80::a64e:31ff:fe94:a160 is an IP.
255.255.255.255 is an IP.
0.0.0.0 is an IP.
Basically, I'm lazy. I let somebody else do the hard work of validation!
Good luck and happy IParsing!
-Martin
[0]
http://python
(__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
matches = re.findall(pattern, bodytext)
* report to the end user: Finally, print it out
print('Found "engineering" (case-insensitive) %d times.' %
(len(matches),))
Good luck and enjoy Python,
-Martin
[0] http://docs.python-requests.org/en/master/
url =
(2 + 20)
#
python proggie.py stored-variable.txt 20 # -- increment by 20
# -- increment by 20 and sleep 1 second between read/write cycle
#first time should get 42, then 62
#
python proggie.py stored-variable.txt 20 1 # -- sleep
Enjoy, and I hope this little program is instructive,
fied_nums
['05', '11', '41', '44', '53']
Lastly, let's print the stringified_nums; do you want to print them
with colons separating the numbers, semicolons, commas, a hyphen?
>>> ':'.join(stringified_nums)
'05:
in Perl vs. thinking in Python.
(This is something that I found strange and occasionally quite convenient in
Perl.)
Perl will flatten your lists when you pass them into functions. If you pass
two lists into a function.
&some_func(@a, @b)
In some_func, there's just a list of argume
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
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
puter
science examples demonstrating recursion (and the limits of
recursion) is a function implementing the Fibonacci sequence.
https://technobeans.wordpress.com/2012/04/16/5-ways-of-fibonacci-in-python/
But, if you have a more specific question about recursion, then
please send it along.
Wel
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
>Thanks for the reply Martin, and in this instance I cannot post the
>actual code (company rules).
That's often the case. I think most of us understand that you may
not be able to post the original code.
>What I can do is say that with the xslt variable defined within the
>
ether it is running or not, along
with any error messages (pasted, please).
This is just a reminder, that this reduces the guesswork on the part
of the members of the list.
I think your problem is simply not knowing the name of the variable
you called 'xslt'. Perhaps the below exam
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
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
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
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
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
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/
;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
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
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
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
5 # -- stops with four lines of output
python wuzzyluzy.py 262144 # -- stops with many lines of output
python wuzzyluzy.py 17 # -- never stops
python wuzzyluzy.py 19 # -- never stops
Good luck in your hunt for the wily factors,
-Martin
import fractions
import math
# CFRA
, 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
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/
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
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",
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.
array.array() is
probably the easiest path for you.
Good luck and have fun!
-Martin
from __future__ import print_function
import sys
import struct
def write_data(f, size, datatype):
data = gen_data(size)
fmt = str(len(data)) + datatype
s = struct.pack(fmt, *data)
f.write(s)
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
-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
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
same round. (Simple arithmetic
determines the minimum number of players.)
If your question is Problem A, then I wonder if you know anybody who
knows combinatorics? I do not.
-Martin
[0] https://mail.python.org/pipermail/tutor/2015-September/106820.html
#! /usr/bin/python
fr
;ab', 'bc', 'cd'),
('ab', 'bd', 'cd'),
('ac', 'ad', 'bc'),
('ac', 'ad', 'bd'),
('ac', 'ad', 'cd'),
('ac', 'bc', 'bd
etail, Robert!
-Martin
Strictly speaking, it's no Python question, but... good ol' FTP.
socket.error: [Errno 113] No route to host
Your program is receiving an EHOSTUNREACH.
>>> import errno
>>> errno.errorcode[113]
'EHOSTUNREACH'
This occurs at preci
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
On 2015年09月05日 23時33分, Alan Gauld wrote:
Once you get used to it - and it is a big jump, don't
underestimate the learning time - v3 is superior.
This is the first I've heard someone describe the learning curve from 2 to 3 in
anything but negligible terms. What makes the jump big?
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
the beginnings...a SQLite DB is a fine place to start
if you have only one thread/user/program accessing the data at any
time. Don't host it on a network(ed) file system if you have the
choice. If your application grows so much in usage or volume that
it needs a new and different DB, consider
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/
_
oop in Python
2.7.3. None at all.
I also gave Python 3.3.0 a try, by running this:
for i in range(0, 90):
x = 0
This also ran without a hitch
So, perhaps you are having some sort of other problem. Would you
like to provide more detail?
-Martin
P.S. I wrote a little fu
building function for append?
Question no. 3: If all else fails, i.e., append & set, my only
option is the slice the data set?
I do not understand these two questions.
Good luck.
-Martin
P.S. By the way, Alan Gauld has also responded to your message, with
a differently-phrased answer, but,
m to the list
# called 'lst'.
# -- now, outside the loop, I would suggest printing the list
print lst
Once you can run your program and get something other than an empty
list, you know you have made progress.
Good luck with your iambic pentameter,
-Martin
The sample data i
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
hly, there are many things that can go wrong
in the network and on an end host which can cause transient errors
during DNS lookups, and it is possible that you have already
encountered some of these problems (even though I would not expect
to hit very many errors looking up PTR records for only
only, b_only
# -- and now to use it
import random
a = random.sample(range(17), 10)
b = random.sample(range(17), 10)
same, a_only, b_only = differing(a, b)
If you wanted to make sure that there were no extra files, you could:
assert 0 == len(b_only)
Anyway, there are many ways to
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
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
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
Greetings Steven,
Much great advice snipped.
Is it possible (using U+1F600 through U+1F64F or otherwise) to offer
a standing ovation for such a relevant, thorough, competent and
well-written reply?
Thank you, as always,
-Martin
(You know, Steven, we had gotten so accustomed to your
the
DataFrame?
For understanding and using a DataFrame, you'd probably be better
off asking on the pandas mailing list.
... or maybe the Pandas mailing list:
https://groups.google.com/forum/#!forum/pydata
May the Python never release you from its grip!
-Martin
--
Martin A.
Tree) mailing list ...
https://mailman-mail5.webfaction.com/listinfo/lxml
... or maybe the Pandas mailing list:
https://groups.google.com/forum/#!forum/pydata
Best of luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
___
Tutor maillist - Tutor@
at some sort
of file-naming strategy to avoid overwriting evidence of
earlier failures.
File naming is a tricky thing. See the tempfile module [1] and the
Maildir naming scheme to see two different types of solutions to the
problem of choosing a unique filename.
Good luck w
l, as it is commonly understood (in the sysadmin world)
to mean things like 're-read your config file' or 'restart a certain
routine activity'. So, it may surprise some folk if a process died
after receiving a HUP. This may be desirable--it depends entirely
on what you
pect that you are calling sqlalchemy.engine.create_engine() at
some point. When you are doing that, you can/should pass your
desired user credentials into this function.
http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html
Good luck,
-Martin
[0] http://www.sqlalchemy.or
I made a silly mistake as Jerry points its working above the same performance.
Kind regards
On Fri, Dec 12, 2014 at 8:27 PM, Alan Gauld wrote:
> On 12/12/14 14:20, Luis San Martin wrote:
>>
>> Dear fellows,
>>
>> I'm learning about on multiprocessing module o
Dear fellows,
I'm learning about on multiprocessing module on python. So far I've enjoyed
it though regarding performance I got some doubts. There is not that much
difference[0] when running it on Mac OS X on the contrary to Linux.
[0] http://codepad.org/lNDHNhof
Kind regards
___
, because there is a module called array, and I may
#(one day) want to use it.
>>> arr
{'name': 'Joe', 'address': '111 Street'}
# -- OK, but I'm lazy, I don't want to have to type all of my
#JSON into strings. OK. So
this was fixed.
Apologies!
-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
')]
Hey! We flipped the position of the number and the alphachar in the
tuple! That was fun.
Game #4: Drop a function into the output expression.
Not only can you perform simple sleight of hand like manipulating
tuples, but you can perform function calls. So multiply the second
e
tem
python 2.7.8
please help?
One other issue I might point out. The semicolon at the end of the
line (statement) is a feature of other programming languages with
which you may be familiar (C, Java, Perl), but it is not necessary
and, in fact, discouraged in Python.
So, rid yourself of the
then maybe that's a better
option for you.
If you can not do so, then take this older version of simplejson.
You are at that place of last resort to which the simplejson authors
allude.
How do you like it at that resort? Would I want to go on vacation
there?
-Martin
--
Martin A.
import json
except ImportError: # -- Python-2.4, simplejson
import simplejson as json
And, then the rest of the program can operate just the same,
regardless of which one you used.
Good luck,
-Martin
[0] https://pypi.python.org/pypi/simplejson/
[1]
http://stackoverflow.com/ques
I will check out beautiful soup as suggested
!> in a subsequent mail; I'd still like to finish this process:<}}
!Do you say that when someone points out that you are eating your shoe?
Depends on the flavor of the shoe:<)))
Root beer float.
-Martin
[0] If you really, really want
ophistication. I still reach for SQL for many reasons, but I
like the flexibility, richness and tools that Python offers me.
-Martin
P.S. The Python online documentation is pretty good.though the
language changed very little between Python-2.x and Python-3.x,
there are a few stum
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
Hello!So i'm having trouble with a task i got from my teacher in a book. I'm
supposed to create a chart which shows the converted numbers between Celsius
and Fahrenheit. They want the Celsius to range from 40 to -40. I also get to
know that Fahrenheit = 32+celsius*9/5. Now I managed to write th
x27;s paramiko.
https://pypi.python.org/pypi/paramiko/
: Any feedback on any of the points above would be greatly appreciated.
I don't know if this is the sort of feedback that you were looking
for, so I'll just stop there.
Good luck,
-Martin
__
f calling subprocess.
* If after that, you discover that your bottleneck is mostly
network, consider a task parallelizing solution. One option
could be multiprocessing [1]. There are doubtless others.
-Martin
[0] http://docs.python-requests.org/en/latest/
[1] https://docs.
obody (Oh! I need to go eat!),
-Martin
[0] For these purposes, mine was IP networking.
[1] What!?! Not Python?! Why? There are reasons to choose
something else. Do not be blind to those resaons.
[2] Find people who are motivated as you are and are working on
similar problems.
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
On 24/04/2014 10:41, Alan Gauld wrote:
On 24/04/14 00:14, Martin wrote:
If I run from a command prompt, however, I get
C:\Users\Martin\Documents\College\python>python pickle.py
You have called your file pickle.py.
So when you try to import pickle the interpreter sees your file first
7;pickle.dat','rb')
contents = pickle.load(file3)
print(contents)
input('\nPress Enter to finish')
This works as expected when run under the IDLE.
first.txt is just a small text file.
If I run from a command prompt, however, I get
C:\Users\Martin\Documents\College\python>
ing so newer .debug lines
#are not shown
logger.setLevel(logging.INFO)
logger.debug("debug example %d", 3)
OK, so why is this useful? Well, timestamps in log lines is one
reason. Another reason is the typical diagnostic technique
"What is the value of variable x, y,
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
dations on which avenue to
take--but if you are asking, you may already have the tools you need
to assess for yourself. There is, however, quite a bit of
experience loitering around this list, so perhaps somebody else will
have a suggestion.
-Martin
[0] http://www.numpy.org/
[1] http://www
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
help.
On Wed, Dec 11, 2013 at 4:22 PM, Steven D'Aprano wrote:
> On Wed, Dec 11, 2013 at 03:55:50PM -0800, Pat Martin wrote:
>> Hello,
>>
>> I am writing a program that needs to pull all of the files from a
>> specific directory. I have a few lines written that gi
1 - 100 of 312 matches
Mail list logo