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

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

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

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

Re: [python-committers] [RELEASED] Python 3.4.0a2

2013-09-09 Thread Victor Stinner
: http://docs.python.org/dev/whatsnew/3.4.html Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: [python-committers] [RELEASED] Python 3.4.0a2

2013-09-09 Thread Victor Stinner
2013/9/9 Antoine Pitrou : > Le Mon, 9 Sep 2013 14:30:50 +0200, > Victor Stinner a écrit : >> 2013/9/9 Larry Hastings : >> > Python 3.4 includes a range of improvements of the 3.x series, >> > including hundreds of small improvements and bug fixes. Major new >&g

Using "with" context handler, and catching specific exception?

2013-10-21 Thread Victor Hooi
rite("hello there") except IOError as e: logger.error("Uhoh, the file wasn't there"). Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Using "with" context handler, and catching specific exception?

2013-10-21 Thread Victor Hooi
ept FileNotFoundError as e: logger.error("Uhoh, the file wasn't there - %s" % e) Cheers, Victor On Tuesday, 22 October 2013 14:04:14 UTC+11, Ben Finney wrote: > Victor Hooi writes: > > > > > try: > > > wi

Re: Using "with" context handler, and catching specific exception?

2013-10-22 Thread Victor Hooi
and printing the message from there? Cheers, Victor On Tuesday, 22 October 2013 14:53:58 UTC+11, Ben Finney wrote: > Victor Hooi writes: > > > > > Aha, good point about IOError encapsulating other things, I'll use > > > FileNotFoundError, and also add in som

Re-raising a RuntimeError - good practice?

2013-10-23 Thread Victor Hooi
My question is - is the above Pythonic, or an acceptable practice? Or is there another way I should be handling errors, and moving on from failures, and if so what is it please? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Re: Re-raising a RuntimeError - good practice?

2013-10-24 Thread Victor Hooi
catch *everything* logger.error(err) raise that will just re-raise the original exception right? Cheers, Victor On Thursday, 24 October 2013 15:42:53 UTC+11, Andrew Berg wrote: > On 2013.10.23 22:23, Victor Hooi wrote: > > > For example: > > &g

Processing large CSV files - how to maximise throughput?

2013-10-24 Thread Victor Hooi
#x27;m trying to maximise throughput of the above, is there anything I could try? The processing in process_line is quite line - just a bunch of string splits and regexes. If I have multiple large CSV files to deal with, and I'm on a multi-core machine, is there anything else I can do to boost throughput? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

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

2013-10-27 Thread Victor Hooi
e using "../", or is there a better way? Cheers, Victor -- https://mail.python.org/mailman/listinfo/python-list

Try-except for flow control in reading Sqlite

2013-10-27 Thread Victor Hooi
wanted to check if there is a better way of achieving this? I'd also be doing the same thing for checking if a file is gzipped or not - we try to open it as a gzip, then as an ordinary text file, and if that also fails, raise a parsing error. Cheers, Victor -- https://mail.python.org/mai

Re: Try-except for flow control in reading Sqlite

