On Thursday, September 13, 2012 4:53:13 PM UTC-7, Tim Chase wrote:
> On 09/13/12 18:36, Terry Reedy wrote:
>
> > On 9/13/2012 5:26 PM, Tim Chase wrote:
>
> >> I've got a bunch of text in Portuguese and to transmit them, need to
>
> >> have them in us-ascii (7-bit). I'd like to keep as much info
On Mar 7, 4:10 pm, Terry Reedy wrote:
> On 3/7/2012 5:35 PM, Peter Kleiweg wrote:
>
>
>
>
>
>
>
>
>
> > Dave Angel schreef op de 7e dag van de lentemaand van het jaar 2012:
>
> >> On 03/07/2012 02:41 PM, Peter Kleiweg wrote:
> >>> I want to write out some binary data to stdout in Python3. I
> >>>
"Sérgio Monteiro Basto" wrote in message
news:[email protected]...
How I change sys.stdout.encoding always to UTF-8 ? at least have a
consistent sys.stdout.encoding
There is an environment variable that can force Python I/O to be a specfic
encoding:
PYTHONIOEN
"ex_ottoyuhr" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm trying to create a function that can take arguments, say, foo and
> bar, and modify the original copies of foo and bar as well as its local
> versions -- the equivalent of C++ funct(&foo, &bar).
>
> I've looked around
"Markus Franz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi!
>
> I wanted to run some Python code from inside a C program, so I did it
> like it was explained in the Python manual:
>
> #include
> int main(int argc, char *argv[]) {
> Py_Initialize();
> PyRun_SimpleString("prin
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>> This works for me on Redhat 9:
>>
>> g++ x.cpp -o x -I/usr/include/python2.2 -pthread -lm
>> -ldl -lutil /usr/lib/python2.2/config/libpython2.2.a
>>
>
> Why did you chose the static variant? This should be equival
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> Heiko Wundram wrote:
>> Am Samstag, 26. März 2005 20:43 schrieb Mark Tolonen:
>>> On my system, for whatever reason, the .so library isn't present. I
>>> have
On Nov 25, 11:52 am, Sibylle Koczian wrote:
> Am 25.11.2011 01:16, schrieb Steven D'Aprano:
>
> > As far as I can tell, nobody running the 64-bit version of Windows 7 has
> > chimed in to either confirm or refute W. eWatson's claim that IDLE
> > doesn't show up, so we have no way of telling whethe
"Lonnie Princehouse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In short:
>
> Is there any way to run Python WITHOUT trying to create .pyc files (or
> .pyo) or to have Python not attempt to import the .pyc files it finds?
>
> Reason:
>
> We have a site-specific package installed
"Lie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>A built-in exceptions, when raised, would print traceback that points
> out the offending code, like this:
>
> Traceback (most recent call last):
> File "F:\dir\code.py", line 43, in
>a = 1/0 <<<---
> ZeroDivisionError: inte
"writeson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> On our Linux systems at work I've written a Twisted logging server
> that receives log messages from multiple servers/processes to post
> them to a log file, essentially serializing all the process log
> messages
"Summercool" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> somebody who is a regular expression guru... how do you negate a word
> and grep for all words that is
>
> tire
>
> but not
>
> snow tire
>
> or
>
> snowtire
>
> so for example, it will grep for
>
> winter tire
> ti
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> I am trying to write a simple program that will accept an integral
> "time" input in the HHMMSS format and output a "HH:MM:SS" form. My
> code is as follows:
>
> import string
>
> def FormatTime(ti
"Simon Pickles" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> Can anyone suggest a really simple XML reader for python? I just want to
> be able to do something like this:
>
> xmlDoc = xml.open("file.xml")
> element = xmlDoc.GetElement("foo/bar")
>
> ... to read the value
>"John Machin" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>On Jan 27, 9:17 pm, glacier <[EMAIL PROTECTED]> wrote:
>> On 1月24日, 下午3时29分, "Gabriel Genellina" <[EMAIL PROTECTED]>
>> wrote:
>
>*IF* the file is well-formed GBK, then the codec will not mess up when
>decoding it to Un
"Giovanni Bajo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I am trying to find a good way to portably get the output of strftime()
> and put it onto a dialog (I'm using PyQt, but it doesn't really matter).
> The problem is that I need to decode the byte stream return
"Astan Chee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I have a html text stored as a string. Now I want to go through this
> string and find all 6 digit numbers and make links from them.
> Im using re.sub and for some reason its not picking up the previously
> matched
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hallo,
>
> I'm after
>
> [[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]]]
>
How about:
>>> [[[]]*5]*5
[[[], [], [], [], []], [[], [], [], [], []], [[], [], [], [], []], [[], [],
[], [], []], [[]
"Chris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Feb 8, 11:29 am, John Deas <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I made a small script to recursively copy files from a directory tree
>> to an exportDir only if they have an mp3 extension :
>>
>> a=os.walk(os.getcwd())
>>
"Mike Walker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>> If you run a python file, ie. just double clicking it the only
>> argument you will have will be the filename of the script. If you
>> create a shortcut to the script and in the target box add your
>> arguments (if yo
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, 04 Mar 2008 10:49:54 +0530, Pradnyesh Sawant wrote:
>
>> I have a file which contains chinese characters. I just want to find out
>> all the places that these chinese characters occur.
>>
>> The follo
"brnstrmrs" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If I run:
>
> testValue = '\x02\x00'
> junk = struct.unpack('h', testValue)
>
> Everything works but If I run
>
> testValue = raw_input("Enter Binary Code..:") inputting at the
> console '\x02\x00'
> junk = struct.unpack('
"Barak, Ron" wrote in message
news:[email protected]...
The source of gzip.py on my system seems to suggest that negative seeks
are supported:
def seek(self, offset):
if self.mode == WRITE:
if offset < self.offset:
"Aaron Brady" wrote in message
news:6197f37d-0ea0-4430-a466-2f36b2011...@v42g2000yqj.googlegroups.com...
On Jan 13, 10:22 am, Grimson wrote:
hello out there,
I have a problem with c-types.
I made a c-library, which expects a pointer to a self defined structure.
let the funtion call myfuncti
"Sean Brown" wrote in message
news:[email protected]...
Using python 2.4.4 on OpenSolaris 2008.11
I have the following string created by opening a url that has the
following string in it:
td[ct] = [[ ... ]];\r\n
The ... above is what I'm interested in extracting which is rea
"Jason" wrote in message
news:8158439d-faae-4889-a1cf-8d9fee112...@v39g2000yqm.googlegroups.com...
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, ver
"John Nagle" wrote in message
news:[email protected]...
Benjamin Peterson wrote:
Steve Holden holdenweb.com> writes:
Beware, also, that in 2.6 the "bytes" type is essentially an ugly hack
to enable easier forward compatibility with the 3.X series ...
It's not an ugly
"Gilles Ganault" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Thu, 27 Nov 2008 01:00:28 +, MRAB <[EMAIL PROTECTED]>
wrote:
No problem here:
>>> import urllib
>>> data = urllib.urlopen("http://www.amazon.co.jp/";).read()
>>> decoded_data = data.decode("shift-jis")
>>>
T
"Yves Dorfsman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Is there any built in way to generate a list of characters, something
along the line of range('a'-'z') ?
Right now I am using:
chars = [ chr(l) for l in range(0x30, 0x3a) ] # 0 - 9
chars += [ chr(l) for l in rang
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Mark Tolonen:
Writing a helper function reduces code repetition and improves
readability:
def crange(startch,endch):
'''Return a list of characters from startch to endch, inclusive.'''
return [chr
"eric" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
def flag(IGNORECASE=False, LOCALE=False, MULTILINE=False,
DOTALL=False, UNICODE=False, VERBOSE=False):
vals = [IGNORECASE, LOCALE, MULTILINE, DOTALL, UNICODE, VERBOSE]
filtered = map( lambda m:m[1],filter( lambda m: m[0]
"Guy Doune" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Ok, didn't show the whole problem...
I will read the doc anyway, but why "questions.html" keep it "t"??
>>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',
'01.html', '05.html', '07.html', '02.html'
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Thu, 4 Dec 2008 at 20:54, Terry Reedy wrote:
[snip]
I have often wished that in 'split' I could specify a _set_ of characters
on which the string would be split, in the same way the default list
of whitespace characters causes a s
"Johannes Bauer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
John Machin schrieb:
On Dec 6, 5:36 am, Johannes Bauer <[EMAIL PROTECTED]> wrote:
So UTF-16 has an explicit EOF marker within the text? I cannot find one
in original file, only some kind of starting sequence I suppose
"macc_200" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,
just starting programming and have an elementary question
after playing around with lists but cannot find >the answer
with googling.
I have a list of variables and I would like some of those
variables to be integers and
"John Machin" wrote in message
news:a8cd683f-853d-4665-bee4-7a0bdb841...@c36g2000prc.googlegroups.com...
On Dec 14, 9:20 am, "Martin v. Löwis" wrote:
> >> This is intended behavior.
>
> > I see. That means that the behaviour in Python 1.6 to 2.6 (i.e.
> > encoding the text using the repr() fu
"zxo102" wrote in message
news:[email protected]...
On 12月26日, 上午4时58分, "Gabriel Genellina"
wrote:
En Thu, 25 Dec 2008 07:27:03 -0200, zxo102 escribió:
> On 12月25日, 下午3时35分, "Chris Rebert" wrote:
>> On Wed, Dec 24, 2008 at 11:29 PM, zxo102
"Hendrik van Rooyen" wrote in message
news:000f01c96822$5c300f00$0d00a...@hendrik...
Red Rackham wrote:
I would like to pass a string into a dll function. I notice that to pass
using
ctypes, it has to be a ctypes type. >Looking at the ctypes doc page I
don't see
a c_string class.
The
"zxo102" wrote in message
news:2560a6e0-c103-46d2-aa5a-8604de4d1...@b38g2000prf.googlegroups.com...
I have a list in a dictionary and want to insert it into the html
file. I test it with following scripts of CASE 1, CASE 2 and CASE 3. I
can see "中文" in CASE 1 but that is not what I want. CAS
"zxo102" wrote in message
news:[email protected]...
On 12月29日, 下午5时06分, "Mark Tolonen" wrote:
"zxo102" wrote in message
news:2560a6e0-c103-46d2-aa5a-8604de4d1...@b38g2000prf.googlegroups.com...
[snip]
T
"Pavel Kosina" wrote in message
news:[email protected]...
As for unicode in Python 2.5 everything works fine in program running
either in IDLE or under Command line:
# -*- coding: utf-8 -*-
print u"ěščřžýáíé"
In 3.0 there is an error. The same program, moved to 3.0 syntax, in IDLE
e
"Barak, Ron" wrote in message
news:[email protected]...
Hi,
I am getting the error TypeError: seek() takes exactly 2 arguments (3
given), namely:
$ ./_LogStream.py
Traceback (most recent call last):
File "./_LogStream.py", line 47, in
log_str
In your original code:
textu.replace(unichr(167),'\n')
as Dennis suggested (but maybe you were distracted by his 'fn' replacement,
so I'll leave it out):
textu = textu.replace(unichr(167),'\n')
.replace does not modify the string in place. It returns the modified
string, so you have to
"Jordan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
l = os.listdir(unicode(os.getcwd()))
Other options to get the same result:
l = os.listdir(os.getcwdu())
l = os.listdir(u'.')
Oddly, os.getcwd() and os.getcwdu() both still exist in Python 3.0. Since
the behavior is now
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Oddly, os.getcwd() and os.getcwdu() both still exist in Python 3.0.
Since the behavior is now identical it seems os.getcwdu() should be
dropped.
It is dropped, and os.getcwdb() has been added.
Must be changed po
"Shark" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I have a windows dll1.dll with a export function:
int f1(char filename,char **buf,int *bufLen)
{
int len;
//got the length of file anyway,such as 100
len = 100;//len = getLen(filename);
*buf = (char*)calloc(100);
*bufLen = len
"Chris Rebert" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Fri, Nov 7, 2008 at 8:52 PM, pineapple <[EMAIL PROTECTED]>
wrote:
I am not a python programmer, but am being forced to port one of my
(smalltalk) applications to python for pragmatic reasons (python is
embedded with
"News123" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,
I was googling quite some time before finding the answer to my question:
'what are the names for the encodings supported by python?'
I found the answer at http://python.active-venture.com/lib/node127.html
Now my quest
"Okko Willeboordse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,
SocketServer.ThreadingTCPServer accepts connections (clients can
connect) before and after it's server_forever method is called,
see below for an example.
IMHO it should only accept connections while server
"Shiao" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,
I'm trying to build a regex in python to identify punctuation
characters in all the languages. Some regex implementations support an
extended syntax \p{P} that does just that. As far as I know, python re
doesn't. Any ide
"Mark Tolonen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
"Shiao" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,
I'm trying to build a regex in python to identify punctuation
characters in all the languages. Some rege
"Werner Merkl" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hallo,
I like Python 2.6 and I like to use it anywhere, even within Windows PE.
In former version of Python (<= 2.5.x) it was easy to bring it to a
Windows PE system: Install Python to Windows XP or Vista and (robo-)
"Hunter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
We are reviewing a vendor who will output some data in an XML format.
I will then use python to convert the data to another format for
upload to another vendor. I'm having trouble with very basic steps
with the sample file th
"len" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I have created the following program to read a text file which happens
to be a cobol filed definition. The program then outputs to a file
what is essentially a file which is a list definition which I can
later
copy and past into
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Mark Tolonen wrote:
"len" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[...]
You might want to check out the pyparsing library.
And you might want to trim your mess
"一首诗" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I didn't try your code. That might be working since it a completely
different method.
What mean is
pack works:
=
class POINT(Structure):
_fields_ = [('x', c_int), ('y', c_int)]
p = POINT(1,2) p.x
"harijay" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I want to parse a number of strings and extract only those that
contain a 4 digit number anywhere inside a string
Try:
p = re.compile(r'\b\d{4}\b')
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
"harijay" wrote in message
news:4c7d58a1-830f-4f02-ba07-aa4910f5f...@b16g2000yqb.googlegroups.com...
In my last post I had asked about reading data from a binary file
using the struct module.
Thanks to some excellent help , I have managed to read in
successfully
most of the header of this bina
Try os.walk for recursively walking directories. Also if you use a unicode
parameter with os.walk or os.listdir you get unicode strings in the result. To
run this successfully when you have non-ascii characters in your filenames, you
will need to use an environment that supports the characters
"John O'Hagan" wrote in message
news:[email protected]...
Inspired by some recent threads here about using classes to extend the
behaviour of iterators, I'm trying to replace some some top-level
functions
aimed at doing such things with a class.
So far it's got a te
"Evan" wrote in message
news:79582a34-5d0b-49b2-8c1e-4139324ff...@b38g2000prf.googlegroups.com...
Hello ~
I'm new with python, what my problem is, I have a binary file, I want
to read first 2 bytes and convert it to host byte order, then write it
to another file.
There is a piece of infor
"David George" wrote in message
news:[email protected]...
Hi guys,
I've been developing some code for a university project using Python.
We've been working on an existing codebase, cleaning it up and removing
dead wood.
We decided to make some changes to internal
"Falcolas" wrote in message
news:[email protected]...
On Mar 11, 1:11 pm, David George wrote:
Again, problem here is the issue of being unable to kill the server
while it's waiting on a request. In theory, i could force it to
continue by sending
"cgoldberg" wrote in message
news:[email protected]...
Release 213 is out already:
Tim, Mark,
this is great news.. thanks for tracking 3.x so closely. I big
barrier for me to eventually adopt 3.x is the ability to use pywin32.
thanks!
-Corey
"Esmail" wrote in message
news:03081704-17b5-4c7d-82db-8efb7ebce...@q11g2000yqh.googlegroups.com...
Hi all,
I've been reading/posting to usenet since the 80s with a variety of
tools (vn, and most recently Thunderbird) but since my ISP
(TimeWarner) no longer provides usenet feeds I'm stuck.
I
"John Posner" wrote in message
news:af9fbcc3a7624599a6f51bad2397e...@amdup...
Inspired by recent threads (and recalling my first message to Python
edu-sig), I did some Internet searching on producing prime numbers using
Python generators. Most algorithms I found don't go for the infinite,
cont
"Andreas" wrote in message
news:[email protected]...
> Hello,
>
> I'd like to create a regex that captures any unicode character, but
> not the underscore and the digits 0-9. "^(?u)\w$" captures them also.
> Is there a possibility to restrict an exp
"Phil Mayes" wrote in message
news:[email protected]...
I am trying to search for 1 or more empty or white-space-only lines.
Empty lines work:
>>> re.compile('(?m)(^$){1,2}')
<_sre.SRE_Pattern object at 0x010F9218>
One line with possible whitespace works:
>>> re.co
"Andreas Pfrengle" wrote in message
news:[email protected]...
On 12 Apr., 02:31, "Mark Tolonen" wrote:
"Andreas" wrote in message
news:[email protected]...
> Hel
"Chris Helck" wrote in message
news:[email protected]...
I have a couple dozen C structures that define binary file records. I
need to read the file and access the records. I need to do this very
efficiantly.
I am aware of the Python struct class,
"Tairic" wrote in message
news:95ea7bdf-2ae8-4e5e-a613-37169bb36...@w35g2000prg.googlegroups.com...
Hi, I'm somewhat new to programming and especially to python. Today I
was attempting to make a sudoku-solver, and I wanted to put numbers
into sets call box1, box2, ... box9, so that I could che
"Napalmski" wrote in message
news:[email protected]...
Hello,
I have an encoded string in the form "004e006100700061006c006d", if you
split on every 4 characters it decodes to a single character.
I have come up with this:
name = '004e006100700061006c006d'
name2
wrote in message
news:[email protected]...
Sorry being unclear again, hmm I am becoming an expert in it.
I pasted that code as continuation of my old code at start
i.e
class A(object):
def __unicode__(self):
return u"©au"
def _
"Piet van Oostrum" wrote in message
news:[email protected]...
"Mark Tolonen" (MT) wrote:
MT> wrote in message
MT>
news:[email protected]...
Sorry being unclear again, hmm I am becoming an expert in
"willgun" wrote in message
news:[email protected]...
By the way ,what does 'best regards' means at the end of a mail?
I think 恭祝 may be a good translation.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
"dj" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello All,
I am using elementtree to write an XML document and I am having a hard
time adding the correct indentation.
I have tried using the indent method, but I can not figure out how to
use it. Any suggestions.
Using the ver
"George Sakkis" <[EMAIL PROTECTED]> wrote in message
news:829b1e8f-baac-4ff4-909b->[EMAIL PROTECTED]
On Jun 1, 3:55 pm, Mason <[EMAIL PROTECTED]> wrote:
I have tried and tried...
I'd like to read in a binary file, convert it's 4 byte values into
floats, and then save as a .txt file.
This works
"windwiny" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
我初学python 的 ctypes, 现在的环境是 ubuntu 8.04, Python 2.5.2
(r252:60911,
May 7 2008, 15:19:09) , gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
我创建了一个 so 共享库
-
#include
double myfd(double x) { return x * 2;}
float
"gianluca" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
hy,
I've a huge problem with ctypes. I've compiled my C library and I'd
like use it in python with ctype. One function need to pass a pointer
to typed ( like this: typedef int value_type). In python I can access
to that funt
"eliben" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Jun 7, 10:15 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
On Fri, 06 Jun 2008 23:57:03 -0700, s0suk3 wrote:
> You can just split the path on `os.sep', which contains the path
> separator of the platform on which
"dj" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello again,
Does anyone know which method in the time module will generate and am
or pm ?
If none of the method will do this for me. Can I produce the value on
my own ?
Any suggestions ?
from time import *
strftime('%I:%M:%S
"kj" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
How can a script know its absolute path? (__file__ only gives the
path it was used to invoke the script.)
Basically, I'm looking for the Python equivalent of Perl's FindBin.
The point of all this is to make the scripts locat
"Hyuga" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Jun 13, 11:34 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Sent: Friday, June 13, 2008 11:11 AM
"Sallu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi all and one
i wrote this script, working fine without fail( just run it)
import re
value='This is Praveen'
print value
#value = 'riché gerry'
#words=str(value.split()).strip('[]').replace(', ', '') ( here i tried
to convert
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi All,
How do I format printed data in python?
I could not find this in the Python Reference Manual:
http://docs.python.org/ref/print.html
Nor could I find it in Matloff's great tutorial:
http://heather.cs.ucdavis.edu/~matloff/Python
"Andreu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Yes, ... don't ask me why, but in fact v1,v2,v3 = str1.split()
does not seem to work. My original problem was I forgot about
the parenthesis as Tim point out. So I ended up converting to a
list as in: v = str1.split() and acc
"leodp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Or provide a better explanation and an example. Do you mean something
like
this?
Hi Peter,
a small example:
master=[1,4,3,2]
slave1=['d','c','b','a']
slave2=[1,2,3,4]
master.sort() # this is ok, but does not return info
"gianluca" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On 30 Giu, 18:26, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
On Mon, 30 Jun 2008 09:13:42 -0700 (PDT), gianluca <[EMAIL PROTECTED]>
wrote:
>I've a problem with dll function colled with python/ctypes. My
>functions (C)
"inhahe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
"Alex Bryan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Okay, so i don't really understand the Yield thing and i know it is
useful. I've read a few things about it but it is all programming jargon
and so
"ssecorp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
so if strings were mutable and i did
a = b = "foo"
and then did
a += "bar"
then a and b would be foobar?
This can be demonstrated with a list of characters, which *is* mutable:
a = b = list('foo')
a += list('bar')
a
['f'
"joe shoemaker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
If you have the following:
data = unpack('>L', sock.recv(4))
Does this line of code means that incoming data is big endian and
unpack it to endianess of local machine? If local machine is little
endian, then big
"Jerry Hill" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Mon, Jul 14, 2008 at 12:40 PM, Tim Cook <[EMAIL PROTECTED]>
wrote:
if I say units=unicode("°"). I get
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0:
ordinal not in range(128)
If I try x=unico
"mk" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,
I'm trying to learn how with statement can be used to avoid writing:
prepare()
try:
something_that_can_raise_SomeException()
except SomeException, err:
deal_with_SomeException
finally:
tear_it_down()
Verbose, not very re
"Jeff Dyke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I've come across an error that i'm not yet able to create a test case
for but wanted to get see if someone could shed light on this.
I have imported a module at the top of my file with
import mymodulename
this module is u
"waldek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Jul 24, 5:01 pm, Thomas Heller <[EMAIL PROTECTED]> wrote:
waldekschrieb:
> Hi,
> I'm using C dll with py module and wanna read value (buffer of bytes)
> returned in py callback as parameter passed to dll function.
The c
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Apr 26, 7:25 am, Irmen de Jong <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote:
> Until now, I've been
> doing this little trick:
> data = client.recv(256)
> new = data
> while len(new) == 256:
> new = client.recv(256)
>
"Marco Bizzarri" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Mon, Sep 1, 2008 at 3:25 PM, <[EMAIL PROTECTED]> wrote:
When I do ${urllib.unquote(c.user.firstName)} without encoding to
latin-1 I got different chars than I will get: no Łukasz but Å ukasz
--
http://mail.pytho
I don't understand the behavior of the interpreter in Python 3.0. I am
working at a command prompt in Windows (US English), which has a terminal
encoding of cp437.
In Python 2.5:
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
32
Type "help", "copyr
"Mr.SpOOn" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Sun, Sep 28, 2008 at 8:59 PM, Aaron Castironpi Brady
<[EMAIL PROTECTED]> wrote:
Here is a link to someone else's design they asked about on the
newsgroup a couple weeks ago.
http://groups.google.com/group/comp.lang.pyt
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
What are others' opinions? Any insight to this design decision?
The intention is that all printable characters in a string get displayed
in repr. This was in particular requested by Japanese users (but also by
ot
1 - 100 of 185 matches
Mail list logo