RE: issue for setup pandas

2021-09-21 Thread Fady Victor Mikhael Abdelmalk
info failed')': /simple/pandas/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pandas/ Thanks, Fady

Found a problem

2021-03-09 Thread Victor Dib
Olá, comunidade do Python! Meu nome é Victor Dib, e sou um estudante brasileiro de programação. Já entrei em contato com vocês hoje, e vocês solicitaram que eu me inscrevesse na lista de e-mails de vocês primeiro. Bom, isso já foi feito, então espero que agora vocês possam dar atenção ao meu

Idle not opening

2020-05-06 Thread Rance Victor
Hey there, After successfully installing Python 3.8.2(64 bit) on my system(windows 10 64 bit OS), my idle is not opening. I've tried uninstalling and reinstalling it again but still the same result. Looking forward to a fix please. Thanks -- https://mail.python.org/mailman/listinfo/python-list

Recommended format for --log-level option

2018-09-24 Thread Victor Porton
What is the recommended format for --log-level (or --loglevel?) command line option? Is it a number or NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL? Or should I accept both numbers and these string constants? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo

Re: What is not working with my "map" usage?

2018-09-22 Thread Victor via Python-list
On Saturday, September 22, 2018 at 12:20:08 PM UTC-7, Thomas Jollans wrote: > On 22/09/2018 20:18, Victor via Python-list wrote: > > On Saturday, September 22, 2018 at 6:22:32 AM UTC-7, Peter Otten wrote: > >> Victor via Python-list wrote: > >> > >>> Let me

Re: What is not working with my "map" usage?

2018-09-22 Thread Victor via Python-list
On Saturday, September 22, 2018 at 6:22:32 AM UTC-7, Peter Otten wrote: > Victor via Python-list wrote: > > > Let me use a different input args and display them below. Basically, I am > > hoping to add up all elements of each nested list. So at first it should > > start

Re: What is not working with my "map" usage?

2018-09-22 Thread Victor via Python-list
Let me use a different input args and display them below. Basically, I am hoping to add up all elements of each nested list. So at first it should start with [1,11,111] ==> 1+11+111 = 123. But instead, it appears to take the 1st element from each nested list to add up [1,2,3] = 6. How shoul

What is more Pythonic: subclass or adding functionality to base class?

2018-02-11 Thread Victor Porton
e objects of this class. What is more pythonic? 1. Create its subclass PredicateParserWithError and add the additional field on_error to this class. 2. Add on_error field to the base class, setting it to None by default, if the class's user does not need this field. -- Victor Porton

Re: $srcdir and $datadir

2018-02-10 Thread Victor Porton
First, I've already solved my problem using setuptools and pkg_resources.resource_stream() and an environment variable to specify the path to data files. Ben Finney wrote: > Victor Porton writes: > >> In GNU software written in C $srcdir and $datadir are accessible to

$srcdir and $datadir

2018-02-08 Thread Victor Porton
In GNU software written in C $srcdir and $datadir are accessible to C code through generated config.h file. What is the right way to config directories for a Python program? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Dependency injection: overriding defaults

2018-02-01 Thread Victor Porton
dieter wrote: > Victor Porton writes: > >> I am writing a library, a command line utility which uses the library, >> and a I am going to use dependency_injector package. >> >> Consider loggers: >> >> For the core library the logger should default to

Re: Object-oriented gettext

2018-01-31 Thread Victor Porton
Victor Porton wrote: > I want to write a multiuser application which uses multiple languages (one > language for logging and a language per user). > > https://docs.python.org/3/library/gettext.html describes a procedural > gettext interface. The language needs to be switched befo

Advice on where to define dependency injection providers

2018-01-31 Thread Victor Porton
ecution_context_build, or maybe in something like xmlboiler.core.providers.execution_context? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Object-oriented gettext

2018-01-31 Thread Victor Porton
above example). What is the best way to do this? Should I write an object-oriented wrapper around gettext package? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Dependency injection: overriding defaults

