Okay, so what I want my program to do it open a file, a music file in
specific, and for this we will say it is an .mp3. Well, I am using the
system() command from the os class. The problem I am running into is that
when I send the path of the file to the system() command, which for those of
you wh
Gerhard Häring wrote:
>
> Alexnb wrote:
>> Okay, so what I want my program to do it open a file, a music file in
>> specific, and for this we will say it is an .mp3. Well, I am using the
>> system() command from the os class. [...]
>>
>> system("\&qu
Hey thanks!, both the raw and the double backslashes worked. You are a
gentleman and a scholar.
Mike Driscoll wrote:
>
> On Jun 10, 11:45 am, Alexnb <[EMAIL PROTECTED]> wrote:
>> Gerhard Häring wrote:
>>
>> > Alexnb wrote:
>> >> Okay, so what I
to make that work
or better yet, how to take a regular string that is given and make every
single "\" into a double "\\"?
Mike Driscoll wrote:
>
> On Jun 10, 11:45 am, Alexnb <[EMAIL PROTECTED]> wrote:
>> Gerhard Häring wrote:
>>
>> > Alexnb wrote:
(r"%s"%variable)
>
> --
> From: "Alexnb" <[EMAIL PROTECTED]>
> Sent: Tuesday, June 10, 2008 7:05 PM
> To:
> Subject: Re: problems with opening files due to file's path
>
>>
>> Well, now i
his is what you are talking about. If you were referring to
> passing in arguments, than you'll want to use the subprocess module
> instead.
>
>
>>
>> --
>> From: "Alexnb" <[EMAIL PROTECTED]>
>> Sent: Tuesday, June 10, 2008 7:05 PM
>> To:
r a number next
to the backslash "\" in the file path. I am looking for a way to make it
work with a variable, I can make it work when I physically type it in, but
not with a variable that holds the path.
Mike Driscoll wrote:
>
> On Jun 10, 1:57 pm, Alexnb <[EMAIL PROTECTED]>
;m Yours (Single)\\01 - I'm
>>> Yours.wma")
It works out fine because I can make each backslash doubles so it doesn't
mess stuff up. So if I could take the path varible and make ever "\" into a
"\\" then it would also work.
Did I clarify?
Grant Edwar
I don't think you understand it doesn't matter how the variable gets there,
the same code is run regardless, I have no problem with the GUI, but you
asked, and so I told you. the code os.startfile( is run if there is a
GUI or it is a console app.
Carsten Haese-2 wrote:
>
&
Okay, so as a response to all of you, I will be using the Entry() widget in
Tkinter to get this path. and the repr() function just makes all my
backslashes 4 instead of just 1, and it still screwes it up with the numbers
and parenthesis is has been since the first post. Oh and I know all about
esc
tartfile(path)
this is very simplified, but that is the idea, and basically exactly what
will happen, just if the path has some of those characters that conflict
with the \.
Carsten Haese-2 wrote:
>
> Alexnb wrote:
>> Okay, so as a response to all of you, I will be using the Entry(
. Thats it, I'll
write some code of what it should work like, because I probably should have
done that; but you don't have to act like I am retarded... that solves
nothing.
Grant Edwards wrote:
>
> On 2008-06-11, Alexnb <[EMAIL PROTECTED]> wrote:
>
>> Okay, so as a re
in the entry box"
self.buttonClick()
root = Tk()
myapp = myApp(root)
root.mainloop()
[code]
Alexnb wrote:
>
> I don't get why yall are being so rude about this. My problem is this; the
> path, as a variable conflicts with other characters in the path,
d, Jun 11, 2008 at 4:16 PM, Alexnb <[EMAIL PROTECTED]> wrote:
>>
>> I posted the underlying code, but I haven't made the GUI code because if
>> I
>> can't get the underlying code right it doesn't matter, well in my eyes it
>> doesn't but I am probably
Haha, okay well sorry that I was being so stupid, but I get it now and I
apoligize for causing you all the frustration. But I did get it to work
finally.
Carsten Haese-2 wrote:
>
> Alexnb wrote:
>> I don't get why yall are being so rude about this.
>
> We're f
I am wondering what is the best way to create a timer, like an alarm, once it
reaches a time, it triggers an event. I have a way of doing this but it
seems like it isn't good at all. If it helps at all I am using a Tkinter,
but that probably doesn't mean much. The way I was doing it was using a
wh
So i have a mac and pc, and just found out that os.startfile() doesn't work
on a mac. So is there anything like that besides os.system()?
--
View this message in context:
http://www.nabble.com/os.startfile%28%29-on-a-mac-tp17829335p17829335.html
Sent from the Python - python-list mailing list a
I have never used the urllib or the urllib2. I really have looked online for
help on this issue, and mailing lists, but I can't figure out my problem
because people haven't been helping me, which is why I am here! :]. Okay, so
basically I want to be able to submit a word to dictionary.com and then
Okay, I tried to follow that, and it is kinda hard. But since you obviously
know what you are doing, where did you learn this? Or where can I learn
this?
Maric Michaud wrote:
>
> Le Friday 27 June 2008 10:43:06 Alexnb, vous avez écrit :
>> I have never used the urllib or the urlli
is pretty straightforward
> once you've used it a few times. Some of the class naming and whatnot
> takes a bit of getting used to (I found that to be the most confusing
> bit).
>
> On Jun 27, 1:41 pm, Alexnb <[EMAIL PROTECTED]> wrote:
>> Okay, I tried to follow t
s naming and whatnot
> takes a bit of getting used to (I found that to be the most confusing
> bit).
>
> On Jun 27, 1:41 pm, Alexnb <[EMAIL PROTECTED]> wrote:
>> Okay, I tried to follow that, and it is kinda hard. But since you
>> obviously
>> know what you are
ke. ', u'an
> ornamental fastening for the front of a coat, consisting of a button
> and a loop through which it passes. ', u'a sheath suspended from a
> belt and supporting a scabbard. ', u'a device at the intersection of
> two tracks to permit the wheels a
{'class': 'luna-Ent'}):" Like why the curly braces and
whatnot?
Jeff McNeil-2 wrote:
>
> On Jun 27, 10:26 pm, Alexnb <[EMAIL PROTECTED]> wrote:
>> Okay, so I copied your code(and just so you know I am on a mac right now
>> and
>> i am usin
of the definitions that
worked had them in it in the same format. Any Ideas??!
Jeff McNeil-2 wrote:
>
> On Jun 29, 12:50 pm, Alexnb <[EMAIL PROTECTED]> wrote:
>> No I figured it out. I guess I never knew that you aren't supposed to
>> split a
>> url like "ht
Actually after looking at this, the code is preactically the same, except the
definitions. So what COULD be going wrong here?
Alexnb wrote:
>
> Okay, so i've hit a new snag and can't seem to figure out what is wrong.
> What is happening is the first 4 definitions of the
were in. So what is the deal!?!
>>> soup.findAll('table', {'class': 'luna-Ent'})
[1.easy to understand, deal with, use, etc.: a simple matter;
simple tools.
See there is the first one in the shell, I mean it is there, but the for
loop can't find it. I am
I am not sure what is going on here. Here is the code that is being run:
def getWords(self):
self.n=0
for entry in self.listBuffer:
self.wordList[self.n] = entry.get()
self.n=self.n+1
print self.wordList
This is the "listBuffer" that you see:
sel
well okay, so what can I do?
A.T.Hofkamp-3 wrote:
>
> On 2008-07-02, Alexnb <[EMAIL PROTECTED]> wrote:
>> I have no idea what "list assignment index out of range means?!?!
>
> You are assigning a value to a non-existing list element, as in
>
>>>
taken up.
Terry Reedy wrote:
>
>
>
> Alexnb wrote:
>> I am not sure what is going on here. Here is the code that is being run:
>>
>> def getWords(self):
>> self.n=0
>> for entry in self.listBuffer:
>> self.wordList[sel
Okay this is a simple question I just don't know how. If I have a list, say:
funList = []
and after a while something possible should have been appended to it, but
wasn't. How can I test if that list is empty.
--
View this message in context:
http://www.nabble.com/Testing-for-an-empty-list-tp1
I am writing a program in which there is a textbox and in it the program auto
inputs a series of words, and definitions for each word. I want to make it
formatted nicely to where the word is indented, and the definitions indented
even more. I don't even know how to make the margins work. I have re
Okay, I am not sure if there is a better way of doing this than findAll() but
that is how I am doing it right now. I am making an app that screen scapes
dictionary.com for definitions. However, I would like to have the type of
the word for each definition. For example if def1 and def2 are noun
def
Okay, heres the general idea of the html I have to work with:
noun
verb
Okay, I left off some stuff. But what I need to do is get what is inside
each and then each . But the key is that I need everything in the
EXACT order that it would be in the html. I can
Michiel Overtoom wrote:
>
> Alex wrote...
>>
>>Okay, heres the general idea of the html I have to work with:
>>
>>
>> noun
>>
>>
>>
>>
>> verb
>>
>>
>>
>>
>>
>>Okay, I left off some stuff.
>
> I wish you didn't, or at least provided an URL where I can get the page
> w
Hi All
I am wondering what I can do to turn a python app (.py) into a mac OSX
applicaiton (.app). Just like py2exe does. But I am also wondering since in
your applications folder on macs it usually doesn't have an actual folder
for each app. Rather an icon. so for firefox, you just see the icon.
Python.Arno wrote:
>
>
> On 13 jul 2008, at 00:39, Alexnb wrote:
>
>>
>> Hi All
>>
>> I am wondering what I can do to turn a python app (.py) into a mac OSX
>> applicaiton (.app). Just like py2exe does.
>
> i use these:
> http://undefined.o
Hello internet.
I am wondering, is there a simple way to test for Internet connection? If
not, what is the hard way :p
--
View this message in context:
http://www.nabble.com/Testing-for-Internet-Connection-tp18460572p18460572.html
Sent from the Python - python-list mailing list archive at Nabbl
Ben Finney-2 wrote:
>
> Alexnb <[EMAIL PROTECTED]> writes:
>
>> I am wondering, is there a simple way to test for Internet
>> connection? If not, what is the hard way :p
>
> Refine the question: What do you mean by "internet"? It isn't a si
Troeger Thomas (Ext) wrote:
>
> Alex Marandon wrote:
>> Alexnb wrote:
>>> I am wondering, is there a simple way to test for Internet connection?
>>> If
>>> not, what is the hard way :p
>>
>> Trying to fetch the homepage from a few major web
Alex Marandon-3 wrote:
>
> Alexnb wrote:
>> I am wondering, is there a simple way to test for Internet connection? If
>> not, what is the hard way :p
>
> Trying to fetch the homepage from a few major websites (Yahoo, Google,
> etc.)? If all of them are failing
Okay, I already made this post, but it kinda got lost. So anyway I need to
figure out how to test if the user is able to connect to a specific website.
Last time I got pointed to the urllib2 page, but if I do urlopen() and and
am not connected, the program stops. So I don't know if that was what y
Alexnb wrote:
>
> Okay, I already made this post, but it kinda got lost. So anyway I need to
> figure out how to test if the user is able to connect to a specific
> website. Last time I got pointed to the urllib2 page, but if I do
> urlopen() and and am not connected, the prog
Timothy Grant wrote:
>
> On Tue, Jul 15, 2008 at 3:48 PM, Alexnb <[EMAIL PROTECTED]> wrote:
>
>>
>>
>>
>> Alexnb wrote:
>> >
>> > Okay, I already made this post, but it kinda got lost. So anyway I need
>> to
>> > figure o
Fredrik Lundh wrote:
>
> Alexnb wrote:
>
>> e = ''
>
>> try:
>> ...
>> except HTTPError, e:
>> print e.code
>> except URLError, e:
>> print e.reason
>>
>> if e == '':
>> pri
Hello
I am sure most of you are familiar with py2exe. I am having a bit of a
problem. See the program has a few pictures involved and the .ico it uses
for the windows. However, the pictures are stored in the same directory as
the source, something like: C:\Docs and settings\me\My docs\python\prog
Mike Driscoll wrote:
>
> On Jul 16, 1:37 pm, Alexnb <[EMAIL PROTECTED]> wrote:
>> Hello
>>
>> I am sure most of you are familiar with py2exe. I am having a bit of a
>> problem. See the program has a few pictures involved and the .ico it uses
>> for the
Alexnb wrote:
>
>
>
> Mike Driscoll wrote:
>>
>> On Jul 16, 1:37 pm, Alexnb <[EMAIL PROTECTED]> wrote:
>>> Hello
>>>
>>> I am sure most of you are familiar with py2exe. I am having a bit of a
>>> problem. See the progra
Okay, what I want to do with this code is to got to thesaurus.reference.com
and then search for a word and get the syns for it. Now, I can get the syns,
but they are still in html form and some are hyperlinks. But I can't get the
contents out. I am not that familiar with BeautifulSoup. So if anyon
The trick to this one is that the html looks something like this:
american,
/browse/blue blue
,
/browse/brick brick
, brie, cheddar, cheshire,
/browse/churn churn
,
/browse/cottage cottage
,
/browse/cream cream
, dunlop,
and it goes on
My question is I want everything inside, the conten
Hello
Lets say I have a string:
--a href="/browse/brick"--brick--/a--
The -- needs to be replaced with < or > where applicable.
and I want the "brick" out of that string (the second brick that is). How
can I get just the "brick" out of that string?
--
View this message in context:
http://ww
Alexandr N Zamaraev wrote:
>
s = '--a href="/browse/brick"--brick--/a--'
s
> '--a href="/browse/brick"--brick--/a--'
''.join('<%s>' % l if i % 2 == 1 else l for i, l in
> enumerate(s.split('--')))
> ' /browse/brick brick '
>
> --
> http://mail.python.org/mailman/listinfo/python
Alexandr N Zamaraev wrote:
>
> Alexnb wrote:
>>>>>> s = '--a href="/browse/brick"--brick--/a--'
>>>>>> s
>>> '--a href="/browse/brick"--brick--/a--'
>>>>>> ''.join('<
bearophileHUGS wrote:
>
> On Jul 17, 9:50 am, Alexnb:
>> how can I test to see if the first char of a string is "<"?
>
> I suggest you to try the interactive shell:
>
>>>> "hello"[0]
> 'h'
>>>> "hell
Lets say we have this list:
funlist = ['a', 'b', 'c']
and lets say I do this:
if funlist[4]:
print funlist[4]
I will get the exception "list index out of range"
How can I test if the list item is empty without getting that exception?
--
View this message in context:
http://www.nabble.co
Okay, I have a fix for this problem, but it is messy and I think there might
be a better way. Heres an example:
Lets say I have a string: "My name is alex"
and I have another string "My name is alex, and I like pie".
I want to test to see if just the "My name is alex" part is there. I don't
ca
Lets say I've got a stirng:
blah This is my string blah
I want to get rid of the blah's but keep the "This is my string." I know you
can do this with a for loop, but that is messy and a pain. So does anyone
have any suggestions on how to do this?
--
View this message in context:
http://www.nab
Okay, so lets say you have a list:
funList = [1,2,3,4,5]
and you do:
for x in funList:
print x
this will print 1-5
But I am wondering is there a way to something like this:
funString = "string string string non-string non-string string"
and
for "string" in funString:
print somethi
Ya just an example, to print the numbers 1-5
Fredrik Lundh wrote:
>
> Alexnb wrote:
>
>> But I am wondering is there a way to something like this:
>>
>> funString = "string string string non-string non-string string"
>> and
>> for "string
Basically I want the code to be able to pick out how many strings there are
and then do something with each, or the number. When I say string I mean how
many "strings" are in the string "string string string non-string string"
Does that help?
Fredrik Lundh wrote:
>
&
is after "yes". It is like the yeses are
bullet points and I want all the info after them. However, all in one
string.
Fredrik Lundh wrote:
>
> Alexnb wrote:
>
>> Basically I want the code to be able to pick out how many strings there
>> are
>> and then do so
This is similar to my last post, but a little different. Here is what I would
like to do.
Lets say I have a text file. The contents look like this, only there is A
LOT of the same thing.
() A registry mark given by underwriters (as at Lloyd's) to ships in
first-class condition. Inferior grades
probably won't work, but
that is the Idea.
Also, on a side-note, does anyone know a very simple dictionary site, that
isn't dictionary.com or yourdictionary.com. Or, a free dictionary that I can
download to have an offline reference?
John Machin wrote:
>
> On Aug 19, 6:40 am, Alexnb
? Anyway,
Ideas?
John Machin wrote:
>
> On Aug 19, 8:34 am, Alexnb <[EMAIL PROTECTED]> wrote:
>
>> The number is based on the word(s) they type into my program, and then it
>> fetches the number that word is in the list of words and then will search
>> the definit
Okay, I have used BeautifulSoup a lot lately, but I am wondering, how do you
open a local html file?
Usually I do something like this for a url
soup = BeautifulSoup(urllib.urlopen('http://www.website.com')
but the file extension doesn't work. So how do I open one?
--
View this message in conte
64 matches
Mail list logo