> Yeah, this is, pardon the french, just batshit crazy.
huh ? :)
JM
-- IMPORTANT NOTICE:
The contents of this email and any attachments are confidential and may also be
privileged. If you are not the intended recipient, please notify the sender
immediately and do not disclose the conten
Hello,
I'm not wanting to start anything here, but I am wanting to automate
testing of my Django-based websites. A quick search on Google turns up a
number of packages and I would like to know if any stand out from the
others? Our main sites are used to display a customer dashboard, so my
concer
On Mon, Feb 11, 2013 at 8:52 PM, Jean-Michel Pichavant
wrote:
>
>> Yeah, this is, pardon the french, just batshit crazy.
>
> huh ? :)
You're French, ergo you are pardoned. Makes good sense to me!
:)
ChrisA
Cheshire was right, we're all mad here...
--
http://mail.python.org/mailman/listinfo/pyt
On 02/12/2013 05:38 AM, Bqsj Sjbq wrote:
>>> import os
>>> os.system("i=3")
0
>>> os.system("echo $i")
0
why i can not get the value of i?
First:
os.system is only defined to give the return value (exit code) of the
sub-process.
However, one way to get the output of shell commands is to u
On Tuesday, February 12, 2013 6:13:38 AM UTC+1, contro opinion wrote:
> >>> import os
> >>> os.system("i=3")
> 0
> >>> os.system("echo $i")
>
>
> 0
> how can i get the value of i?
You may want to take a look at the pexcpect module :
http://www.noah.org/wiki/pexpect
--
http://mail.python.org/m
I am using Eclipse to write my python scripts and when i run them from inside
eclipse they work fine without errors.
But almost in every script that handle some form of special characters like
swedish åäö and chinese characters etc i get Unicode errors when running the
script externally with p
On 2013.02.12 04:43, Magnus Pettersson wrote:
> I am using Eclipse to write my python scripts and when i run them from inside
> eclipse they work fine without errors.
>
> But almost in every script that handle some form of special characters like
> swedish åäö and chinese characters etc i get U
On Tue, Feb 12, 2013, at 12:12 AM, contro opinion wrote:
> >>> import os
> >>> os.system("i=3")
> 0
> >>> os.system("echo $i")
>
> 0
> >>>
> why i can't get the value of i ?
Whenever you call os.system, a new shell is created and the command is
run, system() then waits for the command to comple
Magnus Pettersson wrote:
> I am using Eclipse to write my python scripts and when i run them from
> inside eclipse they work fine without errors.
>
> But almost in every script that handle some form of special characters
> like swedish åäö and chinese characters etc
A comment: they are not "spec
Hi,
I've tried but didn't find an answer on the net.
The exec function in Python modifies a copy of locals() only.
How can I transfer changes in that local copy to the locals of my function
** without ** knowing the names of these variables.
E.g. I have a lot of local names.
Doing
_locals= l
Ahh so its the actual printing that makes it error out outside of eclipse
because its a different terminal that its printing to. Its the default DOS
terminal in windows that runs then i run the script with python.exe and i guess
its the same when i run with pythonw.exe just that the terminal win
I'm trying write unit-tests for some of my old code and have run into this
piece of code.
dcomp = zlib.decompressobj(16+zlib.MAX_WBITS)
chunk = ''.join(f.chunks())
received_data = dcomp.decompress(chunk)
How do I generate the chunk here? From what I've been trying I'm getting
this exception:
>
Hi!
I've go a script which uses python requests
(http://docs.python-requests.org/en/latest/).
I need to add to it socks proxy feature.
AFAIK requests doesn't support socks proxy
(http://stackoverflow.com/questions/12601316/how-to-make-python-requests-work-via-socks-proxy)
so i was about to sw
On 02/12/2013 06:46 AM, Helmut Jarausch wrote:
Hi,
I've tried but didn't find an answer on the net.
The exec function in Python modifies a copy of locals() only.
How can I transfer changes in that local copy to the locals of my function
** without ** knowing the names of these variables.
E.g.
I have tried now to take away printing to terminal and just keeping the writing
to a .txt file to disk (which is what the scripts purpose is):
with open(filepath,"a") as f:
for card in cardlist:
f.write(card+"\n")
The file it writes to exists and im just appending to it, but when i r
On Tue, 12 Feb 2013 08:27:41 -0500, Dave Angel wrote:
> On 02/12/2013 06:46 AM, Helmut Jarausch wrote:
>> Hi,
>>
>> I've tried but didn't find an answer on the net.
>>
>> The exec function in Python modifies a copy of locals() only.
>> How can I transfer changes in that local copy to the locals of
Magnus Pettersson wrote:
> I have tried now to take away printing to terminal and just keeping the
> writing to a .txt file to disk (which is what the scripts purpose is):
>
> with open(filepath,"a") as f:
> for card in cardlist:
> f.write(card+"\n")
>
> The file it writes to exists
Hi, All.
I'm a (old) delphi developer.
I want to learn Python.
I've python 2.7 and django.
For learning purpose I want to use firebird.
But, package (egg) to use firebird needs easy_install for setup.
When i run:
python ez_setup.py install
python says me error:
Downloading http://pypi.python
On 2/12/2013 1:15 AM, Steven D'Aprano wrote:
As an antidote to the ill-informed negativity of Ranting Rick's
illusionary "PyWarts", I thought I'd present a few of Python's more
awesome features, starting with exception contexts.
You do not need Rick to justify such an informative post.
If you
On 2013-02-12 13:27, Dave Angel wrote:
On 02/12/2013 06:46 AM, Helmut Jarausch wrote:
Hi,
I've tried but didn't find an answer on the net.
The exec function in Python modifies a copy of locals() only.
How can I transfer changes in that local copy to the locals of my function
** without ** kno
On Sunday, February 10, 2013 4:36:53 AM UTC-6, Johannes Bauer wrote:
> On 09.02.2013 12:04, Joshua Robinson wrote:
>
> > Hi *Monte-Pythons*,
>
> >
>
> > x = "this is a simple : text: that has colon"
>
> > s = x.replace(string.punctuation, ""); OR
>
> > s = x.replace(string.punctuation, "");
In Greg Lindstrom
writes:
> I'm not wanting to start anything here, but I am wanting to automate
> testing of my Django-based websites. A quick search on Google turns up a
Have you looked at using the built-in django test client?
--
John Gordon A is for Amy, who fell down
- Original Message -
> In article <1de56e5b-4f9b-477d-a1d4-71e7222a2...@googlegroups.com>,
> Cleuson Alves wrote:
>
> > Hello, I am trying to run this code, but I get an answer incorrect
> > arguments
> > numbers. someone could put an example of arguments for me to use in
> > the / var
> Are you sure you are writing the same data? That would mean that pydev
>
> changes the default encoding -- which is evil.
>
>
>
> A portable approach would be to use codecs.open() or io.open() instead of
>
> the built-in:
>
>
>
> import io
>
> with io.open(filepath, "a") as f:
>
>
I didn't know a whole lot (read: nothing) about buffers and memoryviews
before digging into the C side of Python. Once I found them, ran into some
of the 2.7 ugliness of having /both/ buffers and memoryviews available and
found the tremendous usefulness in them, I decided to write a blog post.
In t
On 2/12/2013 7:47 AM, Fayaz Yusuf Khan wrote:
I'm trying write unit-tests for some of my old code and have run into this
piece of code.
dcomp = zlib.decompressobj(16+zlib.MAX_WBITS)
Since zlib.MAX_WBITS is the largest value that should be passed (15),
adding 16 makes no sense. Since it is als
On 02/12/2013 09:29 AM, Helmut Jarausch wrote:
On Tue, 12 Feb 2013 08:27:41 -0500, Dave Angel wrote:
On 02/12/2013 06:46 AM, Helmut Jarausch wrote:
Hi,
I've tried but didn't find an answer on the net.
The exec function in Python modifies a copy of locals() only.
How can I transfer changes in
On 2013-02-12 15:25, Demian Brecht wrote:
I didn't know a whole lot (read: nothing) about buffers and memoryviews
before digging into the C side of Python. Once I found them, ran into some
of the 2.7 ugliness of having /both/ buffers and memoryviews available and
found the tremendous usefulness i
Magnus Pettersson wrote:
>> io.open() uses UTF-8 by default, but you can specify other encodings with
>>
>> io.open(filepath, mode, encoding=whatever).
>
>
> Interesting. Pydev must be doing something behind the scenes because when
> i changed open() to io.open() i get error inside of eclipse n
On 2/12/2013 8:27 AM, Dave Angel wrote:
On 02/12/2013 06:46 AM, Helmut Jarausch wrote:
I've tried but didn't find an answer on the net.
You should start with the fine manual, which is on the net as well as
included with at least the Windows distribution. It has a nice index
that includes a
On 02/12/2013 10:29 AM, Magnus Pettersson wrote:
Are you sure you are writing the same data? That would mean that pydev
changes the default encoding -- which is evil.
A portable approach would be to use codecs.open() or io.open() instead of
the built-in:
import io
with io.open(filepath,
On 12/02/2013 10:06 AM, Alberto Salvati wrote:
Hi, All.
I'm a (old) delphi developer.
I want to learn Python.
I've python 2.7 and django.
For learning purpose I want to use firebird.
But, package (egg) to use firebird needs easy_install for setup.
When i run:
python ez_setup.py install
pyth
Hi, Colin.
Thanks for your answer.
But C:\Python27\Scripts is in my path and my trouble is about INSTALL
easy_isntall.
Bye
A.
--
http://mail.python.org/mailman/listinfo/python-list
On 2/12/2013 7:34 AM, Magnus Pettersson wrote:
Ahh so its the actual printing that makes it error out outside of
eclipse because its a different terminal that its printing to. Its
the default DOS terminal in windows that runs then i run the script
with python.exe and i guess its the same when i r
On 02/12/2013 10:50 AM, Terry Reedy wrote:
On 2/12/2013 8:27 AM, Dave Angel wrote:
On 02/12/2013 06:46 AM, Helmut Jarausch wrote:
Doing
_locals= locals()
This merely gives you a handle of the dict returned by locals() for when
you want to do more than just pass it to (for example) exec).
I guess I /should/ have written it with current releases.. My 3 is current
dev source :P
Demian Brecht
http://demianbrecht.github.com
On 2013-02-12 7:42 AM, "MRAB" wrote:
>On 2013-02-12 15:25, Demian Brecht wrote:
>> I didn't know a whole lot (read: nothing) about buffers and memoryviews
>>
Hello
Before I go ahead, I'd like to make sure I'm doing it the right away:
1. yum install httpd mod_wsgi
2. Edit /etc/sysconfig/httpd to uncomment this line to get Apache to
run as worker MPM:
"#HTTPD=/usr/sbin/httpd.worker"
3. Edit mod_wsgi
4. Build a test WSGI Python script
5. Start Apache
> What encoding is this file? Since you're appending to it, you really
>
> need to match the pre-existing encoding, or the next program to deal
>
> with it is in big trouble. So using the io.open() without the encoding=
>
> keyword is probably a mistake.
The .txt file is in UTF-8
I have g
On Monday, February 11, 2013 11:55:19 PM UTC-6, Chris Angelico wrote:
> On Tue, Feb 12, 2013 at 12:06 PM, 8 Dihedral wrote:
> > A permanently mutated list is a tuple of constant objects.
>
> I nominate this line as "bemusing head-scratcher of the week".
Actually the statement is fact IF you ca
:
On 12 February 2013 02:15, Steven D'Aprano
wrote:
> As an antidote to the ill-informed negativity of Ranting Rick's
> illusionary "PyWarts", I thought I'd present a few of Python's more
> awesome features [...]
You could call them PyW00ts.
-[]z.
--
http://mail.python.org/mailman/listinfo/py
On 02/12/2013 10:01 AM, Zero Piraeus wrote:
On 12 February 2013 02:15, Steven D'Aprano wrote:
As an antidote to the ill-informed negativity of Ranting Rick's
illusionary "PyWarts", I thought I'd present a few of Python's more
awesome features [...]
You could call them PyW00ts.
+1 QOTW
--
ht
I have an issue with some code I have been passed:
for (x, y) in [(a_dict1, a_tuple[0]), (a_dict2, a_tuple[1])]:
I only noticed it as PyCharm failed to assign the str type to y, whereas it knew
the tuples 0 and 1 item were type str.
In the loop it flags the passing of y into a method that expe
Just to note, PyDev does something behind the scenes (it sets the encoding
for the console).
You may specify which encoding you want at your launch configuration (in
the 'common' tab you can set the encoding you want for the shell).
Cheers,
Fabio
On Tue, Feb 12, 2013 at 3:12 PM, Magnus Petters
On 02/12/2013 02:59 PM, Joseph L. Casale wrote:
I have an issue with some code I have been passed:
I had to read it about four times before I knew what you were saying.
Maybe I still have it wrong.
for (x, y) in [(a_dict1, a_tuple[0]), (a_dict2, a_tuple[1])]:
I only noticed it as PyCharm
Terry Reedy wrote:
> On 2/12/2013 7:47 AM, Fayaz Yusuf Khan wrote:
>> dcomp = zlib.decompressobj(16+zlib.MAX_WBITS)
>
> Since zlib.MAX_WBITS is the largest value that should be passed (15),
> adding 16 makes no sense. Since it is also the default, there is also no
> point in providing it explic
On Monday, February 11, 2013 11:28:57 PM UTC-6, zipher wrote:
> [...]
> Yeah, this is where one has to consider the idea of a unified data
> model (a sort of OOPv2). Right now, it's all confused because people
> are using their own internal, subconscious ideas of data.
Indeed!
The current parad
On 02/12/2013 12:12 PM, Magnus Pettersson wrote:
< snip >
#Here kanji = u"私"
baseurl = u"http://www.romajidesu.com/kanji/";
url = baseurl+kanji
savefile([url]) #this test works now. uses: io.open(filepath,
"a",encoding="UTF-8") as f:
# This made the fetching of the website work.
You don't sh
On 2013-02-12 14:24, Magnus Pettersson wrote:
I have tried now to take away printing to terminal and just keeping the writing
to a .txt file to disk (which is what the scripts purpose is):
with open(filepath,"a") as f:
for card in cardlist:
f.write(card+"\n")
The file it writes t
On Wed, Feb 13, 2013 at 4:48 AM, Rick Johnson
wrote:
> Your confusion may stem from interpreting "constant" as the CS term
> "CONSTANT"[1]; whereby the objects in the tuple are programming CONSTANTS,
> that is, unable to change.
Uhh, yeah. Not being Humpty Dumpty, I interpret "constants" to mea
> I think you're saying that the lint-feature of PyCharm is trying to
> guess the object types, and telling you there's a conflict here. I
> don't think you're saying that it executes incorrectly.
Hah, yeah sorry Dave that's it.
> Still there are ways to express it differently, and maybe one
Dave Angel wrote:
>> Thanks for this hint which surprises me again since I thought
>> locals() by itself is a copy only.
>>
>
> (Thanks MRAB for your correction.)
>
> As MRAB points out, I was in error on this point. I only tested it in
> global scope. Inside a function it doesn't seem to work
Magnus Pettersson wrote:
> # This made the fetching of the website work. Why did i have to write
> # url.encode("UTF-8") when url already is unicode? I feel i dont have a
> # good understanding of this.
> page = urllib2.urlopen(url.encode("UTF-8"))
Start here:
"The Absolute Minimum Every Softw
> You don't show the code that actually does the io.open(), nor the
>
> url.encode, so I'm not going to guess what you're actually doing.
Hmm im not sure what you mean but I wrote all code needed in a previous post so
maybe you missed that one :)
In short I basically just have:
import io
io.op
Thanks a lot Steven, you gave me a good AHA experience! :)
Now I understand why I had to use encoding when calling the urllib2! So
basically Eclipse PyDev does this in the background for me, and its console
supports utf-8, so thats why i never had to think about it before (and why some
scripts
I have written a piece of code that will be part of a larger repository of
related programs. Within this repository, it is standard to issue a 'make'
command to compile any desired program. Is it possible to create a Makefile to
compile a simple Python program? Based on what I have come across s
On Tue, Feb 12, 2013 at 7:44 PM, Malcolm White wrote:
> I have written a piece of code that will be part of a larger repository of
> related programs. Within this repository, it is standard to issue a 'make'
> command to compile any desired program. Is it possible to create a Makefile
> to compil
On 13 February 2013 00:44, Malcolm White wrote:
> I have written a piece of code that will be part of a larger repository of
> related programs. Within this repository, it is standard to issue a 'make'
> command to compile any desired program. Is it possible to create a Makefile
> to compile a
In article ,
Oscar Benjamin wrote:
> On 13 February 2013 00:44, Malcolm White wrote:
> > I have written a piece of code that will be part of a larger repository of
> > related programs. Within this repository, it is standard to issue a 'make'
> > command to compile any desired program. Is it
Rick Johnson於 2013年2月13日星期三UTC+8上午1時48分07秒寫道:
> On Monday, February 11, 2013 11:55:19 PM UTC-6, Chris Angelico wrote:
>
> > On Tue, Feb 12, 2013 at 12:06 PM, 8 Dihedral wrote:
>
> > > A permanently mutated list is a tuple of constant objects.
>
> >
>
> > I nominate this line as "bemusing he
On Tuesday, February 12, 2013 12:15:29 AM UTC-6, Steven D'Aprano wrote:
> [snip inflammatory remarks]
> I thought I'd present a few of Python's more
> awesome features, starting with exception contexts.
Well that's great idea, however, in order to find this very "valuable"
information the searche
On Tuesday, February 12, 2013 12:01:45 PM UTC-6, Zero Piraeus wrote:
> You could call them PyW00ts.
+1 on the name
-INFINITY on the execution
Actually i am happy that DeAprano used the unintuitive tag now. Bad enough to
use an unintuitive tag. Worse to misspell it. But it would been a crime to
On 02/12/2013 07:20 PM, Magnus Pettersson wrote:
You don't show the code that actually does the io.open(), nor the
url.encode, so I'm not going to guess what you're actually doing.
Hmm im not sure what you mean but I wrote all code needed in a previous post so
maybe you missed that one :)
I
On 02/12/2013 07:47 PM, Rick Johnson wrote:
> ...Oh Steven, if you only knew how we interpreted the "Oops!", more like
> "Doh!".
"You keep using that word. I do not think it means what you think it means."
> Got any more bright ideas DeAprano? (Oh gawd tha
On Saturday, February 9, 2013 5:04:18 AM UTC-6, Joshua Robinson wrote:
> Hi Monte-Pythons,
>
> x = "this is a simple : text: that has colon"
> s = x.replace(string.punctuation, ""); OR
> s = x.replace(string.punctuation, "");
> print x # 'this is a simple : text: that has colon'
>
> # The col
Marc Christiansen wrote:
> Try using a compressobj with 24 <= wbits < 32. It should work, but I
> didn't try.
>
Er, the problem is that compressobj doesn't accept a WBIT argument.
--
Fayaz Yusuf Khan
Cloud architect, Dexetra SS, India
fayaz.yusuf.khan_AT_gmail_DOT_com, fayaz_AT_dexetra_DOT_com
+
On Tuesday, February 12, 2013 10:44:09 PM UTC-6, Rick Johnson wrote:
>
> REFERENCES:
>
> [1]: Should string.replace handle list, tuple and dict
> arguments in addition to stri
On Tue, 12 Feb 2013 20:06:35 -0500, Roy Smith wrote:
> One thing we do in our Makefiles is "find . -name '*.pyc' | xargs rm".
> It avoids all sorts of nasty and hard to track down bugs (consider what
> happens if you move a .py file from one place in your source tree to
> another and leave the old
On 2/13/2013 12:18 AM, Fayaz Yusuf Khan wrote:
Marc Christiansen wrote:
Try using a compressobj with 24 <= wbits < 32. It should work, but I
didn't try.
Er, the problem is that compressobj doesn't accept a WBIT argument.
"Changed in version 3.3: Added the method, wbits, memlevel, strategy a
On Wed, Feb 13, 2013 at 1:47 PM, Rick Johnson
wrote:
>On Tuesday, February 12, 2013 12:15:29 AM UTC-6, Steven D'Aprano wrote:
>> If you've ever written an exception handler, you've probably written a
>> *buggy* exception handler:
>>
>> def getitem(items, index):
>> # One-based indexing.
>>
On 13 fév, 06:26, Rick Johnson wrote:
> On Tuesday, February 12, 2013 10:44:09 PM UTC-6, Rick Johnson wrote:
> >
> > REFERENCES:
> >
> > [1]: Should string.replace handle list
On Feb 13, 2013 12:00 AM, "Chris Angelico" wrote:
> Which word? "we"? I'm not entirely sure, given that non-monospaced
> fonts get in the way. Normally people would put exactly as many >
carets/tildes as there are letters in the word, but aligning the text
> in a mono font puts the carets under "
71 matches
Mail list logo