2013-10-28 Thread Victor Hooi
Hi, We're on Python 2.6 (RHEL based system...) - I don't believe this exposes FileNotFoundError =(. Cheers, Victor On Monday, 28 October 2013 17:36:05 UTC+11, Chris Angelico wrote: > On Mon, Oct 28, 2013 at 2:43 PM, Victor Hooi wrote: > > > Is it acceptable to use

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

2013-10-28 Thread Victor Hooi
ommon.bex_common Any thoughts? Cheers, Victor On Tuesday, 29 October 2013 00:12:58 UTC+11, Jean-Michel Pichavant wrote: > - Original Message - > > Hi, > > > > I have a collection of Python scripts I'm using to load various bits > > of data into a database. &

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

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-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

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: 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 "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 "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

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: 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-

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: 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: >

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: [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

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: 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 > >

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: 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 --

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: 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

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

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

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) > >

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

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

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

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: > >> > >>

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

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 {

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

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-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

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

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

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

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&

Spawn a process, then exit, whilst leaving process running?

2013-02-08 Thread Victor Hooi
with their output. Somebody mentioned multiprocessing, however, I'm not sure quite sure how that would work here. What's the most Pythontic way of achieving this purpose? Cheers, Victor -- http://mail.python.org/mailman/listinfo/python-list

Writing Python framework for declarative checks?

2013-03-18 Thread Victor Hooi
for managing deployments, or actually pushing out configurations. These validation scripts are more to ensure that the configuration changes done by hand are sane, or don't violate certain basic rules). Cheers, Victor -- http://mail.python.org/mailman/listinfo/python-list

Doing both regex match and assignment within a If loop?

2013-03-28 Thread Victor Hooi
s there a Pythonic way to tackle this? What I'm trying to avoid is this: if expression1.match(line): results = expression1.match(line) which I assume would call the regex match against the line twice - and when I'm dealing with a huge amount of log lines, slow things d

Using re.VERBOSE, and re-using components of regex?

2013-04-16 Thread Victor Hooi
ot;", re.VERBOSE), } Is there a way to use CONSTANTS (or at least re-use fragments of my regex), and also use re.VERBOSE so I can comment my regex? Cheers, Victor -- http://mail.python.org/mailman/listinfo/python-list

build problems with Python 2.4.3 under Solaris 10

2006-07-28 Thread Victor Ng
How do I enable readline support for Python under Solaris 10?  I've got CSWreadline installed in /opt/csw from blastwave, but I'm not having any luck getting the readline.so module compiled.I'm using: CPPFLAGS="-I/opt/csw/include" LDFLAGS="-L/opt/csw/lib" ./configure --prefix=/opt/python/2.4.3 --en

Re: build problems with Python 2.4.3 under Solaris 10

2006-07-28 Thread Victor Ng
*easy* compared to Solaris. :) vic On 7/28/06, Victor Ng <[EMAIL PROTECTED]> wrote: > > How do I enable readline support for Python under Solaris 10? > > I've got CSWreadline installed in /opt/csw from blastwave, but I'm not having > any luck getting the readli

py.test and HTML output

2006-09-19 Thread Victor Ng
Is there documentation anywhere on how to get py.test to emit nice HTML output like the kind that they have for the PyPy project here: http://codespeak.net/~hpk/pypy-testresult/ ? Should I just redirect the stdout to a StringIO and parse the output and generate the HTML myself? I see that there's

Does only emacs and idle support symbolic debugging?

2006-11-23 Thread Victor Ng
Subject line pretty much says it all - are those the only two editors that support running the symbolic debugger from inside the editor? vic -- "Never attribute to malice that which can be adequately explained by stupidity." - Hanlon's Razor -- http://mail.python.org/mailman/listinfo/python-li

A bug in cPickle?

2007-05-16 Thread Victor Kryukov
Hello list, The following behavior is completely unexpected. Is it a bug or a by- design feature? Regards, Victor. - from pickle import dumps from cPickle import dumps as cdumps print dumps('1001799')==dumps(str(1001799)) print cdumps('1001799')

cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Victor Kryukov
Hello list, I've found the following strange behavior of cPickle. Do you think it's a bug, or is it by design? Best regards, Victor. from pickle import dumps from cPickle import dumps as cdumps print dumps('1001799')==dumps(str(1001799)) print cdumps('1001799')=

Python Web Programming - looking for examples of solid high-traffic sites

2007-05-16 Thread Victor Kryukov
understanding is that Google uses python mostly for internal web-sites, and performance is far from perfect their. YouTube is an interesting example - anybody knows more details about that? Your suggestions and comments are highly welcome! Best Regards, Victor. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-24 Thread Victor Kryukov
Hello list, thanks a lot to everybody for their suggestions. We're yet to make our final decision, and the information you've provided is really helpful. Best, Victor. -- http://mail.python.org/mailman/listinfo/python-list

Re: best GUI library for vector drawing program

2007-08-17 Thread Victor Bazarov
chewie54 wrote: > What would be the best cross-platform GUI library to use for a vector > based CAD program ( something like Visio on Windows ) WxWidgets, > Tk, PyQt, Java Swing, Java SWT, I need the capibility to > draw and edit in a window that looks like a page of paper so WYSIWYG >

No can load a image with gnome-python and canvas

2007-04-14 Thread Victor Roig
Code --> http://pastebin.ca/439954 <-- resume: import gtk import gnomecanvas ... im = GdkImlib.Image("5b.png") w = self.acanvas.root().add('GnomeCanvasImage', image=im, width=70, height=105) ... at execurion time: NameError: global name 'GdkImlib' is not defined and if I probe: .

Regular expressions question

2007-01-16 Thread Victor Polukcht
I have 2 strings: "Global etsi3 *200 ok30 100% 100% Outgoing" and "Global etsi3 * 4 ok 30 100% 100% Outgoing" The difference is "*200" instead of "* 4". Is there ability to write a regular expression that will match both of that strin

Re: Regular expressions question

2007-01-16 Thread Victor Polukcht
Actually, i'm trying to get the values of first field (Global) , fourth (200, 4), and fifth (100%) and sixth (100%). Everything except fourth is simple. On Jan 16, 2:59 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Victor Polukcht" <[EMAIL PROTECTED]> wrote: >

Re: Regular expressions question

2007-01-16 Thread Victor Polukcht
The same regular expression should work for another string (with *200). On Jan 16, 5:40 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-01-16, Victor Polukcht <[EMAIL PROTECTED]> wrote: > > > Actually, i'm trying to get the values of first field (Global) , f

Re: Regular expressions question

2007-01-16 Thread Victor Polukcht
Great thnx. It works. On Jan 16, 6:02 pm, Wolfgang Grafen <[EMAIL PROTECTED]> wrote: > Victor Polukcht wrote: > > I have 2 strings: > > > "Global etsi3 *200 ok30 100% 100% > > Outgoing" > > and > > "Global

One more regular expressions question

2007-01-18 Thread Victor Polukcht
I have a couple of strings like: Unassigned Number (1)32 No Route To Destination (3) 12 Normal call clearing (16) 2654 User busy (17) 630 No user respo

Re: One more regular expressions question

2007-01-18 Thread Victor Polukcht
Thanks in advance. On Jan 18, 1:15 pm, Roberto Bonvallet <[EMAIL PROTECTED]> wrote: > Victor Polukcht wrote: > > My actual problem is i can't get how to include space, comma, slash.Post > > here what you have written already, so we can tell you what the > problem is. >

Re: One more regular expressions question

2007-01-18 Thread Victor Polukcht
Great thanks. You post helped me so much! My resulting regexp is: "(?P^(.*)\s*)\(((?P\d+))\)\s+((?P\d+))" On Jan 18, 2:38 pm, "Daniele Varrazzo" <[EMAIL PROTECTED]> wrote: > Victor Polukcht wrote: > > I have a couple of strin

module check

2007-01-22 Thread Victor Polukcht
Can anybody suggest a correct way of checking in python module exists and correctly installed from python program. -- http://mail.python.org/mailman/listinfo/python-list

Try/Except/Yield/Finally...I'm Lost :-}

2007-11-28 Thread Victor Subervi
o + word + pu_three, line) except: pass which, of course, ends up breaking all the above! Can someone send me a shovel to dig my way out of this mess? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Why Don't Return?

