Paulo da Silva wrote:
> Hi!
>
> What is the best way to read a file that begins with some few text lines
> and whose rest is a binary stream?
>
> As an exmaple ... files .pnm.
>
> Thanks for any comments/help on this.
A mixed text/binary file is really a binary file that contains some binary
Hello Everyone,
I am new to Python Web development. I am creating a Web Page with FLask. The
Pages takes input as file (file upload) and the process the file and gives the
output as a file(downloading the file)
But I am having error.
My Python file :
from flask import Flask
from flask import
On 10Mar2015 04:01, Paulo da Silva wrote:
On 10-03-2015 00:55, Dave Angel wrote:
On 03/09/2015 08:45 PM, Paulo da Silva wrote:
What is the best way to read a file that begins with some few text lines
and whose rest is a binary stream?
[...]
Generally speaking, you can treat a piece of a bina
On 10-03-2015 00:56, Chris Angelico wrote:
> On Tue, Mar 10, 2015 at 11:45 AM, Paulo da Silva
> wrote:
>> Hi!
>>
...
> Read the entire file in binary mode, and figure out which parts are
> text and how they're encoded (possibly ASCII or UTF-8). Then take just
> those snippets, and decode them. So
On 10-03-2015 00:55, Dave Angel wrote:
> On 03/09/2015 08:45 PM, Paulo da Silva wrote:
>> Hi!
>>
>> What is the best way to read a file that begins with some few text lines
>> and whose rest is a binary stream?
>>
...
>
> In which version of Python? there's a huge difference between 2.x and 3.x
On Tue, Mar 10, 2015 at 12:01 PM, Dave Angel wrote:
>> data = open("some_file", "rb")
>
>
> You accidentally omitted the part where you read() the data
>
> data = data.read()
You know, that would help... a LOT. :)
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 03/09/2015 08:56 PM, Chris Angelico wrote:
On Tue, Mar 10, 2015 at 11:45 AM, Paulo da Silva
wrote:
Hi!
What is the best way to read a file that begins with some few text lines
and whose rest is a binary stream?
As an exmaple ... files .pnm.
Thanks for any comments/help on this.
Read the
On Tue, Mar 10, 2015 at 11:45 AM, Paulo da Silva
wrote:
> Hi!
>
> What is the best way to read a file that begins with some few text lines
> and whose rest is a binary stream?
>
> As an exmaple ... files .pnm.
>
> Thanks for any comments/help on this.
Read the entire file in binary mode, and figu
On 03/09/2015 08:45 PM, Paulo da Silva wrote:
Hi!
What is the best way to read a file that begins with some few text lines
and whose rest is a binary stream?
As an exmaple ... files .pnm.
Thanks for any comments/help on this.
In which version of Python? there's a huge difference between 2.
Hi!
What is the best way to read a file that begins with some few text lines
and whose rest is a binary stream?
As an exmaple ... files .pnm.
Thanks for any comments/help on this.
--
https://mail.python.org/mailman/listinfo/python-list
On 03/09/2015 05:47 PM, Steven D'Aprano wrote:
> Michael Parchet wrote:
>
>> Hello,
>>
>> For a new project, a person recommande me to use Python 3
>>
>> can I use Python 3 with a Python 2 y module ex : pyQt 4 ?
>
> Maybe.
>
> If the module is really only Python 2, then no. If it is pure-Python,
Michael Parchet wrote:
> Hello,
>
> For a new project, a person recommande me to use Python 3
>
> can I use Python 3 with a Python 2 y module ex : pyQt 4 ?
Maybe.
If the module is really only Python 2, then no. If it is pure-Python, with
no C extensions, then you might be able to fork it and u
Hello!
I'm pleased to announce minor bugfix releases 2.1.1 and 1.7.4.
What's new in SQLObject
===
* Minor fix in PostgresConnection: close the cursor and connection
in _createOrDropDatabase even after an error.
Contributor for this release is Gregor Horvath.
For a more c
On 09/03/2015 22:30, Michael Parchet wrote:
Hello,
For a new project, a person recommande me to use Python 3
can I use Python 3 with a Python 2 y module ex : pyQt 4 ?
Tanks for your answer
Best regards
mparchet
Python 2 code can be converted with
https://docs.python.org/3/library/2to3.ht
I'm having serious trouble getting cx_Freeze and matplotlib to agree
where the mpl-data folder is on an Ubuntu 14.04 machine.
I'm configured with python3-matplotlib 1.3.1 having come from the Ubuntu
repositories, and a (now slightly modified) cx_Freeze 4.3.4 from the
cheese shop.
Originally I
Hello,
For a new project, a person recommande me to use Python 3
can I use Python 3 with a Python 2 y module ex : pyQt 4 ?
Tanks for your answer
Best regards
mparchet
--
https://mail.python.org/mailman/listinfo/python-list
On 3/9/2015 5:34 AM, Larry Hastings wrote:
On behalf of the Python development community and the Python 3.5 release
team, I'm thrilled to announce the availability of Python 3.5.0a2.
Python 3.5.0a2 is the second alpha release of Python 3.5, which will be
the next major release of Python. Pytho
On Monday, March 9, 2015 at 10:28:20 AM UTC-5, Daniel wrote:
> I have a dao.py module with a dao class declared and I want to use mock to
> set a return value for a dao function, dao.execute_ldap_search().
>
> import mock
> import unittest
> import model, dao
>
> class TestPeopleDAO(unittest.Tes
- Original Message -
> From: Jonas Wielicki
> To: python-list@python.org
> Cc:
> Sent: Monday, March 9, 2015 8:12 PM
> Subject: Re: HELP!! How to ask a girl out with a simple witty Python code??
>
> On 09.03.2015 14:39, Omar Abou Mrad wrote:
>> On Thu, Mar 5, 2015 at 3:34 AM, Xrrific
On 09.03.2015 14:39, Omar Abou Mrad wrote:
> On Thu, Mar 5, 2015 at 3:34 AM, Xrrific wrote:
>
>> Guys, please Help!!!
>>
>> I am trying to impress a girl who is learning python and want ask her out
>> at the same time.
>>
>> Could you please come up with something witty incorporating a simple
>>
Daniel writes:
> I have a dao.py module with a dao class declared and I want to use
> mock to set a return value for a dao function,
> dao.execute_ldap_search().
You have found a change which worked, but you might not have understood
why yet.
The documentation for the ‘unittest.mock’ library co
Steven,
I'm somewhat argeeing with you, regarding the general analysisn, yet I'm not
quite sure about your analysis of the repeated bisect call code. In particular,
in the sample that you've given:
data = [i/100 for i in range(1, 701, 7)]
data.sort(key=str)
keyed_data = [str(x) for x in dat
Antoon Pardon wrote:
> I am using PLY for a parsing task which uses re for the lexical
> analysis. Does anyone
> know what regular expression to use for a sequence of letters? There is
> a class for alphanumerics but I can't find one for just letters, which I
> find odd.
>
> I am using python 3.4
On 2015-03-09 15:29, Antoon Pardon wrote:
> Op 09-03-15 om 13:50 schreef Tim Chase:
> >> (?:(?!_|\d)\w)\w+
> > If you don't have to treat it as an atom, you can simplify that to
> > just
> >
> > (?!_|\d)\w+
> >
> > which just means that the first character can't be an underscore
> > or digit.
>
Op 09-03-15 om 14:33 schreef Albert-Jan Roskam:
> I was going to make the same remark, but with a slightly different solution:
> In [1]: repr(re.search("[a-zA-Z]", "é"))
> Out[1]: 'None'
>
> In [2]: repr(re.search(u"[^\d\W_]+", u"é", re.I | re.U))
> Out[2]: '<_sre.SRE_Match object at 0x027CDB10>
I found that the following change worked:
@mock.patch('dao.dao.execute_ldap_search')
def test_find_by_last_first_comma(self, mock_dao):
# setup the mock
mock_dao.return_value = self.ldap_person_response
Daniel
On Monday, March 9, 2015 at 10:28:20 AM UTC-5, Daniel wrote:
>
I have a dao.py module with a dao class declared and I want to use mock to set
a return value for a dao function, dao.execute_ldap_search().
import mock
import unittest
import model, dao
class TestPeopleDAO(unittest.TestCase):
ldap_person_response = SOME_DICT
@mock.patch('dao.dao')
Op 09-03-15 om 15:44 schreef Chris Angelico:
> On Tue, Mar 10, 2015 at 1:41 AM, Antoon Pardon
> wrote:
>> Op 09-03-15 om 14:35 schreef Chris Angelico:
>>> On Mon, Mar 9, 2015 at 11:26 PM, Antoon Pardon
>>> wrote:
It seems odd that one should need such an ugly expression for something
t
Op 09-03-15 om 15:39 schreef Chris Angelico:
> On Tue, Mar 10, 2015 at 1:34 AM, Antoon Pardon
> wrote:
>>> There is str.isidentifier, which returns True if something is a valid
>>> identifier name:
>>>
>> '℮'.isidentifier()
>>> True
>> Which is not very usefull in a context of lexical analysis
On Tue, Mar 10, 2015 at 1:41 AM, Antoon Pardon
wrote:
> Op 09-03-15 om 14:35 schreef Chris Angelico:
>> On Mon, Mar 9, 2015 at 11:26 PM, Antoon Pardon
>> wrote:
>>> It seems odd that one should need such an ugly expression for something
>>> that is
>>> used rather frequently for parsing computer
Op 09-03-15 om 14:35 schreef Chris Angelico:
> On Mon, Mar 9, 2015 at 11:26 PM, Antoon Pardon
> wrote:
>> It seems odd that one should need such an ugly expression for something that
>> is
>> used rather frequently for parsing computer languages and the like.
> Possibly because computer language
On Tue, Mar 10, 2015 at 1:34 AM, Antoon Pardon
wrote:
>> There is str.isidentifier, which returns True if something is a valid
>> identifier name:
>>
>> >>> '℮'.isidentifier()
>> True
>
> Which is not very usefull in a context of lexical analysis. I don't need to
> know
> if a particular string i
Op 09-03-15 om 14:32 schreef Wolfgang Maier:
...
>
>> It seems odd that one should need such an ugly expression for
>> something that is
>> used rather frequently for parsing computer languages and the like.
>>
>
> There is str.isidentifier, which returns True if something is a valid
> identifier
Op 09-03-15 om 13:50 schreef Tim Chase:
> On 2015-03-09 13:26, Antoon Pardon wrote:
>> Op 09-03-15 om 12:17 schreef Tim Chase:
>>> (?:(?!_|\d)\w)
>> So if I understand correctly the following should be a regular
>> expression for a python3 identifier.
>>
>> (?:(?!_|\d)\w)\w+
> If you don't have
On 09/03/2015 14:15, Dave Angel wrote:
> On 03/07/2015 02:15 PM, Markos wrote:
>> Hi,
>>
>> I'm beginning to study the numpy.
>>
>> When I open a terminal (Debian Squeeze) and run the python interpreter
>> the command "import numpy as np" run without errors.
>>
>> But when I run the same command on
On 03/07/2015 02:15 PM, Markos wrote:
Hi,
I'm beginning to study the numpy.
When I open a terminal (Debian Squeeze) and run the python interpreter
the command "import numpy as np" run without errors.
But when I run the same command on idle3 the following error appears.
import numpy as np
T
On 03/09/2015 03:04 PM, Wolfgang Maier wrote:
On 03/09/2015 02:33 PM, Albert-Jan Roskam wrote:
On Mon, 3/9/15, Tim Chase wrote:
"[^\d\W_]+" means something like "one or more (+) of 'not (a digit, a
non-word, an underscore)'.
interesting (using Py
On 2015-03-09 13:26, Antoon Pardon wrote:
> Op 09-03-15 om 12:17 schreef Tim Chase:
>> (?:(?!_|\d)\w)
>
> So if I understand correctly the following should be a regular
> expression for a python3 identifier.
>
> (?:(?!_|\d)\w)\w+
If you don't have to treat it as an atom, you can simplify tha
On 03/09/2015 02:33 PM, Albert-Jan Roskam wrote:
On Mon, 3/9/15, Tim Chase wrote:
"[^\d\W_]+" means something like "one or more (+) of 'not (a digit, a non-word,
an underscore)'.
interesting (using Python3.4 and
U+2188 ROMAN NUMERAL ONE HUNDRED
On Thu, Mar 5, 2015 at 3:34 AM, Xrrific wrote:
> Guys, please Help!!!
>
> I am trying to impress a girl who is learning python and want ask her out
> at the same time.
>
> Could you please come up with something witty incorporating a simple
> python line like If...then... but..etc.
>
> You will m
On 09.03.15 14:26, Antoon Pardon wrote:
So if I understand correctly the following should be a regular expression for
a python3 identifier.
(?:(?!_|\d)\w)\w+
It seems odd that one should need such an ugly expression for something that is
used rather frequently for parsing computer languages
On Mon, 3/9/15, Tim Chase wrote:
Subject: Re: Letter class in re
To: python-list@python.org
Date: Monday, March 9, 2015, 12:17 PM
On 2015-03-09 11:37,
Wolfgang Maier wrote:
> On 03/09/2015
11:23 AM, Antoon Pardon wrote:
>> Does
anyone know w
On Mon, Mar 9, 2015 at 11:26 PM, Antoon Pardon
wrote:
> It seems odd that one should need such an ugly expression for something that
> is
> used rather frequently for parsing computer languages and the like.
Possibly because computer language parsers don't use regular expressions. :)
ChrisA
--
On 03/09/2015 01:26 PM, Antoon Pardon wrote:
Op 09-03-15 om 12:17 schreef Tim Chase:
On 2015-03-09 11:37, Wolfgang Maier wrote:
On 03/09/2015 11:23 AM, Antoon Pardon wrote:
Does anyone know what regular expression to use for a sequence of
letters? There is a class for alphanumerics but I can't
On Wednesday, March 4, 2015 at 8:34:16 PM UTC-5, Xrrific wrote:
> Guys, please Help!!!
>
> I am trying to impress a girl who is learning python and want ask her out at
> the same time.
>
> Could you please come up with something witty incorporating a simple python
> line like If...then... but..
On Monday, March 9, 2015 at 12:05:05 PM UTC+5:30, Steven D'Aprano wrote:
> Chris Angelico wrote:
>
> > As to the notion of rejecting the construction of strings containing
> > these invalid codepoints, I'm not sure. Are there any languages out
> > there that have a Unicode string type that require
Op 09-03-15 om 12:17 schreef Tim Chase:
> On 2015-03-09 11:37, Wolfgang Maier wrote:
>> On 03/09/2015 11:23 AM, Antoon Pardon wrote:
>>> Does anyone know what regular expression to use for a sequence of
>>> letters? There is a class for alphanumerics but I can't find one
>>> for just letters, which
On 2015-03-09 11:37, Wolfgang Maier wrote:
> On 03/09/2015 11:23 AM, Antoon Pardon wrote:
>> Does anyone know what regular expression to use for a sequence of
>> letters? There is a class for alphanumerics but I can't find one
>> for just letters, which I find odd.
>
> how about [a-zA-Z] ?
That b
Op 09-03-15 om 11:37 schreef Wolfgang Maier:
> On 03/09/2015 11:23 AM, Antoon Pardon wrote:
>> I am using PLY for a parsing task which uses re for the lexical
>> analysis. Does anyone
>> know what regular expression to use for a sequence of letters? There is
>> a class for alphanumerics but I can't
On Mar 7, 2015, at 6:39 PM, James Dekker wrote:
> I am currently running OS X Yosemite (10.10.2) on my MacBook Pro... By
> default, Apple ships Python 2.7.6 on Yosemite.
>
> Just downloaded and ran this installer for Python 3:
>
> python-3.4.3-macosx10.6.pkg
>
> When I opened up my Terminal
With defending reputations as important as receiving email I'm pleased
to announce another beta of django-dmarc 0.1.3 is released to PyPI.
https://pypi.python.org/pypi/django-dmarc
The Django DMARC project aims to help with implementing DMARC
"Domain-based Message Authentication, Reporting & C
On 03/09/2015 11:23 AM, Antoon Pardon wrote:
I am using PLY for a parsing task which uses re for the lexical
analysis. Does anyone
know what regular expression to use for a sequence of letters? There is
a class for alphanumerics but I can't find one for just letters, which I
find odd.
I am using
I am using PLY for a parsing task which uses re for the lexical
analysis. Does anyone
know what regular expression to use for a sequence of letters? There is
a class for alphanumerics but I can't find one for just letters, which I
find odd.
I am using python 3.4
--
Antoon Pardon
--
https://mail
On 07/03/2015 12:55, Daiyue Weng wrote:
[... snip pip-related problems with installing 2.7.9 on Windows ...]
The OP has raised this as issue23604. I've responded over there because
it's a duplicate of a known issue (issue22028).
http://bugs.python.org/issue23604#msg237628
TJG
--
https://mail.p
Hi all,
I'd like to as for advise about posibilities of redirecting error
traceback via sys.excepthook in a gui (wxpython in my case) with a
requirement, that the errors from the code typed in the interactive
interpreter (as part of my app) are printed there directly and are not
catched from the ex
>
> Hello,
> I am working with pyqt framework and i'm looking for a calendar (organizer)
> like korganizer, evolution or outlook calendar that is OS indépendent with
> recurrence event. writting in python with an UI framework (ex pyqt, pygtk,
> wkpython, tkinter or other ui framwork) Where c
I am currently running OS X Yosemite (10.10.2) on my MacBook Pro... By
default, Apple ships Python 2.7.6 on Yosemite.
Just downloaded and ran this installer for Python 3:
python-3.4.3-macosx10.6.pkg
When I opened up my Terminal and typed in python, this is what came up:
Python 2.7.6 (default, S
Hello,
I am working with pyqt framework and i'm looking for a calendar
(organizer) like korganizer, evolution or outlook calendar that is OS
indépendent with recurrence event. writting in python with an UI
framework (ex pyqt, pygtk, wkpython, tkinter or other ui framwork) Where
could I fin
Hi,
I'm beginning to study the numpy.
When I open a terminal (Debian Squeeze) and run the python interpreter
the command "import numpy as np" run without errors.
But when I run the same command on idle3 the following error appears.
import numpy as np
Traceback (most recent call last):
Fil
Please,
How to install the ia636 library on Debian (Squeeze) with Python 2.6?
Thank you,
Markos
--
https://mail.python.org/mailman/listinfo/python-list
Hi, I was doing a fresh installation for Python 2.7.9 (32 bit) and 3.4.3
(32 bit) (downloaded from PSF) on Win7 X64 today, and I found that there is
no 'Script' folder in 'Python27' and 'Python34' folder as first child level
folder, but there is one in Tools. However, I couldn't find pip within tha
On behalf of the Python development community and the Python 3.5 release
team, I'm thrilled to announce the availability of Python 3.5.0a2.
Python 3.5.0a2 is the second alpha release of Python 3.5, which will be
the next major release of Python. Python 3.5 is still under heavy
development
62 matches
Mail list logo