On Thu, 08 Apr 2010 23:22:46 -0700, hiral wrote:
> Hi,
>
> Is there any module/utility like 'rsync' in python.
http://code.activestate.com/recipes/577022-rsync-algorithm-in-python/
but you probably aren't going to beat the performance and reliability of
your platform's rsync utility. Chances
Ben Finney wrote:
Vinay Sajip writes:
On Apr 8, 1:58 pm, Rebelo wrote:
Vinay Sajip wrote:
My guess is - files_preserve needs to be passed a file handle and
not alogginghandler.
This is correct. As the ‘DaemonContext.__init__’ docstring says::
| `files_preserve`
| :Default: ``None
hiral wrote:
> Hi,
>
> Is there any module/utility like 'rsync' in python.
>
http://freshmeat.net/projects/pysync/
http://vdesmedt.com/~vds2212/rsync.html
--
---
| Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^-
Hi,
Is there any module/utility like 'rsync' in python.
Thank you in advance.
-Hiral
--
http://mail.python.org/mailman/listinfo/python-list
On 04/09/10 05:13, Alf P. Steinbach wrote:
Second, I'm unable to find documentation of when they're called and what
they do. It seems that (A) when the connection object's stream is
exhausted by reading, its close() method is called automatically, and
(B) that when the text_reader object's clos
On Apr 9, 10:42 am, omnia neo wrote:
> On Apr 9, 10:30 am, Stefan Behnel wrote:
>
> > omnia neo, 09.04.2010 07:01:
>
> > > import siptest
>
> > > I get following error :
> > > import error : no module named siptest
>
> > Is the directory where your siptest.dll lies in your PYTHONPATH (sys.path)?
On Apr 9, 10:30 am, Stefan Behnel wrote:
> omnia neo, 09.04.2010 07:01:
>
> > import siptest
>
> > I get following error :
> > import error : no module named siptest
>
> Is the directory where your siptest.dll lies in your PYTHONPATH (sys.path)?
>
> Otherwise, Python can't find it.
>
> Stefan
tha
omnia neo, 09.04.2010 07:01:
import siptest
I get following error :
import error : no module named siptest
Is the directory where your siptest.dll lies in your PYTHONPATH (sys.path)?
Otherwise, Python can't find it.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Hi All,
I was looking at the SIP tool to create a C extensions for python to
call.
Here is what I tried:
1. I created a simple c file and .h file
2. Then I created a corresponding testfunc.sip file
###
%CModule siptest 0
%UnitCode
#include"testfunc.h"
%End
void pyfunc()
On Thu, 08 Apr 2010 21:32:10 -0400, monkeys paw wrote:
> I was going from example and looking for something useful from the
> lambda feature. I come from C -> Perl -> Python (recent). I don't find
> lambda very useful yet.
Perhaps you feel that lambda is a special kind of object. It isn't. It's
On Apr 8, 9:32 pm, Dotan Cohen wrote:
> > Regexes do have their uses. It's a case of knowing when they are the
> > best approach and when they aren't.
>
> Agreed. The problems begin when the "when they aren't" is not recognised.
Arguing against this is like arguing against motherhood and apple
pi
Consider ...
import urllib.request # urlopen
import codecs # getreader
import sys # stderr
def text_stream_from( url, encoding ):
text_reader = codecs.getreader( encoding )
connection = urllib.request.urlopen( url )
return text_reader( connection )
def lis
On 04/09/10 12:32, Dotan Cohen wrote:
>> Regexes do have their uses. It's a case of knowing when they are the
>> best approach and when they aren't.
>
> Agreed. The problems begin when the "when they aren't" is not recognised.
But problems also arises when people are suggesting overly complex
ser
On 4/7/2010 12:15 AM, Patrick Maupin wrote:
On Apr 6, 11:10 pm, Patrick Maupin wrote:
On Apr 6, 11:04 pm, Patrick Maupin wrote:
On Apr 6, 10:16 pm, monkeys paw wrote:
I have the following acre meter which works for integers,
how do i convert this to float? I tried
return float ((208
> Regexes do have their uses. It's a case of knowing when they are the
> best approach and when they aren't.
>
Agreed. The problems begin when the "when they aren't" is not recognised.
--
Dotan Cohen
http://bido.com
http://what-is-what.com
--
http://mail.python.org/mailman/listinfo/python-list
Dotan Cohen wrote:
I would have agreed with you if someone were to make the statement
until a few weeks ago; somehow in the last week or so, the mood about
regex seems to has shifted to "regex is not suitable for anything"
type of mood. As soon as someone (OP or not) proposed a regex
solution, so
On 4/8/2010 7:19 PM, Patrick Maupin wrote:
On Apr 8, 6:06 pm, monkeys paw wrote:
On 4/7/2010 1:08 PM, Peter Pearson wrote:
On Tue, 06 Apr 2010 23:16:18 -0400, monkeys pawwrote:
I have the following acre meter which works for integers,
how do i convert this to float? I tried
return f
* Brendan Miller:
Thanks Steven and Gabriel. Those are very informative responses.
In my case my resource isn't bound to a lexical scope, but the:
def __del__(self,
delete_my_resource=delete_my_resource):
pattern works quite well. I've made sure to prevent my class from
being
> I would have agreed with you if someone were to make the statement
> until a few weeks ago; somehow in the last week or so, the mood about
> regex seems to has shifted to "regex is not suitable for anything"
> type of mood. As soon as someone (OP or not) proposed a regex
> solution, someone else
Thanks Steven and Gabriel. Those are very informative responses.
In my case my resource isn't bound to a lexical scope, but the:
def __del__(self,
delete_my_resource=delete_my_resource):
pattern works quite well. I've made sure to prevent my class from
being part of a circular
On 04/08/2010 12:22 PM, varnikat t wrote:
it gives me this error
TypeError: coercing to Unicode: need string or buffer, list found
Thanks for the help.it detects now using glob.glob("*.*.txt")
Can u suggest how to open and read file this way?
*if glob.glob("*.*.txt"):
file=open(gl
On Apr 8, 3:54 pm, "M. Hamed" wrote:
> Thanks Patrick, that is what I was exactly looking for.
You're welcome!
But I have to say, you should consider what Paul and Lie are saying.
In general, when I use a stack, I just use append() and pop(), as they
mention, and let the list automagically keep
On 04/08/10 18:20, Bruno Desthuilliers wrote:
> Lie Ryan a écrit :
>> On 04/07/10 18:34, Bruno Desthuilliers wrote:
>>> Lie Ryan a écrit :
>>> (snip)
>>>
Since in function in python is a first-class object, you can instead do
something like:
def process(document):
# not
On Apr 8, 6:35 pm, "Gabriel Genellina" wrote:
> The CPython source contains lots of shortcuts like that. Perhaps the
> checks should be stricter in some cases, but I imagine it's not so easy to
> fix: lots of code was written in the pre-2.2 era, assuming that internal
> types were not subcl
On Thu, Apr 8, 2010 at 4:01 PM, Joaquin Abian wrote:
> On Apr 9, 12:52 am, Ben Racine wrote:
>> I have a list...
>>
>> ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat',
>> 'dir_330_error.dat']
>>
>> I want to sort it based upon the numerical value only.
>>
>> Does someone have an eleg
Rebelo writes:
> i found a crude workaround:
> i wrote a function in which i start logging after deamon starts
That seems rather sub-optimal; you'll be unable to use the logger for
anything before the daemon context opens. This kind of problem is
exactly what ‘DaemonContext.files_preserve’ is in
Vinay Sajip writes:
> On Apr 8, 1:58 pm, Rebelo wrote:
> > Vinay Sajip wrote:
> > > My guess is - files_preserve needs to be passed a file handle and
> > > not alogginghandler.
This is correct. As the ‘DaemonContext.__init__’ docstring says::
| `files_preserve`
| :Default: ``None``
|
On 04/09/10 08:52, Ben Racine wrote:
> I have a list...
>
> ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat',
> 'dir_330_error.dat']
>
> I want to sort it based upon the numerical value only.
>
> Does someone have an elegant solution to this?
>
> Thanks,
> Ben R.
list.sort() and s
On 04/09/10 06:36, Robert Kern wrote:
> On 2010-04-08 15:08 PM, M. Hamed wrote:
>
>> On the other hand (other than installing NumPy) is there a built-in
>> way to do an array full of zeros or one just like the numpy.zeros()? I
>> know I can do it with list comprehension (like [0 for i in
>> range(
On 04/09/10 06:54, M. Hamed wrote:
> Thanks Patrick, that is what I was exactly looking for.
>
> Paul, thanks for your example. wasn't familiar with the stack class.
The stack class is nothing but a wrapper that renames append() to
push(); everything you need can be fulfilled by the regular list
En Thu, 08 Apr 2010 04:07:53 -0300, Steven D'Aprano
escribió:
On Wed, 07 Apr 2010 20:14:23 -0700, Raymond Hettinger wrote:
[Raymond Hettinger]
> If the two collections have unequal sizes, then both ways immediately
> return unequal.
[Steven D'Aprano]
Perhaps I'm misinterpreting what you
On Apr 8, 6:06 pm, monkeys paw wrote:
> On 4/7/2010 1:08 PM, Peter Pearson wrote:
>
>
>
> > On Tue, 06 Apr 2010 23:16:18 -0400, monkeys paw wrote:
> >> I have the following acre meter which works for integers,
> >> how do i convert this to float? I tried
>
> >> return float ((208.0 * 208.0) * n)
On 4/7/2010 1:08 PM, Peter Pearson wrote:
On Tue, 06 Apr 2010 23:16:18 -0400, monkeys paw wrote:
I have the following acre meter which works for integers,
how do i convert this to float? I tried
return float ((208.0 * 208.0) * n)
def s(n):
... return lambda x: (208 * 208) * n
...
f = s
On Apr 9, 12:52 am, Ben Racine wrote:
> I have a list...
>
> ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat',
> 'dir_330_error.dat']
>
> I want to sort it based upon the numerical value only.
>
> Does someone have an elegant solution to this?
>
> Thanks,
> Ben R.
not sure about elega
Ben Racine wrote:
I have a list...
['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat',
'dir_330_error.dat']
I want to sort it based upon the numerical value only.
Does someone have an elegant solution to this?
Thanks,
Ben R.
How about a one liner?
L.sort(key=lambda s: int
On Thu, Apr 8, 2010 at 3:52 PM, Ben Racine wrote:
> I have a list...
>
> ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat',
> 'dir_330_error.dat']
>
> I want to sort it based upon the numerical value only.
a = ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat',
'dir_330_error.
I have a list...
['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat',
'dir_330_error.dat']
I want to sort it based upon the numerical value only.
Does someone have an elegant solution to this?
Thanks,
Ben R.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Apr 8, 2010 at 2:34 PM, Tobiah wrote:
>> How does that answer your original question?
>
> I was able to do this:
>
> import colorsys
>
> sat = 1
> value = 1
> length = 1000
> for x in range(0, length + 1):
> hue = x / float(length)
> color = list(colorsys.hsv_to_rgb(hue, sat,
Me:
>You should use different variables for the two loops.
Actually it is closing the divs that makes it work in FireFox:
import colorsys
sat = 1
value = 1
length = 1000
for h in range(0, length + 1):
hue = h / float(length)
color = list(colorsys.hsv_to_rgb(hue, sat, value
Tobiah:
> for x in range(0, length + 1):
> ...
> for x in range(3):
You should use different variables for the two loops.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
On 4/9/10, Tim Chase wrote:
> Lie Ryan wrote:
>> Why am I seeing a lot of this pattern lately:
>>
>> OP: Got problem with string
>> +- A: Suggested a regex-based solution
>>+- B: Quoted "Some people ... regex ... two problems."
>>
>> or
>>
>> OP: Writes some regex, found problem
>> +- A: Quote
On Apr 8, 3:40 pm, gry wrote:
> > >>> s='555tHe-rain.in#=1234'
> > >>> import re
> > >>> r=re.compile(r'([a-zA-Z]+|\d+|.)')
> > >>> r.findall(s)
> > ['555', 'tHe', '-', 'rain', '.', 'in', '#', '=', '1234']
>
> This is nice and simple and has the invertible property that Patrick
> me
OMG! That's beautiful! I loved the [0]*n how simple and how it never
occurred to me!
Robert I agree with your comment. I feel though that since I'm not
very experienced yet with Python, it's useful to learn about all those
simple yet powerful methods so I can use them when I really need them.
Plus
Thanks Patrick, that is what I was exactly looking for.
Paul, thanks for your example. wasn't familiar with the stack class. I
feel Patrick's method is a lot simpler for my purpose.
Regards.
On Apr 8, 1:29 pm, Patrick Maupin wrote:
> On Apr 8, 3:21 pm, "M. Hamed" wrote:
>
>
>
> > I have troubl
Giacomo Boffi writes:
> Manuel Graune writes:
>
>> Hello everyone,
>>
>> I am looking for ways to use a python file as a substitute for simple
>> pen and paper calculations.
>
> search("embedded calc mode") if manuel in emacs_fellows_set or sys.exit(1)
Well, the subject does say python and not
> >>> s='555tHe-rain.in#=1234'
> >>> import re
> >>> r=re.compile(r'([a-zA-Z]+|\d+|.)')
> >>> r.findall(s)
> ['555', 'tHe', '-', 'rain', '.', 'in', '#', '=', '1234']
This is nice and simple and has the invertible property that Patrick
mentioned above. Thanks much!
--
http://mail.py
Tobiah wrote:
How does that answer your original question?
I was able to do this:
import colorsys
sat = 1
value = 1
length = 1000
for x in range(0, length + 1):
hue = x / float(length)
color = list(colorsys.hsv_to_rgb(hue, sat, value))
for x in range(3):
Manuel Graune writes:
> Hello everyone,
>
> I am looking for ways to use a python file as a substitute for simple
> pen and paper calculations.
search("embedded calc mode") if manuel in emacs_fellows_set or sys.exit(1)
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 8, 10:08 pm, "M. Hamed"
wrote:
> Thanks All. That clears alot of confusion. It seems I assumed that
> everything that works for lists works for strings (the immutable vs
> mutable hasn't sunken in yet).
>
> On the other hand (other than installing NumPy) is there a built-in
> way to do an a
On 8 Apr, 19:49, gry wrote:
> [ python3.1.1, re.__version__='2.2.1' ]
> I'm trying to use re to split a string into (any number of) pieces of
> these kinds:
> 1) contiguous runs of letters
> 2) contiguous runs of digits
> 3) single other characters
>
> e.g. 555tHe-rain.in#=1234 should give:
On Apr 8, 3:40 pm, MRAB wrote:
...
> Group 1 and group 4 match '='.
> Group 1 and group 3 match '1234'.
>
> If a group matches then any earlier match of that group is discarded,
Wow, that makes this much clearer! I wonder if this behaviour
shouldn't be mentioned in some form in the python docs?
On 2010-04-08 15:08 PM, M. Hamed wrote:
On the other hand (other than installing NumPy) is there a built-in
way to do an array full of zeros or one just like the numpy.zeros()? I
know I can do it with list comprehension (like [0 for i in
range(0,20)] but these are too many keystrokes for python
Grant Edwards writes:
> If it's 2D data, you don't need to use a 3D graph.
if it's tabular data, you don't need an uber-histogram
--
giampippetto, coso, come si chiama? ah si` "MMAX" ha scritto:
> Tra il trascendente e l'interpretazione prevalente del dato come
> assioma ne passa...
--
http://
On Apr 8, 3:21 pm, "M. Hamed" wrote:
> I have trouble with some Python concept. The fact that you can not
> assign to a non-existent index in an array. For example:
>
> a = [0,1]
> a[2] => Generates an error
>
> I can use a.append(2) but that always appends to the end. Sometimes I
> want t
On Apr 8, 3:21 pm, "M. Hamed" wrote:
> I have trouble with some Python concept. The fact that you can not
> assign to a non-existent index in an array. For example:
>
> a = [0,1]
> a[2] => Generates an error
>
> I can use a.append(2) but that always appends to the end. Sometimes I
> want t
On 4/8/2010 1:08 PM M. Hamed said...
On the other hand (other than installing NumPy) is there a built-in
way to do an array full of zeros or one just like the numpy.zeros()? I
know I can do it with list comprehension (like [0 for i in
range(0,20)] but these are too many keystrokes for python :) I
I have trouble with some Python concept. The fact that you can not
assign to a non-existent index in an array. For example:
a = [0,1]
a[2] => Generates an error
I can use a.append(2) but that always appends to the end. Sometimes I
want to use this array as a stack and hence my indexing lo
Thanks All. That clears alot of confusion. It seems I assumed that
everything that works for lists works for strings (the immutable vs
mutable hasn't sunken in yet).
On the other hand (other than installing NumPy) is there a built-in
way to do an array full of zeros or one just like the numpy.zero
gry wrote:
[ python3.1.1, re.__version__='2.2.1' ]
I'm trying to use re to split a string into (any number of) pieces of
these kinds:
1) contiguous runs of letters
2) contiguous runs of digits
3) single other characters
e.g. 555tHe-rain.in#=1234 should give: [555, 'tHe', '-', 'rain',
'.',
On Apr 8, 1:49 pm, gry wrote:
> [ python3.1.1, re.__version__='2.2.1' ]
> I'm trying to use re to split a string into (any number of) pieces of
> these kinds:
> 1) contiguous runs of letters
> 2) contiguous runs of digits
> 3) single other characters
>
> e.g. 555tHe-rain.in#=1234 should give:
On 8 Apr, 19:49, gry wrote:
> [ python3.1.1, re.__version__='2.2.1' ]
> I'm trying to use re to split a string into (any number of) pieces of
> these kinds:
> 1) contiguous runs of letters
> 2) contiguous runs of digits
> 3) single other characters
>
> e.g. 555tHe-rain.in#=1234 should give:
gry wrote:
[ python3.1.1, re.__version__='2.2.1' ]
I'm trying to use re to split a string into (any number of) pieces of
these kinds:
1) contiguous runs of letters
2) contiguous runs of digits
3) single other characters
e.g. 555tHe-rain.in#=1234 should give: [555, 'tHe', '-', 'rain',
'.',
[ python3.1.1, re.__version__='2.2.1' ]
I'm trying to use re to split a string into (any number of) pieces of
these kinds:
1) contiguous runs of letters
2) contiguous runs of digits
3) single other characters
e.g. 555tHe-rain.in#=1234 should give: [555, 'tHe', '-', 'rain',
'.', 'in', '#', '=
Anssi Saari wrote:
John Nagle writes:
In theory, the FTP spec supports "three-way transfers", where the
source, destination, and control can all be on different machines.
But no modern implementation supports that.
I remember even using that way back when, Unix machines in the 1990s.
M. Hamed wrote:
I'm trying the following statements that I found here and there on
Google, but none of them works on my Python 2.5, are they too old? or
newer?
"abc".reverse()
Lists have a .reverse() method which reverses the list elements
in-place, but strings don't because they're immutable.
> How does that answer your original question?
I was able to do this:
import colorsys
sat = 1
value = 1
length = 1000
for x in range(0, length + 1):
hue = x / float(length)
color = list(colorsys.hsv_to_rgb(hue, sat, value))
for x in range(3):
color[x] = in
On Apr 8, 7:10 pm, "M. Hamed"
wrote:
> I'm trying the following statements that I found here and there on
> Google, but none of them works on my Python 2.5, are they too old? or
> newer?
>
> "abc".reverse()
This isn't valid Python in any version that I'm aware of. Where did
you see it? It would
M. Hamed wrote:
> I'm trying the following statements that I found here and there on
> Google, but none of them works on my Python 2.5, are they too old? or
> newer?
>
> "abc".reverse()
> import numpy
reverse does not work on strings but does work on lists:
>>> x=list("abc")
>>> x.reverse()
>>>
On Thu, Apr 8, 2010 at 10:39 PM, varnikat t wrote:
> Hey,
> Thanks for the help.it detects now using glob.glob("*.*.txt")
> Can u suggest how to open and read file this way?
>
> if glob.glob("*.*.txt"):
> file=open(glob.glob("*.*.txt"))
> self.text_view.get_buffer().set_tex
On Apr 8, 4:20 am, Bruno Desthuilliers wrote:
> Lie Ryan a écrit :
>
>
>
>
>
> > On 04/07/10 18:34, Bruno Desthuilliers wrote:
> >> Lie Ryan a écrit :
> >> (snip)
>
> >>> Since in function in python is a first-class object, you can instead do
> >>> something like:
>
> >>> def process(document):
>
I'm trying the following statements that I found here and there on
Google, but none of them works on my Python 2.5, are they too old? or
newer?
"abc".reverse()
import numpy
--
http://mail.python.org/mailman/listinfo/python-list
En Thu, 08 Apr 2010 12:26:56 -0300, Booter escribió:
I am trying to replace a series of periods in a sting with backspaces
that way I can easily parse information from a Windows command. the
current statement I have for this is
***Statement*
On Apr 8, 11:04 am, "Martin v. Loewis" wrote:
> That's because you need to re-learn some things.
Apparently so, every little item is a lesson. Thank you.
-- Gnarlie
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Apr 8, 2010 at 1:14 PM, Tobiah wrote:
>> Look at the colorsys module.
>>
>> http://docs.python.org/library/colorsys.html?highlight=colorsys#module-
> colorsys
>
> That so rocks. Thanks!
> --
> http://mail.python.org/mailman/listinfo/python-list
>
How does that answer your original questi
Tobiah wrote:
I'm having a difficult time with this. I want
to display a continuous range of hues using HTML
hex representation (#RRGGBB). How would I go
about scanning through the hues in order to
make a rainbow?
Thanks,
Toby
Use the hue-saturation-value color space, and call hsv_to_r
it gives me this error
TypeError: coercing to Unicode: need string or buffer, list found
On Thu, Apr 8, 2010 at 10:48 PM, varnikat t wrote:
>
>
>
>
> Hey,
> Thanks for the help.it detects now using glob.glob("*.*.txt")
> Can u suggest how to open and read file this way?
>
> *if glob.glob("*.*.
Hey,
Thanks for the help.it detects now using glob.glob("*.*.txt")
Can u suggest how to open and read file this way?
*if glob.glob("*.*.txt"):
file=open(glob.glob("*.*.txt"))
self.text_view.get_buffer().set_text(file.read())
else:
file=open(glob.glob("*
> Look at the colorsys module.
>
> http://docs.python.org/library/colorsys.html?highlight=colorsys#module-
colorsys
That so rocks. Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 8, 5:46 pm, Tobiah wrote:
> I'm having a difficult time with this. I want
> to display a continuous range of hues using HTML
> hex representation (#RRGGBB). How would I go
> about scanning through the hues in order to
> make a rainbow?
>
> Thanks,
>
> Toby
Look at the colorsys module.
h
On Thu, Apr 8, 2010 at 12:46 PM, Tobiah wrote:
> I'm having a difficult time with this. I want
> to display a continuous range of hues using HTML
> hex representation (#RRGGBB). How would I go
> about scanning through the hues in order to
> make a rainbow?
>
> Thanks,
>
> Toby
> --
> http://mail
Gnarlodious wrote:
> On Apr 8, 9:14 am, "Martin v. Loewis" wrote:
>
>> When opening the file, you need to specify the file encoding.
>
> OK, I had tried this:
>
> open(path, 'r').read().encode('utf-8')
No, when *opening* the file, you need to specify the encoding:
open(path, 'r', encoding='utf
I'm having a difficult time with this. I want
to display a continuous range of hues using HTML
hex representation (#RRGGBB). How would I go
about scanning through the hues in order to
make a rainbow?
Thanks,
Toby
--
http://mail.python.org/mailman/listinfo/python-list
On 04/08/2010 08:57 AM, Chris Colbert wrote:
On Thu, Apr 8, 2010 at 11:42 AM, Kushal Kumaran
wrote:
On Thu, Apr 8, 2010 at 9:00 PM, varnikat t wrote:
I am trying to do this
if os.path.exists("*.*.txt"):
file=open("*.*.txt")
self.text_view.get_buffer().set_
On 2010-04-08, Anssi Saari wrote:
> It seems to me also that RTS is always on after the port has been
> opened. I didn't dig out my voltmeter or anything to check this,
> though.
IIRC, that's generally true: RTS and DTR are both set to "on" by the
tty layer's open() handler _if_ the device's use
On 2010-04-07, Max Kotasek wrote:
> I'm trying to figure out how to parse the responses from fcntl.ioctl()
> calls that modify the serial lines in a way that asserts that the line
> is now changed.
Two comments:
1) None of the Linux serial drivers I've worked on return line states
except
John Nagle writes:
> In theory, the FTP spec supports "three-way transfers", where the
> source, destination, and control can all be on different machines.
> But no modern implementation supports that.
I remember even using that way back when, Unix machines in the 1990s.
But, server to ser
Hi all,
i'ld like to create an gnome applet in python that, if left-clicked,
perform a particular operation using the text of the clipboard.
i've found this example:
import pygtk
pygtk.require('2.0')
import gtk
# get the clipboard
clipboard = gtk.clipboard_get()
# read the clipboard text data.
On Thu, Apr 8, 2010 at 11:42 AM, Kushal Kumaran
wrote:
> On Thu, Apr 8, 2010 at 9:00 PM, varnikat t wrote:
>> I am trying to do this
>> if os.path.exists("*.*.txt"):
>> file=open("*.*.txt")
>> self.text_view.get_buffer().set_text(file.read())
>> else:
>> file=o
Max Kotasek writes:
> Hello to all out there,
>
> I'm trying to figure out how to parse the responses from fcntl.ioctl()
> calls that modify the serial lines in a way that asserts that the line
> is now changed. For example I may want to drop RTS explicitly, and
> assert that the line has been d
On Apr 8, 9:14 am, "Martin v. Loewis" wrote:
> When opening the file, you need to specify the file encoding.
OK, I had tried this:
open(path, 'r').read().encode('utf-8')
however I get error
TypeError: Can't convert 'bytes' object to str implicitly
I had assumed a Unicode string was a Unicode
On Thu, Apr 8, 2010 at 9:00 PM, varnikat t wrote:
> I am trying to do this
> if os.path.exists("*.*.txt"):
> file=open("*.*.txt")
> self.text_view.get_buffer().set_text(file.read())
> else:
> file=open("*.*.html")
> self.text_view.get_buffer().set_te
Mag Gam, 08.04.2010 14:21:
On Thu, Apr 8, 2010 at 7:31 AM, Stefan Behnel wrote:
Mag Gam, 08.04.2010 13:21:
I am in the process of reading a zipped file which is about 6gb.
I would like to know if there is a command similar to grep in python
because I would like to emulate, -A -B option of GNU
I am trying to do this
if os.path.exists("*.*.txt"):
file=open("*.*.txt")
self.text_view.get_buffer().set_text(file.read())
else:
file=open("*.*.html")
self.text_view.get_buffer().set_text(file.read())
It gives error *.*.txt not existingThere are
All,
I am trying to replace a series of periods in a sting with backspaces
that way I can easily parse information from a Windows command. the
current statement I have for this is
***Statement
capture = re.sub('\.*', '\b', capture)
===
[Steven D'Aprano]
> So what happens in my example with a subclass that (falsely) reports a
> different length even when the lists are the same?
>
> I can guess that perhaps Py_SIZE does not call the subclass __len__
> method, and therefore is not fooled by it lying. Is that the case?
Yes. Py_SIZE
Gnarlodious wrote:
> Attempting to read a file containing Unicode characters such as ±:
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position
> 5007: ordinal not in range(128)
>
> I did succeed by converting all the characters to HTML entities such
> as "±", but I want the charact
lookup "connected component labeling" in a machine vision book.
On Thu, Apr 8, 2010 at 9:57 AM, Chris Hulan wrote:
> On Apr 8, 9:17 am, Jannis Syntychakis wrote:
>> Hallo Everybody,
>>
>> Maybe you can help me with this:
>>
>> i have a picture. The picture is black, with some white objects.
>>
>
Attempting to read a file containing Unicode characters such as ±:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position
5007: ordinal not in range(128)
I did succeed by converting all the characters to HTML entities such
as "±", but I want the characters to be the actual font in th
On Thu, Apr 8, 2010 at 7:39 PM, jorma kala wrote:
> Hi,
>
> I'd like to call an external application (firefox) from a python program (a
> PyQT GUI), but I want the external application to run in the background, I
> mean I do not want my python calling program to wait till the external
> subprocess
Lie Ryan wrote:
Why am I seeing a lot of this pattern lately:
OP: Got problem with string
+- A: Suggested a regex-based solution
+- B: Quoted "Some people ... regex ... two problems."
or
OP: Writes some regex, found problem
+- A: Quoted "Some people ... regex ... two problems."
+- B: Sup
1 - 100 of 131 matches
Mail list logo