liam_herron wrote:
>
> Given:
> dw = [ 1, -1.1, +1.2 ]
>
> Suppose I want to create a list 'w' that is defined as
>
> w[0] = dw[0],
> w[1] = w[0] + dw[1],
> w[2] = w[1] + dw[2]
>
> Is there a list comprehension or map expression to do it in one or 2
> lines.
>>> from itertools import *
>>> da
One resource you should always keep at hand is this extremely useful
Quick Reference:
http://rgruet.free.fr/PQR24/PQR2.4.html
Study it carefully, there is a lot in there that can teach you about
how Python works. Fire up IPython as well and start hacking!
2B
--
http://mail.python.org/mailman/l
[EMAIL PROTECTED] wrote:
> I need to do a quadratic optimization problem in python where the
> constraints are quadratic and objective function is linear.
>
> What are the possible choices to do this.
Too bad these homework assignments get trickier every time, isn't it?
Stefan
--
http://mail.py
EXI-Andrews, Jack wrote:
> the '*' and '+' don't seem to be greedy.. they will consume less in
> order to match a string:
>
> >>> import re;re.match('(a+)(ab)','aaab').groups()
> ('aa', 'ab')
>
> this is the sort of behaviour i'd expect from
>'(a+?)(ab)'
>
> a+ should greedily consume a's at
walterbyrd wrote:
> 1) Can attributes can added just anywhere? I create an object called
> point, then I can add attributes any time, and at any place in the
> program?
in general, yes, but that should be done sparingly.
> 2) Are classes typically created like this:
>
> class Point:
> pass
>
Noah Rawlins wrote:
> I'm a nut for regular expressions and obfuscation...
>
> import re
> def splitline(line, size=4):
> return re.findall(r'.{%d}' % size, line)
>
> >>> splitline("helloiamsuperman")
> ['hell', 'oiam', 'supe', 'rman']
there are laws against such use of regular expressio
Hi ALL,
I am a newbee programmer and started of with python recently. I am
trying write a script which backups outlook (.pst ) files everytime I
shutdown my system. I have writtern following code after some findings
on net. My .pst file path is as follows
" c:\documents and settings\060577\Local
Klaus Alexander Seistrup wrote:
> Decorate-sort-undecorate?
>
> #v+
>
> array = []
>
> for addr in Emails:
> (user, domain) = addr.split('@')
> array.append((domain, user, addr))
> # end for
>
> array.sort()
>
> SortedEmails = [addr for (user, domain, addr) in array]
>
> #v-
note that D
Hi to all,
i am not sure if this question really belongs here but anyway, here it
goes: I have seen a lot of IDEs for Python, a lot of good stuff but
actually none of them has what, for example, Visual Studio has: a
Visual Editor (with the ability to place controls on forms etc etc),
or RAD
I k
Fredrik Lundh schrieb:
> Noah Rawlins wrote:
>
>
>> I'm a nut for regular expressions and obfuscation...
>>
>> import re
>> def splitline(line, size=4):
>> return re.findall(r'.{%d}' % size, line)
>>
>> >>> splitline("helloiamsuperman")
>> ['hell', 'oiam', 'supe', 'rman']
>
> there are l
I have a home-grown Wiki that I created as an excercise, with it's own
wiki markup (actually just a clone of the Trac wiki markup). The wiki
text parser I wrote works nicely, but makes heavy use of regexes, tags
and stacks to parse the text. As such it is a bit of a mantainability
nightmare - addin
k.i.n.g. wrote:
> how can i make the following code work, I have probelm with filepath
> declaration.
http://effbot.org/pyfaq/tutor-i-need-help-im-getting-an-error-in-my-program-what-should-i-do
--
http://mail.python.org/mailman/listinfo/python-list
I've just seen that gopherlib is deprecated in python 2.5
http://docs.python.org/lib/module-gopherlib.html
we still use this protocol (though there are only few working gopher
servers are left on the net)
My friend just wrote a standard compliant gopher server (pygopherd had
some problems oslt) a
| " c:\documents and settings\060577\Local Settings\Application
| Data\Microsoft\Outlook "
| where 060577 represents username. I want my script to
| identigy the user
| logged in and go to the resp outlook folder or should be able to read
| outlook store directory path from registry and the copy t
k.i.n.g. wrote:
> Hi ALL,
>
> I am a newbee programmer and started of with python recently. I am
> trying write a script which backups outlook (.pst ) files everytime I
> shutdown my system. I have writtern following code after some findings
> on net. My .pst file path is as follows
>
> " c:\docume
On Tue, 21 Nov 2006 21:00:02 -0800, John Machin wrote:
> Steven D'Aprano wrote:
>
> [snip]
>
>> def running_sum(dw):
>> """Return a list of the running sums of sequence dw"""
>> rs = [0]*len(dw)
>> for i in range(len(dw)):
>> rs[i] = dw[i] + rs[i-1]
>
> Please explain to the
Steven D'Aprano wrote:
> On Tue, 21 Nov 2006 21:00:02 -0800, John Machin wrote:
>
> > Steven D'Aprano wrote:
> >
> > [snip]
> >
> >> def running_sum(dw):
> >> """Return a list of the running sums of sequence dw"""
> >> rs = [0]*len(dw)
> >> for i in range(len(dw)):
> >> rs[i] =
On Wed, 22 Nov 2006 02:28:04 -0800, John Machin wrote:
>
> Steven D'Aprano wrote:
>> On Tue, 21 Nov 2006 21:00:02 -0800, John Machin wrote:
>>
>> > Steven D'Aprano wrote:
>> >
>> > [snip]
>> >
>> >> def running_sum(dw):
>> >> """Return a list of the running sums of sequence dw"""
>> >> rs
Hi list,
I have an awk program that parses a text file which I would like to
rewrite in python. The text file has multi-line records separated by
empty lines and each single-line field has two subfields:
node 10
x -1
y 1
node 11
x -2
y 1
node 12
x -3
y 1
and this I would like to parse into a l
[... snip ...]
| ---
| how can i make the following code work, I have probelm with filepath
| declaration.
| ---
| import os, shutil
| filepath = ' C:\\Documents and Settings\\060577\\Local
| Settings\\
walterbyrd wrote:
> Reading "Think Like a Computer Scientist" I am not sure I understand
> the way it describes the way objects work with Python.
>
> 1) Can attributes can added just anywhere? I create an object called
> point, then I can add attributes any time, and at any place in the
> program?
Thank You all for reply's so far
>
> import os, sys
> from win32com.shell import shell, shellcon
>
> local_app_data = shell.SHGetSpecialFolderPath (0,
> shellcon.CSIDL_LOCAL_APPDATA)
> outlook_path = os.path.join (local_app_data, "Microsoft", "Outlook")
>
> print outlook_path
>
>
The above code
Hi
I'm trying to write a Python script to receive and save a file on a web
server that has been POST'ed from a client application.
In essence, this is similar to handling a file upload from an HTML
form. However, I can't use:
form = cgi.FieldStorage()
fileitem = form['file']
since the file is n
king kikapu wrote:
> Hi to all,
>
> i am not sure if this question really belongs here but anyway, here it
> goes: I have seen a lot of IDEs for Python, a lot of good stuff but
> actually none of them has what, for example, Visual Studio has: a
> Visual Editor (with the ability to place controls
k.i.n.g. wrote:
> [snip code]
> The above code was fine while printing, when I am trying to use this
> (outlook_path) to use as source path it is giving file permission error
> can you please clarify this
Did you follow the link that Fredrik Lundh gave you?
/MiO
--
http://mail.python.org/mailman
I've to modifying a file, then I use a method imported that access to
that file and has to read the new data, but they are not read ( as if
the data were not flushed at the moment even using .close()
explicitly).
---
...
...
# If it is not installed,
Hi ,
I am sorry I am providing the code i used as it is. Being newbee to
programming I have tinkerd with various options i found on the net.
start of the code
--
| >
| > import os, sys
| > from win32com.shell import shell, shellcon
| >
| > local_app_data = shell.SHGetSpecialFolderPath (0,
| > shellcon.CSIDL_LOCAL_APPDATA)
| > outlook_path = os.path.join (local_app_data, "Microsoft", "Outlook")
| >
| > print outlook_path
| >
| >
|
| The above code was fin
I am writing a plugin for a piece of software in python, and I want to
start up a PyQt GUI in the plugin, without stalling the main thread
while the gui is running (later i will want to pass messages between
the main thread and the gui thread).
I'm new to pyqt, so I'm probably doing something very
Hi all!
I have a problem with the module subprocess!
The problem is that the external software that I am running under
subprocess.Popen opens stdin, stdout, stderr, and other file descriptors to
write and read in the hard drive.
I know how to capture stdin, stdout and stderr, what I cannot do is t
| I am sorry I am providing the code i used as it is. Being newbee to
| programming I have tinkerd with various options i found on the net.
Thanks. That makes it a lot easier
[... snip ...]
| source = outlook_path
| #source = outlook_path +'\\*'
| print source
[...]
| win32file.CopyFile (sourc
hmmm,,,ok, i see your point.
As i understand it, as a newcomer, it is a little cumbersome to right
the code in one ide,
"glue" the UI from another toll and all that stuff.
I know it works but if someone is coming from VS.Net, it seems a little
strange, at first.
I also saw that the wxWidgets is
Daniel Nogradi wrote:
> I have an awk program that parses a text file which I would like to
> rewrite in python. The text file has multi-line records separated by
> empty lines and each single-line field has two subfields:
>
> node 10
> x -1
> y 1
>
> node 11
> x -2
> y 1
>
> node 12
> x -3
> y
I'd like to use XSV for validating an XML file in Python.
I am working on Linux Debian platform.
I'm not sure how to install XSV and how to configure it. My goal is to
be able to import the XSV library in Python and be able to use it's
functions.
XSV v2.10 for Debian available here:
ftp://ftp.cogs
Hi all,
I have an application that is using embedded python to offer some
scripting ability. An API is exposed via SWIG, and I am accessing that
API from my embedded python interpreter.
Scripts are present as separate files, and I'm invoking them at present
using the following:
iserr = P
On Wednesday 22 November 2006 12:37 pm, anders wrote:
> I am writing a plugin for a piece of software in python, and I want to
> start up a PyQt GUI in the plugin, without stalling the main thread
> while the gui is running (later i will want to pass messages between
> the main thread and the gui t
Fredrik Lundh wrote:
> note that DSU is built into Python these days:
>
> L.sort(key=transform)
Sweet, thanks for the hint.
Cheers,
--
Klaus Alexander Seistrup
http://klaus.seistrup.dk/
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I'd like to use XSV for validating an XML file in Python.
> I am working on Linux Debian platform.
> I'm not sure how to install XSV and how to configure it. My goal is to
> be able to import the XSV library in Python and be able to use it's
> functions.
You can use "dpk
Ant wrote:
> So I thought I'd look into the pyparsing module, but can't find a
> simple example of processing random text.
Have you looked at the examples on the pyparsing web page?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
No particular reason for XSV
I just want to validate XML files against an XML schema through Python.
If you can suggest any other package for debian, I'll be glad to try
it.
Michel
Stefan Behnel wrote:
> [EMAIL PROTECTED] wrote:
> > I'd like to use XSV for validating an XML file in Python.
> > I
Hi
Having a method:
def method(self,x,y):
is it possible to discover, from outside the method, that the methods
arguments are ['self', 'x', 'y']?
Thanks.
/Martin
--
http://mail.python.org/mailman/listinfo/python-list
Stefan Behnel wrote:
> [EMAIL PROTECTED] wrote:
> > I need to do a quadratic optimization problem in python where the
> > constraints are quadratic and objective function is linear.
> >
> > What are the possible choices to do this.
>
> Too bad these homework assignments get trickier every time, isn
[EMAIL PROTECTED] wrote:
> Hi
>
> Having a method:
>
> def method(self,x,y):
>
> is it possible to discover, from outside the method, that the methods
> arguments are ['self', 'x', 'y']?
import inspect
help(inspect.getargspec)
HTH
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[
Phil Thompson wrote:
> On Wednesday 22 November 2006 12:37 pm, anders wrote:
> > I am writing a plugin for a piece of software in python, and I want to
> > start up a PyQt GUI in the plugin, without stalling the main thread
> > while the gui is running (later i will want to pass messages between
>
> > I have an awk program that parses a text file which I would like to
> > rewrite in python. The text file has multi-line records separated by
> > empty lines and each single-line field has two subfields:
> >
> > node 10
> > x -1
> > y 1
> >
> > node 11
> > x -2
> > y 1
> >
> > node 12
> > x -3
>
Python 2.4.2 (#1, Oct 13 2006, 17:11:24)
[GCC 4.1.0 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = object()
>>> a
>>> a.spam = 1
Traceback (most recent call last):
File "", line 1, in ?
AttributeError: 'object' object has no attribute 'spam
On Wednesday 22 November 2006 2:06 pm, anders wrote:
> Phil Thompson wrote:
> > On Wednesday 22 November 2006 12:37 pm, anders wrote:
> > > I am writing a plugin for a piece of software in python, and I want to
> > > start up a PyQt GUI in the plugin, without stalling the main thread
> > > while th
I haven't used it but Komodo (Professional version) says it has:
ActiveState GUI Builder (Komodo Professional only)
Enhance your applications with GUI dialogs: Simple, Tk-based dialog
builder with seamless round-trip integration, for Perl, Python, Ruby,
and Tcl.
--
http://mail.python.org/mailma
> [EMAIL PROTECTED] wrote:
> Stefan Behnel wrote:
>> BTW: any reason you need to use XSV? There are some other libraries out there
>> that can validate XML based on XML Schema and RelaxNG, e.g. lxml. They are
>> much more powerful than XSV.
>
> No particular reason for XSV
> I just want to validate
Thanks everybody. I will sort all of this out, but right now my head is
spinning.
Is there some book, or other reference, that explains of this? I was
thinking about "Python for Dummies." The "Think like a Computer
Scientist" book, and "Dive into Python" book don't seem to explain
Python's object
I have already downloaded and seen the trial of Komodo Professional.
Indeed it has a simple Gui Builder but one can only use TKinter on it.
No wxWidgets support and far from truly RAD, but it is the only
"integrated"
GUI builder in these IDEs...
On Nov 22, 4:31 pm, "Steve" <[EMAIL PROTECTED]> wr
Phil Thompson wrote:
> On Wednesday 22 November 2006 2:06 pm, anders wrote:
> > Phil Thompson wrote:
> > > On Wednesday 22 November 2006 12:37 pm, anders wrote:
> > > > I am writing a plugin for a piece of software in python, and I want to
> > > > start up a PyQt GUI in the plugin, without stallin
On 22 Nov 2006 06:43:55 -0800, anders <[EMAIL PROTECTED]> wrote:
>
> Phil Thompson wrote:
> > On Wednesday 22 November 2006 2:06 pm, anders wrote:
> > > Phil Thompson wrote:
> > > > On Wednesday 22 November 2006 12:37 pm, anders wrote:
> > > > > I am writing a plugin for a piece of software in pyth
Hallöchen!
At http://pyvisa.sourceforge.net you can find information about the
PyVISA package. It realises Python bindings for the VISA library
functions, which enables you to control GPIB, USB, and RS232-serial
measurement devices via Python.
Yesterday I released version 1.1, which works much b
Dale Strickland-Clark wrote:
> Python 2.4.2 (#1, Oct 13 2006, 17:11:24)
a = object()
a.spam = 1
> Traceback (most recent call last):
> File "", line 1, in ?
> AttributeError: 'object' object has no attribute 'spam'
class B(object): pass
a = B()
a.spam = 1
>
> What i
> What is subclassing adding to the class here?
A __dict__:
>>> o = object()
>>> dir(o)
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__',
'__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__str__']
>>> class C(object): pass
...
>>> c = C()
>>
Dale Strickland-Clark wrote:
> Why can't I assign to attributes of an instance of object?
it doesn't have any attribute storage.
--
http://mail.python.org/mailman/listinfo/python-list
king kikapu wrote:
> I have already downloaded and seen the trial of Komodo Professional.
> Indeed it has a simple Gui Builder but one can only use TKinter on it.
> No wxWidgets support and far from truly RAD, but it is the only
> "integrated"
> GUI builder in these IDEs...
>
>
> On Nov 22, 4:31
I've read a bit about lxml, didn't found anything related to validating
XML schema...
Maybe you can give more details on how to install lxml and use it in
Python to validate XML files against an XML Schema
I'm going to ask the server administrator to install lxml, so I can't
play around a lot with
[EMAIL PROTECTED] wrote:
> Stefan Behnel wrote:
>>> [EMAIL PROTECTED] wrote:
>>> Stefan Behnel wrote:
BTW: any reason you need to use XSV? There are some other libraries out
there
that can validate XML based on XML Schema and RelaxNG, e.g. lxml. They are
much more powerful than
Perhaps this piece of code might explain the behaviour:
>>> class C( object ):
... __slots__ = ()
...
>>> o = C()
>>> o.a = 1
Traceback (most recent call last):
File "", line 1, in ?
AttributeError: 'C' object has no attribute 'a'
object behaves like having an implict __slots__ attrib
Hi!
" are your friend.
See, also:
filepath = '"%HOMEPATH%\\LocalSettings\\Application
Data\\Microsoft\\Outlook\\*"'
and %USERPROFILE% %APPDATA% etc.
--
@-salutations
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
This works for me.
You were very helpful, thank you!
Michel
Stefan Behnel wrote:
> [EMAIL PROTECTED] wrote:
> > Stefan Behnel wrote:
> >>> [EMAIL PROTECTED] wrote:
> >>> Stefan Behnel wrote:
> BTW: any reason you need to use XSV? There are some other libraries out
> there
> that c
"Ant" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I have a home-grown Wiki that I created as an excercise, with it's own
> wiki markup (actually just a clone of the Trac wiki markup). The wiki
> text parser I wrote works nicely, but makes heavy use of regexes, tags
> and stacks to
"MC" wrote:
> " are your friend.
to be precise, list2cmdline is your friend. see discussion and examples here:
http://effbot.org/pyfaq/why-can-t-raw-strings-r-strings-end-with-a-backslash.htm
--
http://mail.python.org/mailman/listinfo/python-list
I didn't know about this product you mention (wxDesigner).
I download the trial and it seems pretty good, reminds me the wxGlade.
So you make the GUI in this, generate Python code and import the module
on your main project and reference it respectively ??
On Nov 22, 4:58 pm, hg <[EMAIL PROTECTE
king kikapu wrote:
>
> Hi to all,
>
> i am not sure if this question really belongs here but anyway, here it
> goes: I have seen a lot of IDEs for Python, a lot of good stuff but
> actually none of them has what, for example, Visual Studio has: a
> Visual Editor (with the ability to place contr
Here it's very well explained:
http://groups.google.com/group/django-developers/browse_thread/thread/7bcb01ec38e7e6cd
syncdb() method:
http://code.djangoproject.com/browser/django/trunk/django/core/management.py#L435
But I'm not sure if is a django problem or from python.
MindClass ha escrito:
Yes,
Actually when you create the project from wxDesigner, the "main" will
also be generated for you ... then you include the correct files in
eclipse (note that one file never needs to be edited ... like glade).
I went for wxDesigner years ago when wxglade was fairly unstable ...
have not tested
Michael,
put this at the top of your code. After the window
closes read the testLog.out file. It may give you
a clue as to what is happening.
sys.stdout = open('testLog.out', 'w')
jim-on-linux
http://www.inqvista.com
On Tuesday 21 November 2006 22:20, mkengel wrote:
> Caution: newbie q
> OK I see that now. Thanks for pointing that out. So basically, I can't
> do what I want at all. That's a bit of a pain. Is there no way of
> tricking Qt into thinking I'm running it in the main thread?
Maybe you can either invert the thread-roles - that is, run your "main"
application in a threa
Diez B. Roggisch wrote:
> > OK I see that now. Thanks for pointing that out. So basically, I can't
> > do what I want at all. That's a bit of a pain. Is there no way of
> > tricking Qt into thinking I'm running it in the main thread?
>
> Maybe you can either invert the thread-roles - that is, run
anders wrote:
>
> Diez B. Roggisch wrote:
>> > OK I see that now. Thanks for pointing that out. So basically, I can't
>> > do what I want at all. That's a bit of a pain. Is there no way of
>> > tricking Qt into thinking I'm running it in the main thread?
>>
>> Maybe you can either invert the thre
Steven D'Aprano wrote:
> On Tue, 21 Nov 2006 22:39:09 +0100, Mathias Panzenboeck wrote:
> > Yes, this is known. I think IronPython uses a specialized dictionary for
> > members, which prohibits
> > malformed names. I don't know if there will be such a dictionary in any
> > future CPython version
Peter Otten, your solution is very nice, it uses groupby splitting on
empty lines, so it doesn't need to read the whole files into memory.
But Daniel Nogradi says:
> But the names of the fields (node, x, y) keeps changing from file to
> file, even their number is not fixed, sometimes it is (node,
Hi,
I'm trying to construct a parser, but I'm stuck with some basic stuff... For
example, I want to match the following:
letter = "A"..."Z" | "a"..."z"
literal = letter+
include_bool := "+" | "-"
term = [include_bool] literal
So I defined this as:
literal = Word(alphas)
include_bool = Optional
On Tue, Nov 21, 2006 at 05:00:32PM -0800, Tom Plunket wrote:
> Bruno Desthuilliers wrote:
>
> > > I've got a bunch of code that runs under a bunch of unit tests. It'd
> > > be really handy if when testing I could supply replacement
> > > functionality to verify that the right things get called wi
> > I'm just a bit loathe to download and install more stuff when
> > something simpler appears to be near-at-hand. ...especially
> > considering the page describing this module doesn't offer any download
> > links! http://python-mock.sourceforge.net/
> How about mini-mock:
> http://blog.ianbicki
Dear List,
I was writing a Python extension module, including a sleeping call to
poll(2), and noticed, to my great surprise (and joy), that even when
blocking there, KeyboardInterrupt still worked properly when sending
SIGINTs to the interpreter. It really got me wondering how it works,
though.
I
Hi,
I'm bringing over a thread that's going on on f.c.l.python.
The point was to get rid of french accents from words.
We noticed that len('à') != len('a') and I found the hack below to fix
the "problem" ... yet I do not understand - especially since 'à' is
included in the extended ASCII table,
Hi,
I am using Python 2.4 and cx_Oracle. I have a stored proc that takes two
arguments. First is an NUMBER, second is a BOOLEAN. How do you call that
stored procedure?
After properly extablishing a connection, I have something like this:
cursor = con.cursor()
cursor.callproc("testproc",[123,Tr
Fredrik Tolf wrote:
> So how does it work? Does my code get to return Py_FALSE, and the
> interpreter ignores it, seeing that an exception is set? Is a non-local
> exit performed right over my call stack (in which case my next question
> would be how to clean up resources being used from my C code
hg wrote:
> We noticed that len('à') != len('a')
sounds odd.
>>> len('à') == len('a')
True
are you perhaps using an UTF-8 editor?
to keep your sanity, no matter what editor you're using, I recommend
adding a coding directive to the source file, and using *only* Unicode
string literals for n
Fredrik Lundh wrote:
> hg wrote:
>
>> We noticed that len('à') != len('a')
>
> sounds odd.
>
len('à') == len('a')
> True
>
> are you perhaps using an UTF-8 editor?
>
> to keep your sanity, no matter what editor you're using, I recommend
> adding a coding directive to the source file, and
hg wrote:
> Fredrik Lundh wrote:
>> hg wrote:
>>
>>> We noticed that len('à') != len('a')
>> sounds odd.
>>
> len('à') == len('a')
>> True
>>
>> are you perhaps using an UTF-8 editor?
>>
>> to keep your sanity, no matter what editor you're using, I recommend
>> adding a coding directive to the
tool69 wrote:
> Sorry, but did someone knows if Pida works under Windows ?
> Thanks.
No, it doesn't really. You can start it up with a bit of hacking, and I
have seen screenshots around, but only with the scintilla-based editor.
We are waiting for SVG support in GTK on windows. Writing a vim-win
hg <[EMAIL PROTECTED]> wrote:
>> or in other words, put this at the top of your file (where "utf-8" is
>> whatever your editor/system is using):
>>
>># -*- coding: utf-8 -*-
>>
>> and use
>>
>>u''
>>
>> for all non-ASCII literals.
>>
>>
>>
>
> Hi,
>
> The problem is that:
>
> # -
Duncan Booth wrote:
> hg <[EMAIL PROTECTED]> wrote:
>
>>> or in other words, put this at the top of your file (where "utf-8" is
>>> whatever your editor/system is using):
>>>
>>># -*- coding: utf-8 -*-
>>>
>>> and use
>>>
>>>u''
>>>
>>> for all non-ASCII literals.
>>>
>>>
>>>
>> Hi,
>>
>>
hg wrote:
> How would you handle the string.maketrans then ?
maketrans works on bytes, not characters. what makes you think that you
can use maketrans if you haven't gotten the slightest idea what's in the
string?
if you want to get rid of accents in a Unicode string, you can do the
approach
Hi,
I'm trying to construct a parser, but I'm stuck with some basic
stuff... For example, I want to match the following:
letter = "A"..."Z" | "a"..."z"
literal = letter+
include_bool := "+" | "-"
term = [include_bool] literal
So I defined this as:
literal = Word(alphas)
include_bool = Optional(
Chris Lambacher wrote:
> > > I'm just a bit loathe to download and install more stuff when
> > > something simpler appears to be near-at-hand. ...especially
> > > considering the page describing this module doesn't offer any download
> > > links! http://python-mock.sourceforge.net/
>
> Oh yeah,
Fredrik Lundh wrote:
> hg wrote:
>
>> How would you handle the string.maketrans then ?
>
> maketrans works on bytes, not characters. what makes you think that you
> can use maketrans if you haven't gotten the slightest idea what's in the
> string?
>
> if you want to get rid of accents in a Unic
Hi all,
line is am trying to match is
1959400|Q2BYK3|Q2BYK3_9GAMM Hypothetical outer membra29.90.00011 1
regex i have written is
re.compile
(r'(\d+?)\|((P|O|Q)\w{5})\|\w{3,6}\_\w{3,5}\s+?.{25}\s{3}(\d+?\.\d)\s+?(\d\.\d+?)')
I am trying to extract 0.0011 value from the above line.
why
hg wrote:
> Duncan Booth wrote:
> > hg <[EMAIL PROTECTED]> wrote:
> >
> >>> or in other words, put this at the top of your file (where "utf-8" is
> >>> whatever your editor/system is using):
> >>>
> >>># -*- coding: utf-8 -*-
> >>>
> >>> and use
> >>>
> >>>u''
> >>>
> >>> for all non-ASCII
On Wed, Nov 22, 2006 at 11:17:52AM -0800, Bytter wrote:
> Hi,
>
> I'm trying to construct a parser, but I'm stuck with some basic
> stuff... For example, I want to match the following:
>
> letter = "A"..."Z" | "a"..."z"
> literal = letter+
> include_bool := "+" | "-"
> term = [include_bool] liter
"Szabolcs Nagy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've just seen that gopherlib is deprecated in python 2.5
> http://docs.python.org/lib/module-gopherlib.html
>
> we still use this protocol (though there are only few working gopher
> servers are left on the net)
>
> My
Tor Erik Soenvisen wrote:
> How safe is the following code against SQL injection:
>
> # Get user privilege
> digest = sha.new(pw).hexdigest()
> # Protect against SQL injection by escaping quotes
> uname = uname.replace("'", "''")
> sql = 'SELECT privilege FR
> line is am trying to match is
> 1959400|Q2BYK3|Q2BYK3_9GAMM Hypothetical outer membra29.90.00011 1
>
> regex i have written is
> re.compile
> (r'(\d+?)\|((P|O|Q)\w{5})\|\w{3,6}\_\w{3,5}\s+?.{25}\s{3}(\d+?\.\d)\s+?(\d\.\d+?)')
>
> I am trying to extract 0.0011 value from the above line
Thank you for your answers.
In fact, I'm getting start with Python.
I was looking for transform a text through elementary cryptographic
processes (Vigenère).
The initial text is in a file, and my system is under UTF-8 by default
(Ubuntu)
--
http://mail.python.org/mailman/listinfo/python-list
HI Tim,
oof!
thats true!
thanks a lot.
Is there any tool to simplify building the regex ?
regards,
KM
On 11/23/06, Tim Chase <[EMAIL PROTECTED]> wrote:
> line is am trying to match is
> 1959400|Q2BYK3|Q2BYK3_9GAMM Hypothetical outer membra29.90.00011
1
>
> regex i have written is
>
1 - 100 of 152 matches
Mail list logo