2018-01-31 Thread Victor Porton
library. For the server, the log should go to a file (not to stderr). Question: How to profoundly make my software to use the appropriate logger, dependently on whether it is a command line utility or the daemon? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Thursday, February 1, 2018 at 5:57:58 PM UTC+13, Victor Porton wrote: >> I meant to call poll() from C code, not Python code. > > Do you need to use C code at all? Python is quite capable of handling this > <https://docs.python.org/3/lib

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Thursday, February 1, 2018 at 8:10:24 AM UTC+13, Victor Porton wrote: >> Lawrence D’Oliveiro wrote: >> >>> The usual behaviour for POSIX is that the call is aborted with EINTR >>> after you get the signal. >> >> T

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
Dennis Lee Bieber wrote: > On Wed, 31 Jan 2018 20:58:56 +0200, Victor Porton > declaimed the following: > >>LibComCom is a C library which passes a string as stdin of an OS command >>and stores its stdout in another string. >> >>I wrote this library recen

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
wxjmfa...@gmail.com wrote: > Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit : >> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: >> > LibComCom is a C library which passes a string as stdin of an OS >> > command and stores its stdout in anoth

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
Chris Angelico wrote: > On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: >> LibComCom is a C library which passes a string as stdin of an OS command >> and stores its stdout in another string. > > Something like the built-in subprocess module does? I was going to

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 9:55:45 PM UTC+13, Victor Porton wrote: >> Lawrence D’Oliveiro wrote: >> >>> On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton >>> wrote: >>>> For this reason I >>&g

Help to debug my free library

2018-01-31 Thread Victor Porton
Traceback (most recent call last): Segmentation fault (here libcomcom.so is installed in /usr/local/lib) -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton wrote: >> For this reason I >> cannot use Python signals because "A Python signal handler does not get >> executed inside the low-level (C) signal handler. Instead, the low-le

Re: Handle SIGINT in C and Python

2018-01-31 Thread Victor Porton
Victor Porton wrote: > I need to assign a real C signal handler to SIGINT. > > This handler may be called during poll() waiting for data. For this reason > I cannot use Python signals because "A Python signal handler does not get > executed inside the low-level (C) signal h

Handle SIGINT in C and Python

2018-01-31 Thread Victor Porton
dler). Is this possible? How? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Package containing C sources (Posting On Python-List Prohibited)

2018-01-30 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 6:13:00 PM UTC+13, Victor Porton wrote: >> I am going to create a Python wrapper around a generally useful C >> library. So the wrapper needs to contain some C code to glue them >> together. > > Not neces

Package containing C sources

2018-01-30 Thread Victor Porton
I am going to create a Python wrapper around a generally useful C library. So the wrapper needs to contain some C code to glue them together. Can I upload a package containing C sources to PyPi? If not, what is the proper way to distribute it? -- Victor Porton - http://portonvictor.org

Nested Loop Triangle

2017-05-25 Thread Victor Demelo
I need the triangle to be in reverse. The assignment requires a nested loop to generate a triangle with the user input of how many lines. Currently, I get answers such as: (A) OOO OO O When I actually need it to be like this: (B) OOO OO O I need the display (A) to

Re: Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
On Thursday, May 25, 2017 at 12:28:45 PM UTC-4, Victor Demelo wrote: > I need the triangle to be in reverse. The assignment requires a nested loop > to generate a triangle with the user input of how many lines. > > Currently, I get answers such as: > > OOO > OO > O &

Re: Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
On Thursday, May 25, 2017 at 12:28:45 PM UTC-4, Victor Demelo wrote: > I need the triangle to be in reverse. The assignment requires a nested loop > to generate a triangle with the user input of how many lines. > > Currently, I get answers such as: > > OOO > OO > O &

Nested

2017-05-25 Thread Victor Demelo
d -- https://mail.python.org/mailman/listinfo/python-list

Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
I need the triangle to be in reverse. The assignment requires a nested loop to generate a triangle with the user input of how many lines. Currently, I get answers such as: OOO OO O When I actually need it to be like this: OOO OO O I just need to get it flipped-over on the other

Re: Python package to accept payments in Internet

2017-05-04 Thread Victor Porton
Gregory Ewing wrote: > Victor Porton wrote: >> You carp with words, finding a problem where there is no real problem, >> just words (I mean the word "hack") which sound like a problem. > > Words are important. The very fact that it sounds like a > problem

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
On Wed, 2017-05-03 at 17:02 +0200, Chris Warrick wrote: > On 3 May 2017 at 16:45, Victor Porton wrote: > > Steve D'Aprano wrote: > >  > > > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > > >  > > > > I have created a full featu

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
Chris Warrick wrote: > On 3 May 2017 at 17:19, Victor Porton wrote: >> What do you mean by "banned"? Does this mean that Google does not use >> software of this license? > > https://opensource.google.com/docs/using/agpl-policy/ > https:

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
On Wed, 2017-05-03 at 17:02 +0200, Chris Warrick wrote: > On 3 May 2017 at 16:45, Victor Porton wrote: > > Steve D'Aprano wrote: > > > > > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > > > > > > > I have created a full featu

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
Steve D'Aprano wrote: > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > >> I have created a full featured package to accept payments in Internet >> (currently supports PayPal). > [...] >> Buy the commercial version and support scientific research and a