2007-12-03 Thread Victor Subervi
Hi; Here is sample function: def a(): b() print c def b(): c = "Hi" return c if __name__ == "__main__": a() then run a(). Throws error about c not being defined. How do I return c from b? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Don't Return?

2007-12-05 Thread Victor Subervi
Thanks :) On Dec 3, 2007 6:58 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Victor Subervi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | def a(): > | b() > > Here is the error: should be > c = b() > > | print c >

Fill In a Form Automatically

2007-12-07 Thread Victor Subervi
) passman.add_password(None, theurl, username, password) authhandler = urllib2.HTTPBasicAuthHandler(passman) opener = urllib2.build_opener(authhandler) urllib2.install_opener(opener) pagehandle = urllib2.urlopen(protocol + theurl + realm_dir + realm1) pagehandle.close() pagehandle = urllib2.urlopen(p

Re: Fill In a Form Automatically

2007-12-10 Thread Victor Subervi
Thanks! Mechanize looks really cool :)) Victor On Dec 7, 2007 4:11 PM, Ismail Dönmez <[EMAIL PROTECTED]> wrote: > Friday 07 December 2007 22:06:23 tarihinde Victor Subervi şunları > yazmıştı: > > Hi; > > I'm trying to fill in a Zope form automatically. I have this sc

