Python vlc bindings outputting errors












0















I made a terminal application with a spiffy GUI. now I'm trying to play videos from this applications using the python vlc bindings. The problem is that when i try all the errors dump out into the terminal, completely ruining the interface.



Is there any way to hide the errors that VLC output using it bindings?



The code that launches VLC is as follows:



inst = vlc.Instance('-q')
media = inst.media_new(vidUrl)
player = inst.media_player_new(vidUrl)
player.play()


There is no way i can resolve the errors, as it's due to the videofiles being streamed, but the server being a little unreliable.










share|improve this question























  • please see stackoverflow.com/questions/5081657/…

    – kraymer
    Apr 17 '15 at 15:42
















0















I made a terminal application with a spiffy GUI. now I'm trying to play videos from this applications using the python vlc bindings. The problem is that when i try all the errors dump out into the terminal, completely ruining the interface.



Is there any way to hide the errors that VLC output using it bindings?



The code that launches VLC is as follows:



inst = vlc.Instance('-q')
media = inst.media_new(vidUrl)
player = inst.media_player_new(vidUrl)
player.play()


There is no way i can resolve the errors, as it's due to the videofiles being streamed, but the server being a little unreliable.










share|improve this question























  • please see stackoverflow.com/questions/5081657/…

    – kraymer
    Apr 17 '15 at 15:42














0












0








0








I made a terminal application with a spiffy GUI. now I'm trying to play videos from this applications using the python vlc bindings. The problem is that when i try all the errors dump out into the terminal, completely ruining the interface.



Is there any way to hide the errors that VLC output using it bindings?



The code that launches VLC is as follows:



inst = vlc.Instance('-q')
media = inst.media_new(vidUrl)
player = inst.media_player_new(vidUrl)
player.play()


There is no way i can resolve the errors, as it's due to the videofiles being streamed, but the server being a little unreliable.










share|improve this question














I made a terminal application with a spiffy GUI. now I'm trying to play videos from this applications using the python vlc bindings. The problem is that when i try all the errors dump out into the terminal, completely ruining the interface.



Is there any way to hide the errors that VLC output using it bindings?



The code that launches VLC is as follows:



inst = vlc.Instance('-q')
media = inst.media_new(vidUrl)
player = inst.media_player_new(vidUrl)
player.play()


There is no way i can resolve the errors, as it's due to the videofiles being streamed, but the server being a little unreliable.







python vlc






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 3 '13 at 19:29









Delusional LogicDelusional Logic

536625




536625













  • please see stackoverflow.com/questions/5081657/…

    – kraymer
    Apr 17 '15 at 15:42



















  • please see stackoverflow.com/questions/5081657/…

    – kraymer
    Apr 17 '15 at 15:42

















please see stackoverflow.com/questions/5081657/…

– kraymer
Apr 17 '15 at 15:42





please see stackoverflow.com/questions/5081657/…

– kraymer
Apr 17 '15 at 15:42












1 Answer
1






active

oldest

votes


















0














This will suppress your python errors from being printed into the terminal. Make sure you wrap it around only the parts you don't want stuff to print.



import sys
class NullOutput():
def write(self, s):
pass #Don't do anything

def shutup():
orig = sys.stdout #Save original output
sys.stdout = NullOutput() #set standard output to nothing
return orig

def talk(orig):
sys.stdout = orig #Reset standard output


orig = shutup()
dostuff()
talk()





share|improve this answer


























  • I tried this, i even tried doing the same with STDERR. the vlc binding seems to ignore it, it might be because it's based on ctypes, and it doesn't block.

    – Delusional Logic
    Aug 3 '13 at 21:15













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18036468%2fpython-vlc-bindings-outputting-errors%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This will suppress your python errors from being printed into the terminal. Make sure you wrap it around only the parts you don't want stuff to print.



import sys
class NullOutput():
def write(self, s):
pass #Don't do anything

def shutup():
orig = sys.stdout #Save original output
sys.stdout = NullOutput() #set standard output to nothing
return orig

def talk(orig):
sys.stdout = orig #Reset standard output


orig = shutup()
dostuff()
talk()





share|improve this answer


























  • I tried this, i even tried doing the same with STDERR. the vlc binding seems to ignore it, it might be because it's based on ctypes, and it doesn't block.

    – Delusional Logic
    Aug 3 '13 at 21:15


















0














This will suppress your python errors from being printed into the terminal. Make sure you wrap it around only the parts you don't want stuff to print.



import sys
class NullOutput():
def write(self, s):
pass #Don't do anything

def shutup():
orig = sys.stdout #Save original output
sys.stdout = NullOutput() #set standard output to nothing
return orig

def talk(orig):
sys.stdout = orig #Reset standard output


orig = shutup()
dostuff()
talk()





share|improve this answer


























  • I tried this, i even tried doing the same with STDERR. the vlc binding seems to ignore it, it might be because it's based on ctypes, and it doesn't block.

    – Delusional Logic
    Aug 3 '13 at 21:15
















0












0








0







This will suppress your python errors from being printed into the terminal. Make sure you wrap it around only the parts you don't want stuff to print.



import sys
class NullOutput():
def write(self, s):
pass #Don't do anything

def shutup():
orig = sys.stdout #Save original output
sys.stdout = NullOutput() #set standard output to nothing
return orig

def talk(orig):
sys.stdout = orig #Reset standard output


orig = shutup()
dostuff()
talk()





share|improve this answer















This will suppress your python errors from being printed into the terminal. Make sure you wrap it around only the parts you don't want stuff to print.



import sys
class NullOutput():
def write(self, s):
pass #Don't do anything

def shutup():
orig = sys.stdout #Save original output
sys.stdout = NullOutput() #set standard output to nothing
return orig

def talk(orig):
sys.stdout = orig #Reset standard output


orig = shutup()
dostuff()
talk()






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 18 '18 at 14:08









algorytmus

3711623




3711623










answered Aug 3 '13 at 20:50









sihrcsihrc

1,86821136




1,86821136













  • I tried this, i even tried doing the same with STDERR. the vlc binding seems to ignore it, it might be because it's based on ctypes, and it doesn't block.

    – Delusional Logic
    Aug 3 '13 at 21:15





















  • I tried this, i even tried doing the same with STDERR. the vlc binding seems to ignore it, it might be because it's based on ctypes, and it doesn't block.

    – Delusional Logic
    Aug 3 '13 at 21:15



















I tried this, i even tried doing the same with STDERR. the vlc binding seems to ignore it, it might be because it's based on ctypes, and it doesn't block.

– Delusional Logic
Aug 3 '13 at 21:15







I tried this, i even tried doing the same with STDERR. the vlc binding seems to ignore it, it might be because it's based on ctypes, and it doesn't block.

– Delusional Logic
Aug 3 '13 at 21:15




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18036468%2fpython-vlc-bindings-outputting-errors%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()