Python package to accept payments in Internet

2017-05-02 Thread Victor Porton
gateway for many different payment processors. Buy the commercial version and support scientific research and a new principle of the Web I am working on. I hope you don't take this message as spam. Is it OK to post updates of our software to this mailing list in the future? -- Victor Porton -

Re: Python for WEB-page !?

2017-01-06 Thread Victor Porton
t. Consider PyPi. I never used it, but they say, it is faster than usual CPython interpreter. > I waiting with higher interest your feedback. > > Thanks to all members of community for support and advice. > Keep in touch. > Kind regards. -- Victor Porton - http://portonvictor.org --

Re: Python for WEB-page !?

2017-01-05 Thread Victor Porton
t. Consider PyPi. I never used it, but they say, it is faster than usual CPython interpreter. > I waiting with higher interest your feedback. > > Thanks to all members of community for support and advice. > Keep in touch. > Kind regards. -- Victor Porton - http://portonvictor.org --

Re: Which of two variants of code is better?

2016-11-21 Thread Victor Porton
Ned Batchelder wrote: > On Monday, November 21, 2016 at 12:48:25 PM UTC-5, Victor Porton wrote: >> Which of two variants of code to construct an "issue comment" object >> (about BitBucket issue comments) is better? >> >> 1. >> >> obj = IssueCo

Which of two variants of code is better?

2016-11-21 Thread Victor Porton
nt)] obj = construct_subobject(repository, list) (`construct_subobject` is to be defined in such as way that "1" and "2" do the same.) Would you advise me to make such function construct_subobject function or just to use the direct coding as in "1"? -- Victor Porton -

Extra base class in hierarchy

2016-11-19 Thread Victor Porton
... -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Two variants of class hierachy

2016-11-19 Thread Victor Porton
Peter Otten wrote: > Victor Porton wrote: > >> I am developing software which shows hierarchical information (tree), >> including issues and comments from BitBucket (comments are sub-nodes of >> issues, thus it forms a tree). >> >> There are two kinds of

C3 MRO

2016-11-19 Thread Victor Porton
Do I understand correctly, than C3 applies to particular methods, and thus it does not fail, if it works for every defined method, even if it can fail after addition of a new method? Also, at which point it fails: at definition of a class or at calling a particular "wrong" method?

Two variants of class hierachy

2016-11-19 Thread Victor Porton
# diamonds: class A(BitBucketHierarchyLevel, HierarchyLevelWithPagination): ... class B(BitBucketHierarchyLevel, HierarchyLevelWithShortList): ... -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Language improvement: Get more from the `for .. else` clause

2016-06-29 Thread Victor Savu
interested in a more concrete case such as a domain-specific application (I can think of progress bars, logging, transfer rate statistics ...). Best, VS On Mon, Jun 27, 2016 at 5:06 PM, Michael Selik wrote: > On Mon, Jun 27, 2016 at 12:53 AM Victor Savu < > victor.nicolae.s...@gmail.c

Re: "for/while ... break(by any means) ... else" make sense?

2016-06-29 Thread Victor Savu
There are many posts trying to explain the else after for or while. Here is my take on it: There are three ways of getting out of a (for/while) loop: throw, break or the iterator gets exhausted. The question is, how cab we tell which way we exited? For the throw, we have the except clause. This le

Language improvement: Get more from the `for .. else` clause

2016-06-26 Thread Victor Savu
proof-of-concept implementation: repository: https://github.com/Victor-Savu/cpython branch: feat/else_capture Dear members of the Python list, I am writing to discuss and get the community's opinion on the following two ideas: 1. Capture the `StopIteration.value` in the `else` c

The next major Python version will be Python 8

2016-03-31 Thread Victor Stinner
d yet. Hopefully, trying to import any module of the standard library fails. Don't hesitate to propose more ideas to make Python 8 more incompatible with Python 3! Note: The change is already effective in the default branch of Python: https://hg.python.org/cpython/rev/9aedec2dbc01 Have fun, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] How the heck does async/await work in Python 3.5

