Re: Classes - "delegation" question.

2014-12-17 Thread dieter
"Ivan Evstegneev" writes: > I have a question about "delegation" coding pattern(I'm working with Python > 3.4). Unlike Java, Python supports "multiple inheritance". This means that you need "delegation" much more rarely in Python. Python does not have much special support for delegation: usually,

Re: Python gethostbyname fails just one one machine.

2014-12-17 Thread Chris Angelico
On Thu, Dec 18, 2014 at 3:26 PM, Abhishek Srivastava wrote: > I was able to resolve the issue. > > since you said that there is nothing wrong with python as such... and its a > networking issue. > > I deleted the network adapter of my vm and then re-created it. > > now suddenly it began to work.

Re: Python gethostbyname fails just one one machine.

2014-12-17 Thread Abhishek Srivastava
I was able to resolve the issue. since you said that there is nothing wrong with python as such... and its a networking issue. I deleted the network adapter of my vm and then re-created it. now suddenly it began to work. funny! -- https://mail.python.org/mailman/listinfo/python-list

Re: Python gethostbyname fails just one one machine.

2014-12-17 Thread Chris Angelico
On Thu, Dec 18, 2014 at 2:21 PM, wrote: > I have many machines on which the following command returns nothing (but does > not throw an error as well > > python -c 'import socket; socket.gethostbyname(socket.getfqdn())' > > > but on just one machine. this command throws > > Traceback (most recent

Python gethostbyname fails just one one machine.

2014-12-17 Thread abhishes
I have many machines on which the following command returns nothing (but does not throw an error as well python -c 'import socket; socket.gethostbyname(socket.getfqdn())' but on just one machine. this command throws Traceback (most recent call last): File "", line 1, in socket.gaierror: [Er

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 9:40:52 PM Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > Juan Christian wrote: > > > I know about the schedule modules and such but they work in situations > > like 'run this in a X hours/minutes/seconds interval', I already have my > > code in a while loop

Please help - Python role in Emeryville, CA - Full-time - $100K+

2014-12-17 Thread Jared E. Cardon
Hi, I found your Python group on Google+ and I'm searching for someone with 3+ years of Python development experience for a full-time position in California. Salary north of $100K and working for an amazing company. Ideally I'd like to find someone who is nice, plugged into the movie and comi

Re: Is there a way to schedule my script?

2014-12-17 Thread Steven D'Aprano
Juan Christian wrote: > I know about the schedule modules and such but they work in situations > like 'run this in a X hours/minutes/seconds interval', I already have my > code in a while loop with sleep (it's a bit ugly, I'l change to a > scheduler soon). [...] > I want my script to start at a g

Re: Is there a way to schedule my script?

2014-12-17 Thread Chris Cioffi
Hi Juan, I don't know what platform you're on, but you've got several options. Mac: setup a launchd job, I use http://www.soma-zone.com/LaunchControl/ to do the setups Linux/unix: setup a cron job, depending on your distro launchd may also be an option. Windows: setup a scheduled job in

Re: smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread Chris Angelico
On Thu, Dec 18, 2014 at 7:59 AM, Michael Ströder wrote: > You should really think about why these chars were excluded in the > configuration: The reason is that those they are special in shells. > > And many SMTP deployments have pretty naive (shell) scripts or software with > shell exits. So allo

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 7:35:10 PM Chris Angelico wrote: time.time() % 86400 That's number of seconds since midnight UTC, ranging from 0 up to 86399. (I've no idea what 64562 would mean. That's an awfully big number for a single day.) If you offset that before calculating, you can get that in

Re: Is there a way to schedule my script?

2014-12-17 Thread Chris Angelico
On Thu, Dec 18, 2014 at 7:42 AM, Juan Christian wrote: > Is there any kind of time calculation in Python that counts the time like 0, > 1, 2, 3... so that 0AM would be 0, and 11:59PM would be let's say > '64562'? And everyday it gets a reset when the clock 'turns'? time.time() % 86400 That's

Re: smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread Michael Ströder
Radomir Wojcik wrote: > No need to do more troubleshooting, need to update the config. Found that > exim default config denies these so nothing to do with smptlib indeed: > > What this statement is doing is to accept unconditionally all recipients in > messages that are submitted by SMTP from lo

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 6:25:39 PM John Gordon wrote: If you want to solve your problem entirely within Python, look at the "scheduler" module. (Although even this isn't a complete solution, as you still have to make sure the program is running in the first place...) My script is running fine, Win

Re: Is there a way to schedule my script?

2014-12-17 Thread John Gordon
In Juan Christian writes: > The standard system "kill" command would probably work for this purpose, > assuming you have access to your main program's process ID. > There isn't any 'prettier' way? Such as a built-in or third-party module > for something common like that? If you're on Unix, 'k

Re: Simple background sound effect playback

2014-12-17 Thread Jacob Kruger
Ok, trying simple code from a pygame tutorial snippet - nothing happens - just silent, but with no errors being returned: # play a sound to the left, to the right and to the center # import the time standard module import time # import the pygame module import pygame # start pygame pygame.ini

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
Ops, sorry. It's: 9:00 AM ~ 11:59 PM -> Running ... and not 9:00 AM ~ 11:50 PM -> Running -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 5:45:31 PM John Gordon wrote: You could write a separate program whose only job is to send a STOP or CONTINUE signal to your main program, and then run that program from a scheduler. The standard system "kill" command would probably work for this purpose, assuming you have a

[ANN]: distlib 0.2.0 released on PyPI

2014-12-17 Thread Vinay Sajip
I've just released version 0.2.0 of distlib on PyPI [1]. For newcomers, distlib is a library of packaging functionality which is intended to be usable as the basis for third-party packaging tools. The main changes in this release are as follows: Updated match_hostname to use the latest Python

Re: Is there a way to schedule my script?

2014-12-17 Thread John Gordon
In Juan Christian writes: > --047d7b874b2c1e67eb050a6e3cc4 > Content-Type: text/plain; charset=UTF-8 > I know about the schedule modules and such but they work in situations like > 'run this in a X hours/minutes/seconds interval', I already have my code in > a while loop with sleep (it's a bit

Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
I know about the schedule modules and such but they work in situations like 'run this in a X hours/minutes/seconds interval', I already have my code in a while loop with sleep (it's a bit ugly, I'l change to a scheduler soon). What I really want is, for example: 24/7/365 9:00 AM -> Start 11:59 PM

Re: smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread Radomir Wojcik
Its all in here for those using exim4 http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_default_configuration_file.html I went into /etc/exim4 and ran this command to find where the deny message is stored, which lead me to the regex variable CHECK_RCPT_LOCAL_LOCALPARTS. So I searc

Re: smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread Radomir Wojcik
No need to do more troubleshooting, need to update the config. Found that exim default config denies these so nothing to do with smptlib indeed: What this statement is doing is to accept unconditionally all recipients in messages that are submitted by SMTP from local processes using the standard

Re: smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread Radomir Wojcik
thanks i'll try that, I can also telnet on the server and see what I get if I use that recipient. I'm using exim, not sure why it would have that restriction -- https://mail.python.org/mailman/listinfo/python-list

Re: smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread Radomir Wojcik
thanks i'll try that, I can also telnet on the server and see what I get if I use that recipient. I'm using exim, not sure why it would have that restriction -- https://mail.python.org/mailman/listinfo/python-list

signal.signal handler arity check - PEP?

2014-12-17 Thread Mike Pomraning
It strikes me as oddly dangerous that signal.signal() accepts callable handlers of the wrong arity: def timeout_cleanup(): ... signal.signal(signal.SIGALRM, timeout_cleanup) # I desire a TypeError here signal.alarm(PROCESS_TIMEOUT) ... time passes ... TypeError

Re: smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread Ervin Hegedüs
Hi, On Wed, Dec 17, 2014 at 08:16:23AM -0800, radzh...@gmail.com wrote: > smtplib.SMTPRecipientsRefused: {'aahlin!@gmail.com': (550, 'restricted > characters in address')} > > As in this question, the answer has reference to RFCs that spec it out, and > state that exclamations are ok, so why is

Re: xml SAX Parsing in python

2014-12-17 Thread Ian Kelly
On Tue, Dec 16, 2014 at 11:30 PM, Abubakar Roko wrote: > > Good day, > > Please I am new in using python to write program. I am trying to parse an XML document using sax parse and store the parsed result in a tree like defined > below. XNode class define an xml element which has an ID , a tag, a

smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread radzhome
smtplib.SMTPRecipientsRefused: {'aahlin!@gmail.com': (550, 'restricted characters in address')} As in this question, the answer has reference to RFCs that spec it out, and state that exclamations are ok, so why is smptplib throwint this error? http://stackoverflow.com/questions/2049502/what-cha

Classes - "delegation" question.

2014-12-17 Thread Ivan Evstegneev
Hello guys, I have a question about "delegation" coding pattern(I'm working with Python 3.4). In order to describe my question , I'll provide particular example: Let assume I have two classes written in module named person.py: Case 1: class Person: def __init__(self, name, job = None,

Re: uWSGI, nGinx, and python on Wheezy: how do you configure it?

2014-12-17 Thread Veek M
Dumped uwsgi - the documentation is utterly ridculous!! Switched to 'Bottle' - very nice, intutive and clean - tutorial+documentation is excellent and i got 'hello world' up and running in like 10-15 minutes vs the 2 days intermittent it took to scroll through the crap that is uwsgi-server. It

Re: xml SAX Parsing in python

2014-12-17 Thread Stefan Behnel
Hi, Abubakar Roko schrieb am 17.12.2014 um 07:30: > Please I am new in using python to write program. I am trying to parse an XML > document using sax parse and store the parsed result in a tree like > definedbelow. XNode class define an xml element which has an ID , a tag, a > text value, chi

how can i get the file on my local pc from vps ip with paramiko or by some other way?

2014-12-17 Thread pengsir
I have an vps ,my local pc is in the local area network. When paramiko installed on my local pc ,i can get file from my vps. import paramiko t = paramiko.Transport(("vps ip",22)) t.connect(username = "username", password = "key") sftp = paramiko.SFTPClient.from_transport(t) remotepath='/tmp/test