Re: Testing random

2015-06-17 Thread Thomas 'PointedEars' Lahn
MRAB wrote: > On 2015-06-17 00:45, Thomas 'PointedEars' Lahn wrote: >> Learn probability theory, and use a dictionary in Python when you want to >> count random hits. >> > I think that different people are talking about different things in > this thread. I think that you, too, do not know what yo

Re: Testing random

2015-06-17 Thread Christian Gollwitzer
Am 17.06.15 um 08:53 schrieb Thomas 'PointedEars' Lahn: 3. (Whereas I predict that the ignorant will see the correct answer to question 3 as proof of the correctness of their misconception.) I'v

Re: Testing random

2015-06-17 Thread Chris Angelico
On Wed, Jun 17, 2015 at 5:22 PM, Christian Gollwitzer wrote: > I'v been to the UK recently for cycling holidays. A nightmare! So many > ignorant people all driving on the wrong side of the road! You might argue that you drive on the right side of the road, but if you call what British people driv

Re: Testing random

2015-06-17 Thread Tim Golden
On 17/06/2015 08:22, Christian Gollwitzer wrote: > Am 17.06.15 um 08:53 schrieb Thomas 'PointedEars' Lahn: >> 3. >> >> >> (Whereas I predict that the ignorant will see the correct answer to >> quest

Re: Testing random

2015-06-17 Thread Mark Lawrence
On 17/06/2015 02:01, Chris Angelico wrote: On Wed, Jun 17, 2015 at 10:36 AM, wrote: Yes, we all know what the gambler's fallacy is, but that's not what anyone is arguing. The only instance of gambler's fallacy I'm seeing here is "PointedEars didn't understand the last dozen emails, so he's

Re: Testing random

2015-06-17 Thread Laura Creighton
In a message of Tue, 16 Jun 2015 16:58:26 -0600, Ian Kelly writes: >On Tue, Jun 16, 2015 at 4:30 PM, wrote: >> On Tuesday, June 16, 2015 at 3:01:06 PM UTC-7, Thomas 'PointedEars' Lahn >> wrote: >>> This should give you pause: In real mathematics, events with zero >>> probability can occur. >> >>

Re: Testing random

2015-06-17 Thread Cecil Westerhof
On Wednesday 17 Jun 2015 09:30 CEST, Tim Golden wrote: > On 17/06/2015 08:22, Christian Gollwitzer wrote: >> Am 17.06.15 um 08:53 schrieb Thomas 'PointedEars' Lahn: >>> 3. >>> >>> >>> (Whereas I predict tha

Re: Testing random

2015-06-17 Thread Laura Creighton
Stick to dice. Stay away from children. One thing we know of, for sure, is that certain breeding pairs are more likely to produce males, and others are more likely to produce females. We will ignore those born who are of indeterminate sex, for this discussion. In human beings, as well as a who

Re: operations on types

2015-06-17 Thread Steven D'Aprano
On Wed, 17 Jun 2015 02:58 pm, Ian Kelly wrote: > On Tue, Jun 16, 2015 at 8:04 PM, Steven D'Aprano > wrote: >> On Tue, 16 Jun 2015 19:24:03 -0500, Dr. John Q. Hacker wrote: >> >>> [Dr. Bigcock wrote:] The current syntax for adding functionality to a class using mix-in style via inheritan

Re: Testing random

2015-06-17 Thread Steven D'Aprano
On Wed, 17 Jun 2015 08:33 pm, Laura Creighton wrote: > Stick to dice. Stay away from children. One thing we know of, for sure, > is that certain breeding pairs are more likely to produce males, and > others are more likely to produce females. We will ignore those born who > are of indeterminat

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Tuesday, June 16, 2015 at 9:33:58 PM UTC+5:30, Chris Angelico wrote: > On Wed, Jun 17, 2015 at 1:17 AM, wrote: > > Thanks. The scipy issue seems solved. But this silly issue is giving so > > much of time. I am checking. Please see a sample code, > > > > import sys > > sys.stderr = sys.stdout >

Re: Creating .exe file in Python

2015-06-17 Thread Chris Angelico
On Wed, Jun 17, 2015 at 11:10 PM, wrote: > Thank you all. It seems going fine now. I have one additional question if I > run the .exe files created in Non Python Windows environment. Linux has > Python builtin but in Non Python environment how may I run it? Is there any > set of prequisites I

Re: Creating .exe file in Python

2015-06-17 Thread hamilton
On 6/17/2015 7:20 AM, Chris Angelico wrote: On Wed, Jun 17, 2015 at 11:10 PM, wrote: Thank you all. It seems going fine now. I have one additional question if I run the .exe files created in Non Python Windows environment. Linux has Python builtin but in Non Python environment how may I run

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 6:50:48 PM UTC+5:30, Chris Angelico wrote: > On Wed, Jun 17, 2015 at 11:10 PM, wrote: > > Thank you all. It seems going fine now. I have one additional question if I > > run the .exe files created in Non Python Windows environment. Linux has > > Python builtin but i

Problem with PyPI login

2015-06-17 Thread Miki Tebeka
Greetings, After confirming email I can't login to PyPI with the password and when trying to rest I get: user "Cyberint" is unknwon to me. However when trying to re-register it says the user is already there. The forums at https://sourceforge.net/p/pypi/support-requests/ (which is linked from

Re: Testing random

2015-06-17 Thread Laura Creighton
In a message of Wed, 17 Jun 2015 22:47:37 +1000, "Steven D'Aprano" writes: >There are magicians who are capable of forcing coins to land the required >way up, and somebody once built a machine capable of tossing a coin with >the precise equal force and velocity every single time. Dice are rarely >u

Re: Creating .exe file in Python

2015-06-17 Thread Chris Angelico
On Wed, Jun 17, 2015 at 11:33 PM, hamilton wrote: > On 6/17/2015 7:20 AM, Chris Angelico wrote: >> >> On Wed, Jun 17, 2015 at 11:10 PM, wrote: >>> >>> Thank you all. It seems going fine now. I have one additional question if >>> I run the .exe files created in Non Python Windows environment. Lin

Re: Creating .exe file in Python

2015-06-17 Thread Laura Creighton
In a message of Wed, 17 Jun 2015 06:10:45 -0700, subhabrata.bane...@gmail.com w rites: >Dear Group, > >Thank you all. It seems going fine now. I have one additional question if I >run the .exe files created in Non Python Windows environment. Linux has Python >builtin but in Non Python environmen

Re: Problem with PyPI login

2015-06-17 Thread Laura Creighton
In a message of Wed, 17 Jun 2015 06:49:08 -0700, Miki Tebeka writes: >Greetings, > >After confirming email I can't login to PyPI with the password and when trying >to rest I get: user "Cyberint" is unknwon to me. However when trying to >re-register it says the user is already there. > >The forums

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 7:25:39 PM UTC+5:30, Laura Creighton wrote: > In a message of Wed, 17 Jun 2015 06:10:45 -0700, w > rites: > > >Dear Group, > > > >Thank you all. It seems going fine now. I have one additional question if I > >run the .exe files created in Non Python Windows environm

Re: Testing random

2015-06-17 Thread Grant Edwards
On 2015-06-17, Mark Lawrence wrote: > An alternative explanation is that he's just a plain, old fashioned > troll, as pointed out by Denis McMahon some weeks ago. Now what is > the probability of that? :) Looks to me like it's asymptotically approaching 1. I'm going to stop paying attention n

Re: Problem with PyPI login

2015-06-17 Thread Mark Lawrence
On 17/06/2015 14:49, Miki Tebeka wrote: Greetings, After confirming email I can't login to PyPI with the password and when trying to rest I get: user "Cyberint" is unknwon to me. However when trying to re-register it says the user is already there. The forums at https://sourceforge.net/p/pypi

Re: Creating .exe file in Python

2015-06-17 Thread random832
On Wed, Jun 17, 2015, at 09:33, hamilton wrote: > However, the python source can be read by anyone. > > As a .exe, the source can not be read. > > Just because the interpreter is open source, > does not mean my application should be. Being readable isn't the same thing as being open source. If s

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, subhabrat...@gmail.com wrote: > Dear Group, > > I am trying to learn how to create .exe file for Python. I tried to work > around > http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went > nice. > But if I try to make exe for

Re: Problem with PyPI login

2015-06-17 Thread Miki Tebeka
> >The forums at https://sourceforge.net/p/pypi/support-requests/ (which is > >linked from "PyPI Support") seems pretty deserted. What is the right > >location for these kind of issues? > That is one place. > https://bitbucket.org/pypa/pypi/issues Thanks! -- https://mail.python.org/mailman/lis

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 7:47:59 PM UTC+5:30, rand...@fastmail.us wrote: > On Wed, Jun 17, 2015, at 09:33, hamilton wrote: > > However, the python source can be read by anyone. > > > > As a .exe, the source can not be read. > > > > Just because the interpreter is open source, > > does not m

Re: Creating .exe file in Python

2015-06-17 Thread Chris Angelico
On Thu, Jun 18, 2015 at 12:17 AM, wrote: > On Wed, Jun 17, 2015, at 09:33, hamilton wrote: >> However, the python source can be read by anyone. >> >> As a .exe, the source can not be read. >> >> Just because the interpreter is open source, >> does not mean my application should be. > > Being read

Re: Set a flag on the function or a global?

2015-06-17 Thread Steven D'Aprano
On Wed, 17 Jun 2015 09:51 am, Cameron Simpson wrote: > On 16Jun2015 18:18, Steven D'Aprano > wrote: >>On Tuesday 16 June 2015 10:35, MRAB wrote: >>> On 2015-06-16 01:24, sohcahto...@gmail.com wrote: Using a keyword argument for the edir function is the most intuitive and easy to read, I

Re: Testing random

2015-06-17 Thread Ian Kelly
On Wed, Jun 17, 2015 at 8:04 AM, Grant Edwards wrote: > On 2015-06-17, Mark Lawrence wrote: > >> An alternative explanation is that he's just a plain, old fashioned >> troll, as pointed out by Denis McMahon some weeks ago. Now what is >> the probability of that? :) > > Looks to me like it's asym

JSON Object to CSV file

2015-06-17 Thread Saran A
I would like to have this JSON object written out to a CSV file so that the keys are header fields (for each of the columns) and the values are values that are associated with each header field. Is there a best practice for working with this? Ideally I would like to recursively iterate through t

Re: Set a flag on the function or a global?

2015-06-17 Thread Laura Creighton
To figure out what I like, I would need to play with edir, and the suite that it comes with. I suspect there is command like: stop_showing_me_all_this_uninteresting_stuff = True in my future, and dunders is only a small part of that. Laura -- https://mail.python.org/mailman/listinfo/python-li

Re: Creating .exe file in Python

2015-06-17 Thread Laura Creighton
In a message of Wed, 17 Jun 2015 07:16:33 -0700, subhabrata.bane...@gmail.com w rites: >On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, subhabrat...@gmail.com wrote: >> Dear Group, >> >> I am trying to learn how to create .exe file for Python. I tried to work >> around >> http://www.py2exe.org/

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 8:52:16 PM UTC+5:30, Laura Creighton wrote: > In a message of Wed, 17 Jun 2015 07:16:33 -0700, w > rites: > >On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, wrote: > >> Dear Group, > >> > >> I am trying to learn how to create .exe file for Python. I tried to work

Re: Creating .exe file in Python

2015-06-17 Thread Steven D'Aprano
On Wed, 17 Jun 2015 11:52 pm, Chris Angelico wrote: > If you truly want to protect your code from prying eyes, therefore, > there's only one way to do it: host it on a server, and let people > access the server without seeing the code. Stop giving people ideas. -- Steven -- https://mail.pyt

Re: operations on types

2015-06-17 Thread Steven D'Aprano
On Thu, 18 Jun 2015 12:26 am, Ned Batchelder wrote: > On Wednesday, June 17, 2015 at 7:52:05 AM UTC-4, Steven D'Aprano wrote: >> At the moment, I'm still willing to give Dr Hacker the benefit of the >> doubt re the sockpuppet suspicion. > > If you search for "zondervanz", you will find the GitHu

Re: JSON Object to CSV file

2015-06-17 Thread Sahlusar
On Wednesday, June 17, 2015 at 11:00:24 AM UTC-4, Saran A wrote: > I would like to have this JSON object written out to a CSV file so that the > keys are header fields (for each of the columns) and the values are values > that are associated with each header field. Is there a best practice for >

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 9:09:32 PM UTC+5:30, Steven D'Aprano wrote: > On Wed, 17 Jun 2015 11:52 pm, Chris Angelico wrote: > > > If you truly want to protect your code from prying eyes, therefore, > > there's only one way to do it: host it on a server, and let people > > access the server wi

Re: Creating .exe file in Python

2015-06-17 Thread Chris Angelico
On Thu, Jun 18, 2015 at 1:39 AM, Steven D'Aprano wrote: > On Wed, 17 Jun 2015 11:52 pm, Chris Angelico wrote: > >> If you truly want to protect your code from prying eyes, therefore, >> there's only one way to do it: host it on a server, and let people >> access the server without seeing the code.

Re: Set a flag on the function or a global?

2015-06-17 Thread Steven D'Aprano
On Thu, 18 Jun 2015 01:06 am, Laura Creighton wrote: > To figure out what I like, I would need to play with edir, and the > suite that it comes with. > > I suspect there is command like: > > stop_showing_me_all_this_uninteresting_stuff = True > > in my future, and dunders is only a small part o

Re: operations on types

2015-06-17 Thread Michael Torrie
On 06/17/2015 09:42 AM, Steven D'Aprano wrote: > On Thu, 18 Jun 2015 12:26 am, Ned Batchelder wrote: > >> On Wednesday, June 17, 2015 at 7:52:05 AM UTC-4, Steven D'Aprano wrote: > >>> At the moment, I'm still willing to give Dr Hacker the benefit of the >>> doubt re the sockpuppet suspicion. >> >

Re: Trying to configure Apache and Python 2.7 on Red Hat I get 403 Forbidden

2015-06-17 Thread Michael Torrie
On 06/16/2015 12:19 PM, Chris Warrick wrote: > On Tue, Jun 16, 2015 at 8:14 PM, Néstor Boscán wrote: >> I tried that but it didn't work. >> >> I had to change /etc/selinux/config and reboot to make it work. It would be >> nice if the wsgi module generated some log that explains why you get the >>

Re: JSON Object to CSV file

2015-06-17 Thread Peter Otten
Sahlusar wrote: > On Wednesday, June 17, 2015 at 11:00:24 AM UTC-4, Saran A wrote: >> I would like to have this JSON object written out to a CSV file so that >> the keys are header fields (for each of the columns) and the values are >> values that are associated with each header field. Is there a

Classic OOP in Python

2015-06-17 Thread Jason P.
Hello Python community. I come from a classic background in what refers to OOP. Mostly Java and PHP (> 5.3). I'm used to abstract classes, interfaces, access modifiers and so on. Don't get me wrong. I know that despite the differences Python is fully object oriented. My point is, do you know an

anaconda upgrade

2015-06-17 Thread Sebastian M Cheung via Python-list
What is the best way to upgrade an existing virtual environment anaconda from 2.7.9 to 2.7.10 -- https://mail.python.org/mailman/listinfo/python-list

Re: Classic OOP in Python

2015-06-17 Thread Skip Montanaro
On Wed, Jun 17, 2015 at 2:21 PM, Jason P. wrote: > I'm gonna try to develop a modest application from ground up using > TDD. If it had been done in Java for instance, I would made > extensive use of interfaces to define the boundaries of my > system. How would I do something like that in Python?

Re: Classic OOP in Python

2015-06-17 Thread Ned Batchelder
On Wednesday, June 17, 2015 at 3:21:32 PM UTC-4, Jason P. wrote: > Hello Python community. > > I come from a classic background in what refers to OOP. Mostly Java and PHP > (> 5.3). I'm used to abstract classes, interfaces, access modifiers and so on. > > Don't get me wrong. I know that despite

Re: Classic OOP in Python

2015-06-17 Thread Marko Rauhamaa
Ned Batchelder : > TDD is about writing tests as a way to design the best system, and > putting testing at the center of your development workflow. It works > great with Python even without interfaces. I wonder how great it really is. Testing is important, that's for sure, but to make it a dogmat

Re: anaconda upgrade

2015-06-17 Thread Mark Lawrence
On 17/06/2015 20:22, Sebastian M Cheung via Python-list wrote: What is the best way to upgrade an existing virtual environment anaconda from 2.7.9 to 2.7.10 Do some research, e.g. use a search engine, then try the upgrade. If that doesn't work ask another question, giving the precise detail

Re: Classic OOP in Python

2015-06-17 Thread Mark Lawrence
On 17/06/2015 21:39, Marko Rauhamaa wrote: Ned Batchelder : TDD is about writing tests as a way to design the best system, and putting testing at the center of your development workflow. It works great with Python even without interfaces. I wonder how great it really is. Testing is important,

Re: Classic OOP in Python

2015-06-17 Thread Ned Batchelder
On Wednesday, June 17, 2015 at 4:39:31 PM UTC-4, Marko Rauhamaa wrote: > The way it was explained to me was that in TDD you actually don't write > code to any requirements or design: you simply do the least to pass the > tests. Thus, say you need to write a program that inputs a string and > output

Re: Classic OOP in Python

2015-06-17 Thread sohcahtoa82
On Wednesday, June 17, 2015 at 12:21:32 PM UTC-7, Jason P. wrote: > Hello Python community. > > I come from a classic background in what refers to OOP. Mostly Java and PHP > (> 5.3). I'm used to abstract classes, interfaces, access modifiers and so on. > > Don't get me wrong. I know that despite

Re: Classic OOP in Python

2015-06-17 Thread sohcahtoa82
On Wednesday, June 17, 2015 at 1:39:31 PM UTC-7, Marko Rauhamaa wrote: > Ned Batchelder : > > > TDD is about writing tests as a way to design the best system, and > > putting testing at the center of your development workflow. It works > > great with Python even without interfaces. > > I wonder h

Re: Classic OOP in Python

2015-06-17 Thread Mark Lawrence
On 17/06/2015 22:33, sohcahto...@gmail.com wrote: On Wednesday, June 17, 2015 at 1:39:31 PM UTC-7, Marko Rauhamaa wrote: Ned Batchelder : TDD is about writing tests as a way to design the best system, and putting testing at the center of your development workflow. It works great with Python ev

Posting gzip'd image file - server says Malformed Upload?

2015-06-17 Thread Paul Hubert
Any idea why a server might be returning the message, in json format, "Malformed Upload"? The image is gzipped as the server requires... Someone on another forum said that he thinks Python requests automatically gzips? I have the code working in vb.net... no idea why it wont work in Python. Thi

Re: Classic OOP in Python

2015-06-17 Thread Laura Creighton
In a message of Wed, 17 Jun 2015 23:39:17 +0300, Marko Rauhamaa writes: >Ned Batchelder : > >> TDD is about writing tests as a way to design the best system, and >> putting testing at the center of your development workflow. It works >> great with Python even without interfaces. > >I wonder how gre

Re: Classic OOP in Python

2015-06-17 Thread Laura Creighton
In a message of Wed, 17 Jun 2015 14:33:43 -0700, sohcahto...@gmail.com writes: >I had a Java class where we had to learn TDD, and that's the way TDD >was taught to us, and I hated it. We watched a video of this guy >explaining TDD with a hat that was red on the front and green on the >back. It i

Re: Classic OOP in Python

2015-06-17 Thread Mark Lawrence
On 17/06/2015 23:09, Laura Creighton wrote: ps -- Marko, we have ample evidence that you are an extremely clever person. But the purpose of TTD is not to make clever code, but wise code. TTD in the hands of a fool will never produce that. But how else do you have to check that your design, whi

Re: Classic OOP in Python

2015-06-17 Thread Laura Creighton
In a message of Wed, 17 Jun 2015 14:14:34 -0700, Ned Batchelder writes: >The true TDD acolytes advocate a very idiosyncratic workflow, it's true. >I don't do this, but I also don't consider myself a TDD person. I value >tests a great deal, and put a lot of effort into them, but I don't write >triv

Re: Generating list of unique search sub-phrases

2015-06-17 Thread Nick Mellor
On Saturday, 30 May 2015 06:39:44 UTC+10, Nick Mellor wrote: > Hi all, > > My own solution works but I'm sure it could be simpler or read better. How > would you do it? > > Say you've got a list of companies: > > Aerosonde Ltd > Amcor > ANCA > Austal Ships > Australia Post > Australian Air Exp

Re: Classic OOP in Python

2015-06-17 Thread Ned Batchelder
On Wednesday, June 17, 2015 at 6:34:23 PM UTC-4, Laura Creighton wrote: > TDD is supposed to make you brave, not cowards, and it's > Ned's most excellent tool > http://nedbatchelder.com/code/coverage/ > that I recommend to TDD dogmatic cowards. > > Even if you don't want to use TTD, you will enjoy

Re: Classic OOP in Python

2015-06-17 Thread Steven D'Aprano
On Thu, 18 Jun 2015 06:39 am, Marko Rauhamaa wrote: > Ned Batchelder : > >> TDD is about writing tests as a way to design the best system, and >> putting testing at the center of your development workflow. It works >> great with Python even without interfaces. > > I wonder how great it really is

Re: Classic OOP in Python

2015-06-17 Thread Terry Reedy
On 6/17/2015 4:39 PM, Marko Rauhamaa wrote: Ned Batchelder : TDD is about writing tests as a way to design the best system, and putting testing at the center of your development workflow. It works great with Python even without interfaces. I use what I might call 'smart TDD'. I think it a mi

Documenting a function signature (was: Set a flag on the function or a global?)

2015-06-17 Thread Ben Finney
Steven D'Aprano writes: > The full signature is: > > edir([object [, glob=''] [, dunders=True] [, meta=False]]) > > All four arguments are optional, and dunders and meta are > keyword-only. The official documentation seems to prefer this style:: edit(object, glob='', *, dunders=True, meta=F

Re: Classic OOP in Python

2015-06-17 Thread Chris Angelico
On Thu, Jun 18, 2015 at 6:39 AM, Marko Rauhamaa wrote: > Another interesting ism I have read about is the idea that the starting > point of any software project should be the user manual. The developers > should then go and build the product that fits the manual. I've seldom met a *user* manual t

Re: Documenting a function signature (was: Set a flag on the function or a global?)

2015-06-17 Thread Ian Kelly
On Wed, Jun 17, 2015 at 6:04 PM, Ben Finney wrote: > Steven D'Aprano writes: > >> The full signature is: >> >> edir([object [, glob=''] [, dunders=True] [, meta=False]]) >> >> All four arguments are optional, and dunders and meta are >> keyword-only. > > The official documentation seems to prefer

Re: Documenting a function signature (was: Set a flag on the function or a global?)

2015-06-17 Thread Chris Angelico
On Thu, Jun 18, 2015 at 10:04 AM, Ben Finney wrote: > Steven D'Aprano writes: > >> The full signature is: >> >> edir([object [, glob=''] [, dunders=True] [, meta=False]]) >> >> All four arguments are optional, and dunders and meta are >> keyword-only. > > The official documentation seems to prefe

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-17 Thread Chris Angelico
On Thu, Jun 18, 2015 at 7:55 AM, Paul Hubert wrote: > f_in = open(dafile, 'rb') > f_out = gzip.open('/Users/Paul/Desktop/scripts/pic.jpg.gz', 'wb') > f_out.writelines(f_in) > f_out.close() > f_in.close() Are you sure you want iteration and writelines() here? I would be inclined to avoid those for

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-17 Thread Paul Hubert
On Wednesday, June 17, 2015 at 8:24:17 PM UTC-4, Chris Angelico wrote: > Are you sure you want iteration and writelines() here? I would be > inclined to avoid those for any situation that isn't plain text. If > the file isn't too big, I'd just read it all in a single blob and then > write it all o

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-17 Thread Michael Torrie
On 06/17/2015 06:45 PM, Paul Hubert wrote: > On Wednesday, June 17, 2015 at 8:24:17 PM UTC-4, Chris Angelico wrote: > >> Are you sure you want iteration and writelines() here? I would be >> inclined to avoid those for any situation that isn't plain text. If >> the file isn't too big, I'd just read

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-17 Thread Chris Angelico
On Thu, Jun 18, 2015 at 10:45 AM, Paul Hubert wrote: > On Wednesday, June 17, 2015 at 8:24:17 PM UTC-4, Chris Angelico wrote: > >> Are you sure you want iteration and writelines() here? I would be >> inclined to avoid those for any situation that isn't plain text. If >> the file isn't too big, I'd

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-17 Thread Paul Hubert
On Wednesday, June 17, 2015 at 9:46:25 PM UTC-4, Chris Angelico wrote: > On Thu, Jun 18, 2015 at 10:45 AM, Paul Hubert wrote: > > On Wednesday, June 17, 2015 at 8:24:17 PM UTC-4, Chris Angelico wrote: > > > >> Are you sure you want iteration and writelines() here? I would be > >> inclined to avoid

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-17 Thread Chris Angelico
On Thu, Jun 18, 2015 at 1:48 PM, Paul Hubert wrote: >> # Now: >> gz = '/Users/Paul/Desktop/scripts/pic.jpg.gz' >> with open(dafile, 'rb') as f_in, gzip.open(gz, 'wb') as f_out: >> f_out.write(f_in.read()) >> > > Same result - server says malformed upload. :/ Oh well, was worth a shot. Since t

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-17 Thread Michael Torrie
On 06/17/2015 09:48 PM, Paul Hubert wrote: > Same result - server says malformed upload. :/ You may want to run a sniffer like wireshark and see what the difference is between the packets coming from your C# program and coming from Python. -- https://mail.python.org/mailman/listinfo/python-list