2016-02-24 Thread Victor Stinner
See also Doug Hellmann article on asyncio, from its serie of "Python 3 Module of the Week" articles: https://pymotw.com/3/asyncio/index.html Victor 2016-02-23 22:25 GMT+01:00 Joao S. O. Bueno : > Today I also stumbled on this helpful "essay" from Brett Cannon about >

Re: Relaxed, or best-efforts JSON parser for Python?

2015-10-12 Thread victor . hooi
On Monday, October 12, 2015 at 10:02:13 PM UTC+11, Laura Creighton wrote: > In a message of Sun, 11 Oct 2015 17:56:33 -0700, Victor Hooi writes: > >Hi, > > > >I'm attempting to parse MongoDB loglines. > > > >The formatting of these loglines could best b

Relaxed, or best-efforts JSON parser for Python?

2015-10-11 Thread Victor Hooi
efforts parsing of non-spec JSON? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Reading in large logfiles, and processing lines in batches - maximising throughput?

2015-09-16 Thread Victor Hooi
I'm using Python to parse metrics out of logfiles. The logfiles are fairly large (multiple GBs), so I'm keen to do this in a reasonably performant way. The metrics are being sent to a InfluxDB database - so it's better if I can batch multiple metrics into a batch ,rather than sending them indiv

Re: Using enumerate to get line-numbers with itertools grouper?

2015-09-13 Thread Victor Hooi
On Thursday, 3 September 2015 03:49:05 UTC+10, Terry Reedy wrote: > On 9/2/2015 6:04 AM, Victor Hooi wrote: > > I'm using grouper() to iterate over a textfile in groups of lines: > > > > def grouper(iterable, n, fillvalue=None): > > "Collect da

Accumulating points in batch for sending off

2015-09-04 Thread Victor Hooi
Hi, I'm using Python to parse out metrics from logfiles, and ship them off to a database called InfluxDB, using their Python driver (https://github.com/influxdb/influxdb-python). With InfluxDB, it's more efficient if you pack in more points into each message. Hence, I'm using the grouper() re

Re: Using enumerate to get line-numbers with itertools grouper?

2015-09-02 Thread Victor Hooi
which is then passing another iterable to enumerate - I'm just not sure of the best way to get the line numbers from the original iterable f, and pass this through the chain? On Wednesday, 2 September 2015 20:37:01 UTC+10, Peter Otten wrote: > Victor Hooi wrote: > > > I

for loop over function that returns a tuple?

2015-09-02 Thread Victor Hooi
I have a function which is meant to return a tuple: def get_metrics(server_status_json, metrics_to_extract, line_number): return ((timestamp, "serverstatus", values, tags)) I also have: def create_point(timestamp, metric_name, values, tags): return {

Using enumerate to get line-numbers with itertools grouper?

2015-09-02 Thread Victor Hooi
I'm using grouper() to iterate over a textfile in groups of lines: def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx args = [iter(iterable)] * n return zip_longest(fillvalue=fillvalue, *args) Ho

Re: Casting to a "number" (both int and float)?

2015-08-28 Thread Victor Hooi
erverStatus(). The logging and reporting consistency in MongoDB is...quirky, shall we say. Cheers, Victor On Friday, 28 August 2015 16:15:21 UTC+10, Jussi Piitulainen wrote: > Ben Finney writes: > > > Victor Hooi writes: > [- -] > >> For example: > >> > >>

Re: Casting to a "number" (both int and float)?

2015-08-27 Thread Victor Hooi
numbers or strings (although strings would not be wrapped in floatApprox). On Friday, 28 August 2015 14:58:01 UTC+10, Victor Hooi wrote: > I'm reading JSON output from an input file, and extracting values. > > Many of the fields are meant to be numerical, however, some fi

Casting to a "number" (both int and float)?

2015-08-27 Thread Victor Hooi
I'm reading JSON output from an input file, and extracting values. Many of the fields are meant to be numerical, however, some fields are wrapped in a "floatApprox" dict, which messed with my parsing. For example: { "hostname": "example.com", "version": "3.0.5", "pid": { "fl

Storing dictionary locations as a string and using eval - alternatives?

2015-08-19 Thread Victor Hooi
end(add_point(key, eval(value), timestamp, tags)) # client.write_points(json_points) else: print("non matching line") >>>>>>>>>>>>>>>>>>>>>>> My question is - I'm using "eval" in the above, with the nested location (e.g. "server_status_json['mem']['resident']") stored as a string. I get the feeling this isn't particularly idiomatic or a great way of doing it - and would be keen to hear alternative suggestions? Thanks, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Split on multiple delimiters, and also treat consecutive delimiters as a single delimiter?

2015-07-28 Thread Victor Hooi
On Tuesday, 28 July 2015 23:59:11 UTC+10, m wrote: > W dniu 28.07.2015 o 15:55, Victor Hooi pisze: > > I know the regex library also has a split, unfortunately, that does not > > collapse consecutive whitespace: > > > > In [19]: re.split(' |', f) > >

Split on multiple delimiters, and also treat consecutive delimiters as a single delimiter?

2015-07-28 Thread Victor Hooi
I have a line that looks like this: 14 *0330 *0 760 411|0 0 770g 1544g 117g 1414 computedshopcartdb:103.5% 0 30|0 0|119m97m 1538 ComputedCartRS PRI 09:40:26 I'd like to split this line on multiple separators - in this case, consec

Creating JSON from iostat lines ; Adding timezone information to naive datetimes?

2015-07-02 Thread Victor Hooi
I just want to run some things past you guys, to make sure I'm doing it right. I'm using Python to parse disk metrics out of iostat output. The device lines look like this: Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util sda

Re: Parsing logfile with multi-line loglines, separated by timestamp?

2015-06-30 Thread Victor Hooi
t(line)) elif i == 1 or i == 2: print("system stats: {}".format(line)) elif i >= 4: print("disk stats: {}".format(line)) Is there a prettier or more Pythonic way of doing this? Thanks, Victor On Wednesday, 1 July 2015 02:03:0

