I have a number of simple scripts I run with cron hourly on Centos
linux. I want the script to check first thing if its already running
and if so exit.
In perl I did it with this at the start of every script:
use Fcntl ':flock';
INIT {
open LH, $0 or die "Can't open $0 for lockin
On Tuesday, June 6, 2017 at 3:37:56 PM UTC-7, Marko Rauhamaa wrote:
> pta...@gmail.com:
>
> > New to Python and have been at it for about a month now. I'm doing
> > well and like it very much. Considering a career change down the road
> > and have been wondering... What are the job prospects for a
What is easiest way to determine if a string ONLY contains a-z upper
or lowercase. I also want to allow the "-" and "_" symbols. No
spaces or anything else.
--
https://mail.python.org/mailman/listinfo/python-list
I've never used ConfigParser either, but shouldn't the "[client]" section
have the options "mmz", "pass1", or "localhost" somewhere? Do you need to
add them to that file?
*Matt Jones*
On Mon, May 6, 2013 at 2:20 PM, MMZ wrote:
> On M
ients
[client]
#password = your_password
port= 3306
socket = /tmp/mysql.sock
mmz = bleh
pass1 = blah
localhost = bluargh
*Matt Jones*
On Mon, May 6, 2013 at 3:37 PM, MMZ wrote:
> Thanks Matt.
> my.cnf is a readonly file and cannot be
his works by maintaining an internal namespace (a flat dictionary), and
walking the AST generated for the expression. It supports most Python syntax,
including if, for, while, and try/except blocks, and function definitions, and
with the notable exceptions of eval, exec, class, lambda, yield, and i
This typically indicates that the "peer" at the other end of the tcp
connection severed the session without the typical FIN packet. If you're
treating the printer as a "blackbox" then there really isn't anything you
can do here except catch the exception and atte
I receive this error while toying around with Functions...
def pulldata(speclist,speccolumn):
with open('profiles.csv', 'r') as f:
reader = csv.reader(f)
for column in reader:
(speclist).append(column[('speccolumn')])
pulldata(speclist = 'numbers',
Hi everybody,
I have a Python GUI that displays some data in labeled fields. As new data
comes in the fields clear and the old data is lost. I need to make a text box
in the GUI that will display the cleared data in a scrolling list. I also need
this scrolling list to be logged to a file in c
I am going to be creating a python script that will make filling in information
at my job easier.
I have all of the information I need... I guess I just need to see it in
practice to fully grasp it.
How would I submit a python HTTP POST request to... for example, go to
google.com, enter "Pie"
ms or
rooms_on_floor is received from the user.
something like...:
rooms_on_floor = int(input("Enter the number of rooms on floor: "))
total_rooms += rooms_on_floor
*Matt Jones*
On Tue, Jan 1, 2013 at 2:14 PM, wrote:
> OK, thank you all for your help yesterday!
>
> Here
Run the unittests. the "test___all___.py" test runner can be found under
your python installation directory's lib/python-X.X/test/.
*Matt Jones*
On Thu, Jan 3, 2013 at 8:43 AM, Rita wrote:
> For those building python from source what are some tests you do to make
> sur
nt key, value
However I'm still not sure why you'd want to do this.
*Matt Jones*
On Thu, Jan 3, 2013 at 2:21 PM, MRAB wrote:
> On 2013-01-03 20:04, subhabangal...@gmail.com wrote:
>
>> Dear Group,
>> If I take a list like the following:
>>
>> fruits = [
ule to "compile" an
expression into the AST, then walks through that, intercepting Name nodes and
using a flat namespace of variables. It disallows imports and does not support
all python constructs, but it is a fairly complete in supporting python syntax.
It makes no claim at actually being safe from malicious attack, but should be
safer than a straight eval(), and prevent accidental problems when evaluating
user-input as code. If anyone can find exploits within it, I'd be happy to try
to fix them.
--Matt
--
http://mail.python.org/mailman/listinfo/python-list
you wrote would work, only return those literals thought,
you'd want to do something meaningful inside of SystemList's methods.
*Matt Jones*
On Wed, Jan 9, 2013 at 3:28 PM, MRAB wrote:
> On 2013-01-09 20:13, Rodrick Brown wrote:
>
>> How can I make a class that has methods wi
Does this look sufficient for what? You haven't actually told us what it
is you're trying to accomplish. I gave you the "how", you must supply the
"why".
*Matt Jones*
On Wed, Jan 9, 2013 at 6:43 PM, Rodrick Brown wrote:
> Can anyone care to advise on the
Pay isn't linked to the "people" in any way. A dictionary would serve this
purpose better (at least in this simple example).
database = {
'Mac' : 1000,
'Sam' : 2000
}
name = raw_input('Enter your name:')
if name in database.keys(): print
Explicit is better than implicit. Define the dunder methods so you know
exactly what your class is doing when being indexed. You only need
__getitem__ and __setitem__ really, but if you want to treat it just like a
dict you'll need __delitem__, __len__, __iter__, __contains__ as well.
Or do what Steven said if its exactly a dict and doesn't require special
management of the underlying dict.
*Matt Jones*
On Wed, Jan 16, 2013 at 8:58 AM, Matt Jones wrote:
> Explicit is better than implicit. Define the dunder methods so you know
> exactly what your class is doing
What version of python and os are you running?
*Matt Jones*
On Fri, Jan 18, 2013 at 6:04 AM, Marcin Szewczyk wrote:
> Hi,
>
> I've done some experiments with:
> 1) multiprocessing.Process.join()
> 2) os.waitpid()
> 3) subprocess.Popen.wait()
>
> These three method
field/?SiteId=cbmsn43218&sc_extcmp=JS_3218_advice
*Matt Jones*
On Mon, Jan 21, 2013 at 10:18 AM, Jason Hsu wrote:
> I am looking for a position as a software development engineer. I'm
> currently learning to develop Android apps (
> http://www.jasonhsu.com/android-apps
x27;s warning though that the SQL Server my still be working even if you
cancel an operation from the outside (which could compound your problem).
*Matt Jones*
On Sat, Jan 26, 2013 at 9:43 AM, Jason Friedman wrote:
> > Sometimes it happens that a query on one of the database servers
> >
Hi,
this might be a rather silly question, but i cannot figure out how to make
pdb give me more than 10 lines of output whenever i issue a backtrace
command.
Is there an easy way to do this?
thanks
matt
--
http://mail.python.org/mailman/listinfo/python-list
I have an opportunity for talented Python Developers with Django experience
based in the South of the UK.
I am recruiting for a funded new venture set up by two successful entrepreneurs
who are experienced and well--respected scientists and mathematicians. They're
building a new and radical way
Is there a Condition-like object exposed in the CPython C API? I've
found PyThread_lock_type, but nothing condition-like.
--
http://mail.python.org/mailman/listinfo/python-list
On 13/06/2011 11:55 PM, zainul franciscus wrote:
Iknow you guys must be thinking "Hmm, Miranda, isn't that an IM
application ?"; Yep I hear you, I'll change the name once I get a good
name. I am open for any suggestions.
Actually I was thinking "isn't that a functional programming language?"
M
http://www.mememaker.net/images/public/201108110739296015.jpg
--
http://mail.python.org/mailman/listinfo/python-list
+0.5
The "trailing \" workaround is nonobvious. Wrapping in () is noisy and
already heavily used by other syntactical structures. Since a final
':' is needed anyway, i think this would be great.
if a
and b
or c:
do stuff()
On Thu, Aug 11, 2011 at 11:02 PM, MRAB wrote:
> On 11/08/2011 05:16
this does not work. I'd
really like to understand it if someone can shed light on it.
thanks
matt
--
http://mail.python.org/mailman/listinfo/python-list
0)\t:\tsome
description')]
btw: The line to be matched (given below) is ONE line. There are no line
breaks (even though my email client adds them).
matt
On Thursday, August 18, 2011, Vlastimil Brom wrote:
> 2011/8/18 Matt Funk :
> > Hi,
> > i am sorry if this doesn't
Hi Josh,
thanks for the reply. I am no expert so please bear with me:
I thought that the {32} was supposed to match the previous expression 32
times?
So how can i have all matches accessible to me?
matt
On Thursday, August 18, 2011, Josh Benner wrote:
> On Thu, Aug 18, 2011 at 4:03 PM, M
7;t figure out why it doesn't work. I.e. why the expression is not
matches {32} times. I just don't get it.
anyway, thanks though
matt
On 8/19/2011 8:41 AM, Jason Friedman wrote:
>> Hi Josh,
>> thanks for the reply. I am no expert so please bear with me:
>> I thought t
On Friday, August 19, 2011, Alain Ketterlin wrote:
> Matt Funk writes:
> > thanks for the suggestion. I guess i had found another way around the
> > problem as well. But i really wanted to match the line exactly and i
> > wanted to know why it doesn't work. That
On Friday, August 19, 2011, jmfauth wrote:
> On 19 août, 19:33, Matt Funk wrote:
> > The results obtained are:
> > results:
> > [(' 2.199000e+01', ' : (instance: 0)\t:\tsome description')]
> > so this matches the last number plus the string a
On Friday, August 19, 2011, Carl Banks wrote:
> On Friday, August 19, 2011 10:33:49 AM UTC-7, Matt Funk wrote:
> > number = r"\d\.\d+e\+\d+"
> > numbersequence = r"%s( %s){31}(.+)" % (number,number)
> > instance_linetype_pattern = re.compile(numberse
I guess the issue here is that you can't tell if an expression is
complete without checking the indent of the following line. This is
likely not desirable.
On Thu, Sep 1, 2011 at 11:43 PM, Yingjie Lan wrote:
> Hi Matt,
> ===
> Fro
Thanks,
works great.
matt
On 3/3/2011 10:53 AM, MRAB wrote:
> On 03/03/2011 17:33, maf...@nmsu.edu wrote:
>> Hi,
>>
>> i have a line that looks something like:
>> 2.234e+04 3.456e+02 7.234e+07 1.543e+04: some description
>>
>> I would like to extract all
t the hdf5
file. Is there anything i am doing wrong?
thanks
matt
--
http://mail.python.org/mailman/listinfo/python-list
sted):
for filename in files:
if (any(filename.endswith(x) for x in extensions)):
print filename
However, it will print all the files in list 'files' (that is all files
with file extension '.hdf'). My question is why it doesn't just print
the
2733.hdf','MOD03.A2010002.1950.005.2010258063105.hdf','MOD03.A2010002.1950.005.2010258063105.hdf5')
for filename in files:
if (any(filename.endswith(x) for x in extensions)):
print filename
thanks for the help
matt
On 3/4/2011 2:26 AM, Tom Zych wrote:
> Ethan Furman wrote:
>> Wh
might want to investigate these resources and try google searches
for e.g. "extracting key terms from documents" and then come back if you
have a question about the Python implementation.
Cheers,
Matt
--
http://mail.python.org/mailman/listinfo/python-list
ile.write("Hello world!\n")
myfile.close()
Beyond that, your message is too vague to offer any real help, but it
sounds like you're way off track. If the above code doesn't help, please
tell us exactly what you're trying to do, but you might want to read a
Python book such as
I am subclassing tkSimpleDialog.Dialog as a (sqlite) database front-
end. This parent dialog opens a number of child dialogs to propagate
sub-tables (like sub-forms in OOo). These subforms write their input
into the database (INSERT...)
The parent dialog then either commits or rolls-back transacti
On 08/04/2011 11:31 AM, Chris Angelico wrote:
On Sat, Apr 9, 2011 at 12:41 AM, MRAB wrote:
On 08/04/2011 08:25, Chris Angelico wrote:
[snip]
I don't know what's the most Pythonesque option, but if you already
have specific Python code for each of your functions, it's probably
going to be easi
pecific
> capabilities if there is enough interest.
>
> Enjoy...
>
> Jon Dowdall
I know this sound shallow, but you really need a nicer icon.
Otherwise, I'm quite excited about this. It will certainly be better
than my current workflow of connecting via ssh to a server just to run
ly, a Snowball interpreter
written in Python.
(http://snowball.tartarus.org/)
Anyone heard of such a thing?
Thanks!
Matt
--
http://mail.python.org/mailman/listinfo/python-list
esn't seem like there is
such a thing, but I figured I'd take a shot here before I think about
doing it myself :/
Matt
--
http://mail.python.org/mailman/listinfo/python-list
This doesn't directly bear upon the posted example, but I found the
following tutorial extremely helpful for learning how to parse log
files with idiomatic python. Maybe you'll might find it useful, too.
http://www.dabeaz.com/generators/
http://www.dabeaz.com/generators/Generators.pdf
--
http://
On 2017-09-10 05:42, Chris Warrick wrote:
>
> RHEL’s release process starts at forking a recent Fedora release. It
> wouldn’t make much sense for them to undo the Python 3 progress that
> happened over the past few years in Fedora — including dnf, an
> improved package manager written in Python 3.
On 2017-09-17 17:27, leam hall wrote:
>
> Ah! So this works in Py2:
>def __str__(self):
> name= self.name.encode("utf-8")
>
>
> It completely fails in Py3:
> PVT b'Lakeisha F\xc3\xa1bi\xc3\xa1n' 7966A4 [F] Age: 22
>
>
> Note that moving __str__() to display() gets the same result
,f)for r in(t,f)]+[(n,t),(n,f)]:x='
'.join(x);l+=[x[0].upper()+x[1:]+" is "+str(eval(x))]
for i in 12,9,5,0:l.insert(i,'')
print('\n'.join(l))
Reproducing the original string exactly the best I've managed is 260:
t,f,a,o,n='True','False
inal string.
>
I guess you didn't try it? (or see `upper()` in the body of the `for` below)
> l=[" Boolean Operators\n"+"-"*24]
> > for x in [(l,p,r)for p in(a,o)for l in(t,f)for r
> in(t,f)]+[(n,t),(n,f)]:x='
> > '.join(x);l+=[x[0].upper()+x
n)
>
I guess you still didn't run it ;D (see the 2nd `for` statement). I diffed
my output against the original, which is why I'm confident in the
correctness of my solution ;)
Actually I managed to shave off another byte by changing `l.insert(i,'')`
to `l[i:i]=['']`, so now I'm on 259. I should probably stop now...
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
I prefer to use vim and ctags when developing python, but I'm having
trouble getting ctags to index the standard library. Sometimes I would like
to see an object's constructor etc...
Does anyone know how to do this?
Thanks
--
https://mail.python.org/mailman/listinfo/python-list
vailable
in the local $PATH
[0] https://tox.readthedocs.io/en/latest/
[1]
http://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
ty of any other cross-platform incompatibilities playing a part?
> --
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
same functionality and all of which
> are a few years old.
> Recommendations from the crowd?
>
In the past I've used https://github.com/devpi/devpi
It may have many features you don't need if all you're after is a caching
proxy, but I found it does that well and it appear
botframework remote library [
https://github.com/robotframework/RemoteInterface] to run the
Java-dependent parts in Jython & the CPython-dependent parts in CPython
(I've not used the remote library myself so don't know how easy it is to
work with, but it should work either way around))
* pip install robotframework
> --
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
27;t particularly helpful advice if you're
sitting in any seat other than the driver's seat, however.
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
DEBUG
-g
-fwrapv
-O3
-Wall
-Wstrict-prototypes
python3-config -ldflags;
-L/nfs/sc/disks/slx_1353/mlpriest/sl1/work_root/a0/development/sfwr/lib/python3.6/config-3.6m-x86_64-linux-gnu
-L/nfs/sc/disks/slx_1353/mlpriest/sl1/work_root/a0/development/sfwr/lib
-lpython3.6m
-lpthread
-ldl
-lutil
-lr
Dieter,
I'm sure it's the Python version, I was hoping the "latest" set of the
dependencies would get me there.
I'll explore stepping that version back and let you know...
Thank you,
Matt
-Original Message-
From: Python-list [mailto:python-list-
path you have here this looks like you have a non
standard python package for EL7 (in addition to the system one, or you'd be
having a worse day), which is probably the root of your problem.
Are you using python packages from scl perhaps?
If so you probably need to install python27-pytho
able to tell argparse I'm going to process --verbose, then
> exit?
>
> Thx,
>
> Skip
> --
> https://mail.python.org/mailman/listinfo/python-list
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
dump(_))
name: PyYAML
homepage: https://github.com/yaml/pyyaml
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configuration, persistence, pickle]
Maintainers
===
The following people are currently responsible for maintaining PyYAML:
* Ingy döt Net
* Matt
aml', 'description':
'YAML parser and emitter for Python', 'name': 'PyYAML'}
>>> print(yaml.dump(_))
name: PyYAML
homepage: https://github.com/yaml/pyyaml
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configur
emitter for Python', 'name': 'PyYAML'}
>>> print(yaml.dump(_))
name: PyYAML
homepage: https://github.com/yaml/pyyaml
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configuration, persistence, pickle]
```
Maintainers
==
> On 29 Mar 2021, at 04:45, Cameron Simpson wrote:
>
> yapf has many tunings. Worth a look. It is my preferred formatter. By
> comparison, black is both opinionated and has basicly no tuning,
> something I greatly dislike.
This is not a mark or a vote against yapf (I’ve never used it), but I
4, 5, 6, 7, 8, 9]
```
range objects are iterables, not iterators.
We can see the consuming behaviour I think you are referring to by
calling iter():
```
>>> i = iter(r)
>>> next(i)
0
>>> list(i)
[1, 2, 3, 4, 5, 6, 7, 8, 9]
```
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
I think the real PSA is "don't mess with the system python(3) version".
On Mon, 29 Aug 2016 at 13:18 Chris Angelico wrote:
> If, like me, you build Python 3.6 from source and make it your default
> 'python3' binary, you may run into issues with the latest
> apt-listchanges, which has switched to
On 2016-08-29 23:56, Chris Angelico wrote:
> Up until very recently, the system Python has only been the Python 2.
> (For a while, it wasn't even 2.7, but I could easily use altinstall
> for that.) I have deliberately wanted to use 3.6 for ALL testing, not
> just by messing with venvs or shell alia
On 2016-09-02 15:44, Ben Finney wrote:
> Note that this has nothing to do with how the function is defined; in
> the definition of the function, parameters are neither positional nor
> keyword. You name each of them, and you define an order for them; and
> neither of those makes any of them “positi
On Thu, 15 Sep 2016, 08:12 meInvent bbird, wrote:
> how to automate java application in window using python
>
> 1. scroll up or down of scroll bar
> 2. click button
> 3. type text in textbox
>
I would recommend having a look at pywinauto
https://github.com/pywinauto/pywinauto
It presents a very
On Tue, 20 Sep 2016, 02:47 meInvent bbird, wrote:
> can it contorl Maplesoft's maple which is a java executable file?
>
I don't know maple so I can't answer that.
Which programming language an application is written in isn't really
relevant for pywinauto, it's the graphical toolkit in use which
On Tue, 27 Sep 2016 at 20:58 TUA wrote:
> Is the following possible in Python?
>
> Given how the line below works
>
> TransactionTerms = 'TransactionTerms'
>
>
> have something like
>
> TransactionTerms =
>
> that sets the variable TransactionTerms to its own name as string
> representation with
nsistent operators is not required but is easier to read and less
> confusing.
>
Unfortunately in this case it's also less correct
> --
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 29 Nov 2016 at 23:59 wrote:
> If you want to do something only if the file exists (or does not), use
> os.path.isfile(filename)
>
This opens you up to a potential race condition (and has potential security
implications, depending on the application), as you're using LBYL[0].
If you want
s?
So... Not for me, but obviously with the caveats above. Giving it a try in
an Apple store is definitely a good idea :)
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
ip3.5 and the command python3.5 -m pip
> install automatically translates into pip3.5 ?
>
Actually it's the other way around. The `pip3.5` (and `pip3`) commands both
map to (effectively) `python3.5 -m pip`. You can see this if you run `cat
$(which pip3)`.
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
i if
your computer is fast enough (it's a bit of a resource hog), and syntastic
as a great way to integrate style checkers & linters into vim.
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
.
range() is not part of the for syntax at all, it's completely separate, it
simply returns an iterator which the for loop can use, like any other.
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 3 Jan 2017 at 21:46 Matt Wheeler wrote:
> range() is not part of the for syntax at all, it's completely separate, it
> simply returns an iterator which the for loop can use, like any other.
>
*iterable
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/ma
to
do.
range() is not part of the for syntax at all, it's completely separate, it
simply returns an iterator which the for loop can use, like any other.
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 3 Jan 2017 at 21:46 Matt Wheeler wrote:
> range() is not part of the for syntax at all, it's completely separate, it
> simply returns an iterator which the for loop can use, like any other.
>
*iterable
--
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/ma
On 2017-01-21 10:50, Pete Forman wrote:
> Thanks for a very thorough reply, most useful. I'm going to pick you up
> on the above, though.
>
> Surrogates only exist in UTF-16. They are expressly forbidden in UTF-8
> and UTF-32. The rules for UTF-8 were tightened up in Unicode 4 and RFC
> 3629 (2003)
On 2018-05-14 07:05, zljubi...@gmail.com wrote:
> Hi,
>
> I have dataframe with CRM_assetID column as category dtype:
>
> df.info()
>
>
> RangeIndex: 1435952 entries, 0 to 1435951
> Data columns (total 75 columns):
> startTime1435952 non-null object
> CRM_assetID
On 2018-05-15 06:23, Zoran Ljubišić wrote:
> Matt,
>
> thanks for the info about pydata mailing group. I didn't know it exists.
> Because comp.lang.python is not appropriate group for this question, I
> will continue our conversation on gmail.
>
> I have put len(
On 2018-08-28 07:26, stone.zh...@gmail.com wrote:
> Hi there,
>
> Sorry if the question is naive, I am on Ubuntu 16.04 with Python 3.5.2, now I
> want to use virtualenv, I noticed there are two ways to get virtualenv
> installed:
>
> 1) do "sudo apt-get install virtualenv"
> 2) do "pip3 install v
ect
>
> exact_sum([0.3, 0.7])
>
> to be 1.
and make
def not_exact_but_probably_the_sum_you_wanted(nums):
return sum(map(lambda x:Fraction(x).limit_denominator(), nums))
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
Hi-
That seems like a reasonable approach, though I think there *really*
needs to be an option along the lines of "subscribed to the list for the
purposes of moderation, but not receiving list messages via email". I
think I did this with the Git mailing list in the past, and it was quite
useful. I
r something')
class Queen(Piece):
def validate_move(self, new):
return any((test(self.position, new) for test in
(move_straight, move_diag)))
Ok I'll stop before I get too carried away... This is completely
untested so bugs will abound I'm sure :)
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 25 Apr 2016 15:56 , wrote:
> Dear Group,
>
> I have a list of tuples, as follows,
>
> list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA
> philanthropic/NA activities/NA ','class1')", u"('koteeswaram/BHPERSN is/NA
> a/NA very/NA nice/NA person/NA ','class1')", u"('kot
eturn block
else:
logging.info("block not found")
>return False
> logging.info("block not found")
> return block
And you probably don't need to explicitly return false, python
functions implicitly return None (which is falsey) if they don't reach
a return statement, but that's perhaps a matter of taste.
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/mailman/listinfo/python-list
On 30 May 2016 at 10:03, Ganesh Pal wrote:
> Thanks Matt for the reply and lovely analysis . I was trying to complicate
> the simple task :(
>
> Here is how the code looks now , the whole idea was just to match the
> pattern and return it
>
>
> def get_b
On Mon, 30 May 2016, 21:08 Ni Va, wrote:
>
> _
> Output:
> Traceback (most recent call last):
> File "", line 1, in
> File "", line 16, in PyExecReplace
> File "", line 22, in
> File "", line 11, in foo
> NameError: global name 'time' is not defined
>
Based on your tracebac
Hi,
On Fri, 3 Jun 2016, 16:04 Sayth Renshaw, wrote:
>
> So at the point I create the variable it refers to an object.
>
It's best to think of them as names, rather than variables, as names in
python don't behave quite how you'll expect variables to if you're coming
from some other languages.
M
First of all welcome :)
The other suggestions you've received so far are good so I won't repeat
them... (note that in particular I've reused the names you've chosen in
your program where I've given code examples, but that's purely for clarity
and I agree with the others who've said you should use
On Thu, 16 Jun 2016, 23:31 Harrison Chudleigh, <
harrison.chudlei...@education.nsw.gov.au> wrote:
> Sorry! I was trying to indent a line and accidentally sent only half of the
> message.
>
It would be helpful if your reply was actually a reply to your previous
message, to enable us to follow the
On Fri, 24 Jun 2016, 03:32 Tiglath Suriol, wrote:
> Let us say that I install PostgreSQL from an activated virtualenv using
> yum or apt-get, will PostgrSQL be local or global?
>
Global
I understand that virtualenv isolates the Python environment only, so I
> surmise that it will make no differ
On Fri, 29 Jul 2016, 09:20 Steven D'Aprano, wrote:
> I'm not sure that partial is intended as an optimization. It may end up
> saving time by avoiding evaluating arguments, but that's not why it exists.
> It exists to enable the functional programming idiom of partial evaluation
> in a simpler, m
On Fri, 5 Aug 2016, 02:23 Lawrence D’Oliveiro,
wrote:
> On Friday, August 5, 2016 at 12:06:23 PM UTC+12, Igor Korot wrote:
> >
> > On Thu, Aug 4, 2016 at 4:57 PM, Lawrence D’Oliveiro wrote:
> >> On Friday, August 5, 2016 at 11:50:28 AM UTC+12, jj0ge...@gmail.com
> wrote:
> >>> According to Python
101 - 200 of 747 matches
Mail list logo