Re: [Plone-Users] Why Can't I Do This?

2007-12-14 Thread Victor Subervi
...but applicable ONLY for that instance. The other solution provided is more universal ;) On Dec 14, 2007 10:41 AM, Encolpe Degoute <[EMAIL PROTECTED]> wrote: > Victor Subervi a écrit : > > Hi; > > Why can't I do this? > > > >>>> author = "

Re: [Plone-Users] Why Can't I Do This?

2007-12-14 Thread Victor Subervi
Great! Thanks! On Dec 14, 2007 10:38 AM, Eric Smith <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > Hi; > > Why can't I do this? > > > > >>> author = "By Juan Garcia" > > >>> if author[0:2] == "by " | &

Re: [Plone-Users] Why Can't I Do This?

2007-12-14 Thread Victor Subervi
whatever[0:2] will yield THREE characters, so my "by " is correct and "by" will fail every time :)) Victor On Dec 14, 2007 12:06 PM, Derek Broughton <[EMAIL PROTECTED]> wrote: > Encolpe Degoute wrote: > > > Derek Broughton a écrit : > >> Victor Sub

Re: [OT] Fractions on musical notation

2007-12-16 Thread Brian Victor
Gabriel Genellina wrote: > On 16 dic, 06:40, Lie <[EMAIL PROTECTED]> wrote: > >> [btw, off topic, in music, isn't 1/4 and 2/8 different? I'm not very >> keen of music though, so correct me if I'm wrong.] > As a time signature 1/4 has no sense Actually, I'm playing a show right now that has a one b

Re: Web frameworks and credit cards

2006-05-24 Thread Victor Ng
Ed, On 5/24/06, Ed Leafe <[EMAIL PROTECTED]> wrote: > I may have an opportunity to develop an online ordering system for a > client, and will have the ability to develop using any tool I choose. > Given the fact that there are more web frameworks in Python than > keywords ;-) , what I need

Re: Web frameworks and credit cards

2006-05-24 Thread Victor Ng
Ed, Its very simple to add credit card processing to your app. I have personally used moneris , worldpay and debitech with no issues. Sometimes you need to do a little ctypes or pyrex but overall - its easy. On 5/24/06, Ed Leafe <[EMAIL PROTECTED]> wrote: > I may have an opportunity to devel

How Does This Static Variable Work?

2008-01-04 Thread Victor Subervi
if last[0] < 0.1: # threshhold terminator return None # end-of-stream flag while abs(last[0]-rand) < 0.4: # look for usable candidate print '*', # display the rejection rand = random.random() # new candidate last[0] = rand # update the "static&q

Re: How Does This Static Variable Work?

2008-01-04 Thread Victor Subervi
Thanks. I'll study that. Victor On Jan 4, 2008 12:34 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On Jan 4, 2008 10:17 AM, Victor Subervi <[EMAIL PROTECTED]> wrote: > > > Hi; > > I read this example somewhere, but I don't understand it <:-) Can >

Unicode Problem

2008-01-28 Thread Victor Subervi
d + '::' + value newLine.append(word) sentences.close() TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Anyone Know Unicode? Help!