Parsing logfile with multi-line loglines, separated by timestamp?

2015-06-30 Thread Victor Hooi
Pythonic way of parsing the above iostat output, and break it into chunks split by the timestamp? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Using csv DictWriter - add a extra field

2015-03-31 Thread Victor Hooi
ainly because of http://bugs.python.org/issue6641). So if I understand correctly, I can just use ChainMap to join any arbitrary number of dicts together - it seems like the right solution here. Are there any drawbacks to using ChainMap here? (Aside from needing Python 3.x). Cheers, Victor --

Using csv DictWriter - add a extra field

2015-03-30 Thread Victor Hooi
.writerow(values, {'connection_id': connection}) else: pass # DO SOME STUFF The only problem is, I'd also like output the connection_id field as part of each CSV record. However, connection_id in this case is the key for the parent dict. Is there a clean way to add a extra field to DictWriter writerows, or it is the contents of the dict and that's it? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Deep comparison of dicts - cmp() versus ==?

2015-03-19 Thread Victor Hooi
just noticed this which actually prints out diff-style comparisons: https://pypi.python.org/pypi/datadiff Cheers, Victor On Friday, 20 March 2015 13:33:52 UTC+11, Ben Finney wrote: > Victor Hooi writes: > > > What is the currently most Pythonic way for doing deep comparisons > >

Deep comparison of dicts - cmp() versus ==?

2015-03-19 Thread Victor Hooi
;bob jones', 'age': 4, 'hobbies': ['hockey', 'tennis']}, 'james': { 'full_name': 'james joyce', 'age': 5, 'hobbies': []} } Previously, I though you could do a cmp(): cmp(a, b) However, thi

Re: function inclusion problem

2015-02-11 Thread Victor L
Laura, thanks for the answer - it works. Is there some equivalent of "include" to expose every function in that script? Thanks again, -V On Tue, Feb 10, 2015 at 7:16 PM, Laura Creighton wrote: > In a message of Wed, 11 Feb 2015 01:06:00 +0100, Laura Creighton writes: > >In a message of Tue, 10 F

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-11 Thread Victor Stinner
pika. I read "Pika Python AMQP Client Library". You may take a look at https://github.com/dzen/aioamqp if you would like to play with asyncio. > With those ones ported switching to Python 3 *right now* is not only > possible and relatively easy, but also convenient. Victor --

Re: [python-committers] [RELEASE] Python 3.4.2rc1 is now available

2014-09-22 Thread Victor Stinner
Someone broke test_pydoc. Example: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%203.4/builds/481/steps/test/logs/stdio Victor 2014-09-22 16:15 GMT+02:00 Larry Hastings : > > > On behalf of the Python development community and the Python 3.4 release > team, I&

