On Sep 17, 9:31 am, [EMAIL PROTECTED] wrote:
> I am new to python as I have been a VB programmer. I am used to the
> GUI interface, and was wondering if I had to choose between a GUI for
> Python, which one should I go with? Thanks.
>
> Kou
You need to be more specific. Do you mean that you are
; am getting more and more comfortable with the basics of python, I
> would like to know if I am missing something more "pythonic".
>
> So, what would you recommend?
You don't need a way to make every instance the same. You need a way
where every instance shares the same state. Ak
Y-axis component.)
Depending on what you're doing, you might need the real part or the
magnitude. It sounds a little bit like you're trying to represent
something as a flatlander when you should be in Spaceland. (http://
en.wikipedia.org/wiki/Flatland)
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
Methods defined here:
|
| GetArgCount(self)
| Show how many arguments were passed at instantiation.
|
| __init__(self, *args)
|
|
--
| Data and other attributes defined here:
|
| __dict__ =
| dictionary for instance variables (if de
lib
>>> mail = imaplib.IMAP4_SSL('imap.gmail.com', 993)
That worked for me. I could then use the login method to log into the
mail server.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
oup
[8] to read badly formatted HTML. Word documents are much trickier,
and it's usually easiest to use Microsoft Word to save to a plain text
format.
Hope this helps you out!
--Jason
[1] http://docs.python.org/lib/built-in-funcs.html
[2] http://docs.python.org/lib/bltin-file-
guarantees that your destructor has "deepcopy" binding that you
want, even if the name has already been reassigned to None in your
current module by the interpreter as it is shutting down.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
es the code block for the
function into a function object, then assigns it to the name of the
function.
When Python hits a function call, it must look up the name in the
current name dictionary. In any but that most simple cases, the name
may not refer to its previous values: any intervening calls or
statements could have rebound that name to another object, either
directly, through side-effects, or even through the C interface. You
can't call a function before its def statement is parsed any more than
you can print the value of a variable before you assign anything to
it.
Unlike C, functions are not special under Python. Unlike C++, classes
aren't terribly special either. They have syntactic sugar to help the
coding go down, but they are only Python objects, and are bound to the
same rules as all other Python objects.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 11, 3:08 pm, [EMAIL PROTECTED] wrote:
> On 11 Dez, 22:02, [EMAIL PROTECTED] wrote:
>
> > Ok. This is small code.
>
> > The problem is '2' != 2 there is a way of converting 'some number' in
> > number ?
>
> > Thanks.
>
> > # -*- coding: cp1252 -*-
> > import random
> > import csv
> > import s
or everything and calling setParent('..') to point to
> the next object up in the hierarchy). But there's no reason (as far
> as I know) that he couldn't create helper functions to wrap that with
> something more sane.
Let me add that, for lots of GUI layout, most programming languages
are the wrong tool for the job. GUI layout involves tons of nested,
almost boiler-plate type data. Use a tool to generate the layout that
the code can load, and perform the few tweaks that you might need.
This makes things far more sane, especially for anyone who has to
maintain the layout later.
The lack of such a layout tool is a weakness of your GUI library, not
necessarily a problem with the program language.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
t;wrapper" binary modules are unnecessary. They
can work cross-platform from pure Python, calling directly into the C
function code. Trust me, this is an excellent improvement.
PyOpenGL probably too low-level for what you want, but it isn't dead
yet. (It's just pining for the symbol table.)
--Jason
[1] http://docs.python.org/lib/module-ctypes.html
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 20, 8:48 am, anton <[EMAIL PROTECTED]> wrote:
> Hi Jason,
>
> I know ctypes, my problem is not PyOpenGL itself,
> but during my tests with different python based 3D tools,
> some of them depend on PyOpenGL and since PyOPenGL
> is only available for python 2.4
a single line will be rightfully mocked by
other Pythonistas. How is:
print "This"; print "That"
better than:
print "This"
print "That"
I know which one is easier for me to read.
>
> I know I'll probably get yelled at for this ques
s there
are no valid string representations of NAN that can be converted to
the special floating point value. Also, if you manage to create a nan
under Windows, it displays as "1.#QNAN".
Infinite values are also problematic. In almost all cases, it is far
better to avoid infinite and NaN values.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
u will also need
to recompile all DLL libraries, such as wxPython, LXML, and the PIL.
Pure Python modules and libraries will be unaffected.
The easiest solution, however, is to use Python 2.5 and Visual Studio
2003.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
hat
> >> the file is flushed to disk and all problems are solved.
>
> >> cheers,
> >> Stef Mientki
>
> > I almost asked if you were making sure you had flushed the data to the
> > file...oh well.
>
> Yes, that's a small disadavantage of using a "high
#x27;type' for each class you define. That doesn't mean that
'type' is a superclass. Try "isinstance(Dog, type)": it will return
True.
Type does inherit from object, but that's not what you're deriving
from. The hierarchy that you're using is:
Dog
^
|
Mammal
^
|
object
As you notice, type isn't part of the object hierarchy for Dog.
That's why it doesn't show up in the MRO. If you want to make Dog a
subclass of type, you'd need to do:
>>> class Dog(Mammal, type):
... pass
...
>>> issubclass(Dog, type)
True
I don't know why'd you would want to do that, though.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
of class type,
not a subclass of class type. Since class Dog is an instance of class
type, class type is considered to be Dog's metaclass.
You can create your own metaclasses. To quote another Pythoneer, if
you think you need a metaclass, you probably don't. If you know you
need a metaclass, you definitely do not need a metaclass. They are
tricky and mind-bending.
Hope this helps clear things up for you.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
and out.
They might stand out if the editor you used supported syntax
highlighting. Personally, I find the examples with the plus and tilde
(+, ~) to be more noisy and ugly than the underscores.
Think of the underscores as a serene white-space day, with a simple
black road that takes you to the special name. Or, you can wonder
what I'm smoking when I code *grin*
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
ject objects work. Since this
is the top of Python's new-style classes, getting this right is
imperative.
I hope this gives you some idea on how to proceed. Python's grammar
really isn't that difficult. Python uses a LL parser [2], while many
languages uses LALR parsers [3]. The
On Feb 22, 10:20 am, rh0dium <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a simple list to which I want to append another tuple if
> element 0 is not found anywhere in the list.
>
> element = ('/smsc/chp/aztec/padlib/5VT.Cat',
> '/smsc/chp/aztec/padlib',
> '5VT.Cat', (33060))
>
> element1 =
is solved, I then will use each tuple as a key in a dict.
I appreciate any assistance you can throw my way.
Jason G
--
http://mail.python.org/mailman/listinfo/python-list
DropTarget class to
accomplish this, BTW.)
[1] The demo package for your platform can be found at "http://
www.wxpython.org/download.php#binaries"
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
nditional_value:
raise SecondExcept( 5 )
# The following could even be put in your own function,
# or in a wrapper or decorator for the First function.
try:
myvalue = First( 'Vikings!' )
except SecondExcept, exc:
myvalue = exc.value
When you need to use an exceptional pathway, use an exception. They
aren't just for reporting errors.
Hope this helps.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
>> from dis import dis
>>> def f():
... return 'This is ' 'an example.'
...
>>> dis(f)
2 0 LOAD_CONST 1 ('This is an example.')
3 RETURN_VALUE
>>>
It's such a minor optimization, that you probably wouldn't see any
effect on your program.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
Hey everyone--
I'm pretty new to Python, & I need to do something that's incredibly
simple, but combing my Python Cookbook & googling hasn't helped me out
too much yet, and my brain is very, very tired & flaccid @ the
moment
I have a list of objects, simply called "list". I need to break it
lePointSet
else:
PointSet = _PointSet
Hope this helps. Python's dynamic nature loves you!
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
ts.
I was wondering if there is a simple tool like this out there
somewhere. Preferably one that doesn't involve me installing a massive
IDE, but I can't really be picky.
Cheers,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
Hooray! I discovered PyCrust. I made this script (for Linux - under
Win, you could just have all but the first line as a python file and
run it directly):
#!/usr/bin/python
import wx
import wx.py.PyCrust
if __name__ == '__main__' :
app = wx.App()
pc = wx.py.PyCrust.App(app)
pc.MainLoo
Yeah, PyCrust is in wxPython now. But I take back my initial
excitement — it's freaking hard to use, despite its provision of a
"pywrap" script (batch file under Windows). You certainly can't just
replace "python /path/to/blah.py" with "pywrap /path/to/blah.py",
especially if your script requires k
Yeah, PyCrust is in wxPython now. But I take back my initial
excitement — it's freaking hard to use, despite its provision of a
"pywrap" script (batch file under Windows). You certainly can't just
replace "python /path/to/blah.py" with "pywrap /path/to/blah.py",
especially if your script requires k
but I was wondering if there is an even
more direct way. I was going to roll my own (eg. very simple Tkinter
fallback error dialog if wxPython import fails, wxPython error dialog
if anything else is missing); but I was wondering if such a system
already exists out there.
— Jason
--
http://mai
Python library use
the old style.
So, you might want to acknowledge that there are two ways of doing
classes, that a lot of old code uses the old way. The new way adds
some powerful new techniques that may be beyond the scope of your
book. In Python 3.0, it won't matter, as everything is a new-style
class anyway.
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
Hi folks--
Basically, I have a pressing need for a combination of 5.2 "Sorting a
List of Strings Case-Insensitively" & 5.3 "Sorting a List of Objects
by an Attribute of the Objects" from the Python Cookbook.
My first guess isn't working:
import operator
def sort_by_attr(seq, attr):
key=oper
On Apr 8, 8:26 pm, "David Harrison" <[EMAIL PROTECTED]> wrote:
> On 09/04/2008, Jason <[EMAIL PROTECTED]> wrote:
>
> > Hi folks--
>
> > Basically, I have a pressing need for a combination of 5.2 "Sorting a
> > List of Strings Case-Inse
Thanks so much everyone! That works great, & (presumably) is way
faster than the way I was doing it--
--
http://mail.python.org/mailman/listinfo/python-list
alled "easy-
install.pth". All packages that Easy Install provided should be in
there.
[1] Found at: http://peak.telecommunity.com/DevCenter/EasyInstall
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
get the latest version (currently 0.9). Hope others can
benefit from it!
- Jason
--
http://mail.python.org/mailman/listinfo/python-list
(This pertains to Python 2.5.4.)
Cheers,
— Jason
[1] http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html#data-types
--
http://mail.python.org/mailman/listinfo/python-list
;__name__"
attribute.
> Warning: won't be very useful if your code still uses old-style classes.
No, all the objects are new-style classes so that's fine.
> Depends on what you do with this dict, DBUS etc. And of your definition
> of "better", of course.
Simple
ncludes the finally clause... right?
— Jason
--
http://mail.python.org/mailman/listinfo/python-list
except AttributeError:
print "Didn't work!"
When the MenuProviderTest is created, the output is:
nautilus_python_object_instance_init called
Setting magic parameter
>From C:
Result: 0
>From Python:
Didn't work!
(I've tried getattr and self.super_happy_magic, with the same effect.)
Where am I going wrong?
— Jason
--
http://mail.python.org/mailman/listinfo/python-list
s that in the Python snippet you
> are calling getattr on the object that the C code refers to as
> "object".
object->instance is the PyObject, and I gathered that it was the
correct thing to assign to from the fact that the address is identical
as seen from C and Python.
— Jason
--
http://mail.python.org/mailman/listinfo/python-list
tween way to use the BSDDB module, where I can name
the file I want to use but tell the module it's temporary so that it
can be removed without my intervention?
- Jason
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 14, 12:34 pm, Tim Pinkawa wrote:
> On Sun, Jun 13, 2010 at 11:01 PM, Jason wrote:
> The tempfile.TemporaryFile class should do the job. This part is
> probably of particular interest to you:
Thanks! Since the bsddb functions require a filename (not a file
object), I'm
show the user a list of "COM1","COM2", etc, or ttyS0,
ttyS1, etc. At the moment I think they'll just have to type it into a
box.
Is there a known way to do this? Is there anyone who has a hack
they're willing to share?
Thanks,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
or other platforms.
Thanks for this pointer :)
Cheers,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
Here's my general-purpose solution for doing this:
class Dict2Class(object):
"""
Update like a dictionary, but expose the keys as class properties.
Sweet!
You can instantiate and update this practically any way you
choose, and
the values are available as class properties.
>>> c
On 2009-08-24 01:39:21 -0600, devaru said:
Hi all,
I am new to Python language. I want to capture(either in database or a
file) the conversation in IRC.
Fed.
Please suggest me some simple IRC library or code snippet for this.
I have used the oyoyo library with success. It's pretty nice an
ast):
File "", line 1, in
AttributeError: expecting wc_notify_action object for rich compare
Is there a simple way around this?
Thanks,
Jason Heeris
--
http://mail.python.org/mailman/listinfo/python-list
I will raise this with pysvn, if I can ever find their issue reporting
system.
In the meantime, I suppose I can only do this by traversing the list
with a loop and catching exceptions. Ugly, but seems to be the only
way.
On Sep 16, 2:39 am, "Gabriel Genellina"
wrote:
> Looks like a bug in pysvn.
would even allow me to override
the gio.File.monitor_directory() method to take the monitor returned
by the original method and decide whether to make it recursive based
on a parameter passed to monitor_directory().
Cheers,
Jason
PS. Asked a similar question on the pygtk list a few days ago:
http://www.daa.com.au/pi
, same for all
GObject properties, same for the usual methods. I'd basically have to
re-write the entire class in Python, and then tack on my methods.
Otherwise I have to write two sets of methods for anything that
touches this wrapped object.
Still, if it's the only way, sure.
— Jason
--
http://mail.python.org/mailman/listinfo/python-list
ndows/Mac, but FreeBSD,
Solaris, etc. But it's looking more and more like I should give up
that particular goal.
Cheers,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 6, 8:57 am, Jason wrote:
> But it's looking more and more like I should give up
> that particular goal.
...but on the other hand I just knocked together a pyinotify
threaded watch system in about 50 lines. It's tempting to tell users
of other platforms to write their
on.h:58,
from src/noddy.c:1:
/usr/include/python2.6/pyport.h:694:2: error: #error "LONG_BIT
definition
appears wrong for platform (bad gcc/glibc config?)."
error: command 'gcc' failed with exit status 1
So is it possible to get distutils to cross compile so
the actual distutils package, and somehow use that in my project
instead of setup.py?
— Jason
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 8, 8:55 am, Jason wrote:
> Do you know if virtualenv allows installing a Python environment with
> a different architecture than that of the system Python install? I
> suspect not, but maybe there's an option I don't know about.
Found a better solution, which is to
hine, so I'll stick with the "separate 32-bit installation"
approach.
Cheers,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
I'd like to be able switch between building my C extension with a
certain preprocessor macro defined or not defined. I'm using the
rudimentary distutils setup.py example given here:
http://docs.python.org/extending/building.html
Is there a command line option that distutils.core.setup() will
inte
('HAVE_STRFTIME', None)],
> undef_macros=['HAVE_FOO', 'HAVE_BAR'])
>
> Note that define_macros requires a list of tuples each having two members.
But can they be selected or set from the command line, so I can do,
say, "setup.py build -DDEBUG=1"?
— Jason
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 9, 10:56 am, Jason wrote:
> But can they be selected or set from the command line, so I can do,
> say, "setup.py build -DDEBUG=1"?
Just answered my own question: there's an option for "build_ext" (NOT
"build") that allows this.
Thanks,
Jason
--
>How to run a python script twice randomly in a day? Actually I want to run
> my script randomly in a day and twice only
I can think of two basic approaches.
One, use crontab or some other similar functionality to call it exactly twice.
Two, use crontab or some other similar functionality to
> Here are two lines from the CSV file:
> ,,172.20.{0}.0/27,172.20.{0}.32/27,172.20.{0}.64/27,29,172.20.{0}.96/27172.21.{0}.0/27,172.21.{0}.32/27,172.21.{0}.64/27,29,172.21.{0}.96/27
> GW:,,172.20.{0}.1,172.20.{0}.33,172.20.{0}.65,,172.20.{0}.97,,GW:,,172.21.{0}.1,172.21.{0}.33,172.21.{0}.65,,1
e if possible.
Any suggestions are appreciated.
Thanks!
Jason
--
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
--
http://mail.python.org/mailman/listinfo/python-list
uld be quite upset if the interpreter tried to
outsmart me and do it automagically as RR seems to be suggesting. And if
you're actually debugging, then you typically only add a few targeted print
statements -- not too hard to comment-out. If it is, and you're really
that lazy, then by
On Sun, Jun 2, 2013 at 11:10 PM, Dan Sommers wrote:
> On Sun, 02 Jun 2013 20:16:21 -0400, Jason Swails wrote:
>
> > ... If you don't believe me, you've never hit a bug that 'magically'
> > disappears when you add a debugging print statement ;-).
>
On Mon, Jun 3, 2013 at 1:12 PM, Ian Kelly wrote:
> On Sun, Jun 2, 2013 at 6:16 PM, Jason Swails
> wrote:
> > I'm actually with RR in terms of eliminating the overhead involved with
> > 'dead' function calls, since there are instances when optimizing in
>
On Mon, Jun 3, 2013 at 1:12 PM, Ian Kelly wrote:
> On Sun, Jun 2, 2013 at 6:16 PM, Jason Swails
> wrote:
> > I'm actually with RR in terms of eliminating the overhead involved with
> > 'dead' function calls, since there are instances when optimizing in
>
ack, sorry for the double-post.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Jun 4, 2013 at 11:44 AM, Rick Johnson
wrote:
>
> This implicit conversion seems like a good idea at first,
> and i was caught up in the hype myself for some time: "Hey,
> i can save a few keystrokes, AWESOME!". However, i can tell
> you with certainty that this implicit conversion is folly
ncfile.variables['time'].origin
etc. etc.
The variables and dimensions of a NetCDF file are stored in dictionaries,
and the data from variables are accessible via slicing:
time_data = ncfile.variables['time'][:]
The slice returns a numpy ndarray.
HTH,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
If I was reading the second, it would take a bit to decipher. In this
example, I don't see a better solution to what you're doing.
All the best,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
ant data structures that behave like vectors
but don't want to impose the numpy dependency on users. (Although I usually
inherit from a mutable sequence so I can override __iadd__ and __isub__).
It seemed overkill for the provided example, though...
All the best,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
ental
(and at the very beginning of me learning and using Python).
# beginner's crappy code
range = [0, 20]
# bunches of code
for i in range(len(data)):
if data[i] > range[0] and data[i] < range[1]:
do_something
TypeError: 'list' object is not callable... # what the heck does this mean??
That one drove me nuts. Took me hours to find. I still avoid rebinding
builtins just from the memory of the experience :)
--Jason
--
http://mail.python.org/mailman/listinfo/python-list
ole for many tasks. With the exception of text based
> games, the console is as useful for game programming as
> [something not useful]
>
Just because you click through a GUI faster does not mean that everyone
else does, too.
And I've developed some Tkinter-based apps (that you can even download if
you were so interested)---I did all the development on the command-line
using vim and git.
All the best,
Jason
[1] http://mail.python.org/pipermail/python-list/2013-March/642963.html
[2]
https://upload.wikimedia.org/wikipedia/commons/a/a7/Graham%27s_Hierarchy_of_Disagreement1.svg
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jun 14, 2013 at 3:21 AM, Chris Angelico wrote:
> On Fri, Jun 14, 2013 at 4:13 PM, Steven D'Aprano
> wrote:
> > Here's another Pepsi Challenge for you:
> >
> > There is a certain directory on your system containing 50 text files, and
> > 50 non-text files. You know the location of the dir
quot;git gc --aggressive" before giving
> those figures]
>
Off-topic, but this is a bad idea in most cases. This is a post including
an email from Torvalds proclaiming how and why git gc --aggressive is dumb
in 99% of cases and should rarely be used:
http://metalinguist.wordpress.com/2007/12/06/the-woes-of-git-gc-aggressive-and-how-git-deltas-work/
All the best,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
tracks content, not files).
That being said, from what I've read both git and mercurial have their
advantages, both in the performance arena and the features/usability arena
(I only know how to really use git). I'd certainly take a DVCS over a
centralized model any day.
All the best,
Jason
is sort of thing possible
> in Python?
>
Python cannot do this by itself, as has already been mentioned.
If you're using a Mac, you can schedule your computer to turn on (and/or
off) using System Preferences->Energy Saver->Schedule...
Then run a Python script in a cron job.
In fact
> Hi guys!
>
> Please help me with your advices and ideas.
>
> I need to create a web survey that will dynamically (randomly) select
> questions and descriptions from a dataset, present them to users, collect
> their answers and store them back in the dataset. (Every user gets
> different set of qu
I have deployed two Ruby on Rails sites on WebFaction, and Passenger Rack takes
up around 60 MB of memory apiece.
I was planning on replacing my Drupal web sites with Rails, but I'm now
considering replacing these Drupal sites with Django. Given that the baseline
memory consumption for a Rails
I have XML which looks like:
The "Property X" string appears twice times and I want to output the "path"
that leads to all such appearances. In this case the output would be:
LEVEL_1 {}, LEVEL_2 {"ATTR": "hello"}, ATTRIBUTE {"NAME": "Property X",
Thank you Peter and Dieter, will give those thoughts a try and report back.
--
http://mail.python.org/mailman/listinfo/python-list
> xml = """
>
>
>
>
>
>
>
>
>
>
>
>
>
> """
>
> import xml.etree.ElementTree as etree
>
> tree = etree.fromstring(xml)
>
> def walk(elem, path, token):
> path += (elem,)
> if token in elem.attrib.values():
> yield path
> for child i
catches an ArgumentError to eliminate the
internal exception handling and instead allow them to propagate the call
stack.
All the best,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
re.
Of course, in RRsPy4k this whole module will just be replaced with "raise
PyWart('All interfaces must be graphical')" and this whole thread will be
moot. :)
All the best,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
> I was hoping to have a good laugh. :|
> > Although I wouldn't call it hostile.
>
> I think the python community is being educated in how to spam and troll at
> the same time.
>
It is possible the OP has a mental disease, which is about as funny as
heart disease and cancer and not blameworthy.
Found this:
http://stackoverflow.com/questions/13871833/negative-lookahead-assertion-not-working-in-python
.
This pattern seems to work:
pattern = re.compile(r"^(?!.*(CTL|DEL|RUN))")
But I am not sure why.
On Mon, Jul 1, 2013 at 5:07 PM, Jason Friedman wrote:
> I have table
I have table names in this form:
MY_TABLE
MY_TABLE_CTL
MY_TABLE_DEL
MY_TABLE_RUN
YOUR_TABLE
YOUR_TABLE_CTL
YOUR_TABLE_DEL
YOUR_TABLE_RUN
I am trying to create a regular expression that will return true for only
these tables:
MY_TABLE
YOUR_TABLE
I tried these:
pattern = re.compile(r"_(?!(CTL|DEL|R
> Huh, did not realize that endswith takes a list. I'll remember that in
> the future.
>
> This need is actually for http://schemaspy.sourceforge.net/, which allows
> one to include only tables/views that match a pattern.
>
> Either there is a bug in Schemaspy's code or Java's implementation of
>
n Kelly wrote:
> On Mon, Jul 1, 2013 at 8:27 PM, Jason Friedman wrote:
> > Found this:
> >
> http://stackoverflow.com/questions/13871833/negative-lookahead-assertion-not-working-in-python
> .
> >
> > This pattern seems to work:
> > pattern = re.compile(r"
On Thu, Jul 4, 2013 at 2:52 PM, Ferrous Cranus wrote:
> Στις 4/7/2013 9:40 μμ, ο/η Grant Edwards έγραψε:
>
> On 2013-07-04, ?? wrote:
>>
>>>
>>> If you guys want to use it i can send you a patch for it. I know its
>>> illegal thing to say but it will help you use it without buying it.
>
I am right-handed and use a lefty-mouse about 50% of the time.
It was difficult at first, now I'm almost as fast lefty as righty.
As has been stated by others, changing the muscles being used reduces the
impact on any one of them.
--
http://mail.python.org/mailman/listinfo/python-list
Other than using a database, what are my options for allowing two processes
to edit the same file at the same time? When I say same time, I can accept
delays. I considered lock files, but I cannot conceive of how I avoid race
conditions.
--
http://mail.python.org/mailman/listinfo/python-list
e, you get back to the
expected behavior
Python 3.3.2 (default, Jun 3 2013, 08:29:09)
[GCC 4.5.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class X:
... def example(self): pass
... test = e
>
> https://bitbucket.org/cameron_simpson/css/src/374f650025f156554a986fb3fd472003d2a2519a/lib/python/cs/fileutils.py?at=default#cl-408
>
> That looks like it will do the trick for me, thank you Cameron.
--
http://mail.python.org/mailman/listinfo/python-list
r\r\n')
>>> l.close()
on UNIX and open the resulting file in gedit, it is double-spaced, but if I
just dump it to the screen using 'cat', it is single-spaced.
If you want to make your code a bit more cross-platform, you should strip
out all types of end line characters from the strings before you write
them. So something like this:
with open('writetest.py', 'w') as outf:
for s in strings:
outf.write(s.rstrip('\r\n'))
outf.write(L_SEP)
Hope this helps,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
app.pack(expand=1, fill=tk.BOTH)
root.mainloop()
This is a simple stand-alone app that (just) demonstrates how to use the
ttk.Progressbar widget.
HTH,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
#x27;, 'r') as inf:
for l in lines:
print(l, len(l))
It's also fewer lines of code.
('# -*- coding: utf-8 -*-\r\n', 25)
> ('import os\r\n', 11)
> ('import sys', 10)
Then it seems like there is an issue with your text editors that do not
play nicely with DOS-style line endings. Gedit on my linux machine
displays the line endings correctly (that is, '\r\n' is rendered as a
single line).
Good luck,
Jason
--
http://mail.python.org/mailman/listinfo/python-list
101 - 200 of 1047 matches
Mail list logo