2008-01-30 Thread Victor Subervi
ne) for word in tup: for key, value in dictionary.items(): if key == word: word = word + '::' + value newLine.append(word) sentences.close() TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Strange sqlite3 library behavior

2008-02-02 Thread Victor Lin
data would just keep in memory and discarded with the program's ending. Why sqlite3 just keep inserted data in memory? And how to force inserted data into file? Thanks. Victor Lin. -- http://mail.python.org/mailman/listinfo/python-list

Recursion limit of pickle?

2008-02-09 Thread Victor Lin
t stop running program without any message. I think it is also implement with recursion way, and it also over flow stack when dumping soup. Are there any version of pickle that implement with no-recursion way? Thanks. Victor Lin. -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursion limit of pickle?

2008-02-09 Thread Victor Lin
On 2月10日, 上午11時42分, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 09 Feb 2008 09:49:46 -0200, Victor Lin <[EMAIL PROTECTED]> > escribi�: > > > I encounter a problem with pickle. > > I download a html from: > > >http://www.amazon

Problem with import

2008-02-11 Thread Victor Lin
m: If I move my directory, I have to modify the path again. This is not a library, they are some programs to do specific task. I think they should be executable in every where I move or copy the directory to. Victor Lin. -- http://mail.python.org/mailman/listinfo/python-list

How to call python from a foreign language thread (C++)

2009-02-03 Thread Victor Lin
void operator() (double time, const AudioData &data) { // acquire lock m_Function(time, data); // release lock } Thanks. Victor Lin. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call python from a foreign language thread (C++)

2009-02-03 Thread Victor Lin
On 2月4日, 上午2時44分, Philip Semanchuk wrote: > On Feb 3, 2009, at 12:51 PM, Victor Lin wrote: > > > > > It seems that my program can't call to Python's function from thread > > directly, because there is Global Interpreter Lock. The python's GIL > > is

How to debug deadlock?

2009-02-08 Thread Victor Lin
d the program? And how can I know what lock are there in threads caused the deadlock? Thanks. Victor Lin. -- http://mail.python.org/mailman/listinfo/python-list

Can´t Surf Python Pages in Windoze

2008-12-26 Thread Victor Subervi
xml:lang="en"> Yeah """ Also, Zope is installed, but when I go to: localhost:8080/manage_main or local:8080/Zope-Instance/manage_main I get a 404, after having started the service and everything is go. I have Python up. What gives? Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Can´t Surf Python Pages in Windoze

2008-12-26 Thread Victor Subervi
mportation of something CGI, I believe I would have tested that with all the other things that were imported that I tested, but perhaps not. I am not at my home computer to test, and will not be back online for a week. I am not worried about Zope now, but the above code, yes. TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Can´t Surf Python Pages in Windoze

2009-01-02 Thread Victor Subervi
On Fri, Dec 26, 2008 at 8:00 PM, Gabriel Genellina wrote: > En Fri, 26 Dec 2008 15:11:44 -0200, Victor Subervi < > victorsube...@gmail.com> escribió: > >> On 12/26/08, Tino Wildenhain wrote: >> > > print "Content-Type: text/html" >>>> pr

Re: Can´t Surf Python Pages in Windoze

2009-01-06 Thread Victor Subervi
On Fri, Jan 2, 2009 at 4:24 PM, Victor Subervi wrote: > On Fri, Dec 26, 2008 at 8:00 PM, Gabriel Genellina > wrote: > >> En Fri, 26 Dec 2008 15:11:44 -0200, Victor Subervi < >> victorsube...@gmail.com> escribió: >> >>> On 12/26/08, Tino Wildenhain w

Callback from c thread with ctypes

2009-03-08 Thread Victor Lin
allback. As the document says. WINFUNCTYPE will release GIL during the call But it does not mention callback about Python function? How about a call from another thread? Could somebody help me? Thanks. Victor Lin. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   >