Re: [python-committers] [RELEASED] Python 3.4.1

2014-05-19 Thread Victor Stinner
It's not easy to find the changelog. I found this page: https://docs.python.org/3.4/whatsnew/changelog.html Victor 2014-05-19 8:00 GMT+02:00 Larry Hastings : > > > On behalf of the Python development community and the Python 3.4 release > team, I'm pleased to announce the

datetime

2014-03-26 Thread Victor Engle
I want to keep a collection of data organized by collection date and I'll use datetime like this... >>> datetime.date.today() datetime.date(2014, 3, 26) I'll format the date and create directories like /mydata/-mm-dd When I create a directory for today, I need to know the directory name f

Python developer salary survey - results

2014-03-24 Thread victor . olex
PyStreet's February salary survey attracted respondents from 37 countries. Median annual salary in the U.S.: $95,000 Median annual salary worldwide: $50,000 Complete study: http://bit.ly/1dgCw3p -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [RELEASED] Python 3.4.0 release candidate 1

2014-02-11 Thread Victor Stinner
Hi, It would be nice to give also the link to the whole changelog in your emails and on the website: http://docs.python.org/3.4/whatsnew/changelog.html Congrats for your RC1 release :-) It's always hard to make developers stop addings "new minor" changes before the final vers

Re: Python and PEP8 - Recommendations on breaking up long lines?

2013-11-27 Thread Victor Hooi
h.join(root, file)[:-3] not in previously_processed_files: In this case, the 80-character mark is actually partway through "previously processed files" (the first occurrence)... Cheers, Victor On Thursday, 28 November 2013 12:57:13 UTC+11, Victor Hooi wrote: > Hi, > > > > I'm running p

Python and PEP8 - Recommendations on breaking up long lines?

2013-11-27 Thread Victor Hooi
t I can't seem to put in line-breaks inside the comment without triggering a warning. For example, trying to put in another empty line in between lines 6 and 7 above causes a warning. Also, how would I split up the long URLs? Breaking it up makes it annoying to use the URL. Thoughts? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Python String Formatting - passing both a dict and string to .format()

2013-11-26 Thread Victor Hooi
at(my_dict, foo) "ernie lorem ipsum spot" I'm curious - why does this work? Why don't the dictionary keys need quotes around them, like when you normally access a dict's elements? Also, is this the best practice to pass both a dict and string to .format()? Or is there another way that avoids needing to use positional indices? ({0}, {1} etc.) Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Understanding relative imports in package - and running pytest with relative imports?

2013-11-24 Thread Victor Hooi
(Above is just an extract). Assuming I use pytest, where should my tests be in the directory structure, and how should I be running them? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Using try-catch to handle multiple possible file types?

2013-11-19 Thread Victor Hooi
quot;, from Unix, last modified: Wed Nov 20 10:48:35 2013 I suppose it's enough to just do a? if "gzip compressed data" in results: or is there a better way? Cheers, Victor On Tuesday, 19 November 2013 20:36:47 UTC+11, Mark Lawrence wrote: > On 19/11/2013 07:13, Victor Hoo

Using try-catch to handle multiple possible file types?

2013-11-18 Thread Victor Hooi
which wraps libmagic, or I can just rely on file extensions). Other thoughts? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread Victor Stinner
Why do you need to force the UTF-8 encoding? Your locale is not correctly configured? It's better to set PYTHONIOENCODING rather than replacing sys.stdout/stderr at runtime. There is an open issue to add a TextIOWrapper.set_encoding() method: http://bugs.python.org/issue15216 Victor --

Where to handle try-except - close to the statement, or in outer loop?

2013-11-11 Thread Victor Hooi
xception? Can anybody recommend any good examples that show current best practices for exception handling, for programs with moderate complexity? (i.e. anything more than the examples in the tutorial, basically). Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [RELEASE] Python 2.7.6

2013-11-10 Thread Victor Stinner
udo-random number generator after fork. A pthread_atfork() parent handler is used to seed the PRNG with pid, time and some stack data. Is this changeset in Python 2.7.6 or not? Victor -- https://mail.python.org/mailman/listinfo/python-list

Compiling Python 3.3.2 on CentOS 6.4 - unable to find compiled OpenSSL?

2013-11-04 Thread Victor Hooi
ild/scripts-3.3/pyvenv-3.3 I also tried editing the Modules/Setup.dist file, no luck there either. Any thoughts on what we're doing wrong? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: ValueError: zero length field name in format - Running under Python 2.7.3?

2013-11-04 Thread Victor Hooi
d Hat 4.4.6-4)] $ sudo python sync_bexdb.py [sudo] password for victor: 2.6.6 (r266:84292, Jul 10 2013, 22:48:45) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] Cheers, Victor On Tuesday, 5 November 2013 10:02:50 UTC+11, Chris Angelico wrote: > On Tue, Nov 5, 2013 at 9:33 AM, Victor Hooi wrote: >

ValueError: zero length field name in format - Running under Python 2.7.3?

2013-11-04 Thread Victor Hooi
x27;.format(datetime.now().strftime('%Y-%d-%m_%H.%M.%S')) >>> print(LOG_FILENAME) my_project_2013-05-11_09.29.47.log My understanding was that in Python 2.7/3.1, you could omit the positional specifiers in a format string. Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Try-except for flow control in reading Sqlite

2013-10-31 Thread Victor Hooi
table as Burak Aslan suggested? Cheers, victor On Tuesday, 29 October 2013 10:43:19 UTC+11, Dennis Lee Bieber wrote: > On Sun, 27 Oct 2013 20:43:07 -0700 (PDT), Victor Hooi > > declaimed the following: > > > > >Hi, > > > > > >I'd like to double-

Sharing common code between multiple scripts?

2013-10-29 Thread Victor Hooi
.debug('Compressed to %s GZIP file.' % humansize(os.path.getsize(self.gzip_filename))) How could I share this? Mixins? Or is there something better? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Using "with open(filename, 'ab'):" and calling code only if the file is new?

2013-10-29 Thread Victor Hooi
ring results in something like SQLite, or MongoDB and outputting a CSV directly from there. Cheers, Victor On Wednesday, 30 October 2013 13:55:53 UTC+11, Joseph L. Casale wrote: > > Like Victor says, that opens him up to race conditions. > > > > Slim chance, it's no more poss

Using "with open(filename, 'ab'):" and calling code only if the file is new?

2013-10-29 Thread Victor Hooi
I'm guessing I can't use try-except with IOError, since the open(..., 'ab') will work whether the file exists or not. Is there another way I can execute code only if the file is new? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Using urlparse.parse_qs() - first element in dict is keyed on URL+key, instead of just key?

2013-10-29 Thread Victor Hooi
l&utm_campaign=ba^Cn=HC' In [40]: urlparse.parse_qs(urlparse.urlparse(url).query) Out[40]: {'utm_campaign': ['ba^Cn=HC'], 'utm_medium': ['email'], 'utm_source': ['foo1043c']} Chee

Using urlparse.parse_qs() - first element in dict is keyed on URL+key, instead of just key?

2013-10-29 Thread Victor Hooi
43c'], 'utm_campaign': ['ba^Cn=HC'], 'utm_medium': ['email']} For some reason - the utm_source doesn't appear to have been extracted correctly, and it's keying the result on the url plus utm_source, rather than just 'utm_source'? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Organising packages/modules - importing functions from a common.py in a separate directory?

2013-10-29 Thread Victor Hooi
call modules from other modules within the package? Cheers, Victor On Tuesday, 29 October 2013 18:44:47 UTC+11, Peter Otten wrote: > Victor Hooi wrote: > > > > > Hi, > > > > > > Hmm, this post on SO seems to suggest that importing from another s

Re: Organising packages/modules - importing functions from a common.py in a separate directory?

2013-10-29 Thread Victor Hooi
I can structure my code so that I can run the sync_em.py and sync_pg.py scripts, and they can pull common functions from somewhere? Cheers, Victor On Tuesday, 29 October 2013 12:08:10 UTC+11, Victor Hooi wrote: > Hi, > > > > If I try to use: > > > > from .common.com

Re: Organising packages/modules - importing functions from a common.py in a separate directory?

2013-10-28 Thread Victor Hooi
t from the "foo_loading/em_load" directory? I thought I could just refer to the full path, and it'd find it, but evidently not...hmm. Cheers, Victor On Tuesday, 29 October 2013 12:01:03 UTC+11, Ben Finney wrote: > Victor Hooi writes: > > > > > Ok, so I sho

  1   2   3   4   5   6   7   8   >