Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Using a variable to replace an integer? (Except it isn't working!)
Post: RE: Using a variable to replace an integer? (Excep...

(Jul-25-2017, 06:39 PM)buran Wrote: always post the code, the output and like you did - the full traceback. what was the output fromprint (wid) The print(wid) gave me "2449574" which is the correct...
s1monsays General Coding Help 15 8,410 Jul-25-2017, 06:58 PM
    Thread: Using a variable to replace an integer? (Except it isn't working!)
Post: RE: Using a variable to replace an integer? (Excep...

Tried that as well. New traceback: Error:Traceback (most recent call last):   File "weather.py", line 21, in <module>     loc_weather = client.fetch_weather(wid)   File "/usr/local/lib/python2.7...
s1monsays General Coding Help 15 8,410 Jul-25-2017, 06:09 PM
    Thread: Using a variable to replace an integer? (Except it isn't working!)
Post: RE: Using a variable to replace an integer? (Excep...

Attempt: #note: the url is actually there in the code, but it was preventing me from posting this url = 'freegeoip' try: with closing(urlopen(url)) as response: location = json.loads(...
s1monsays General Coding Help 15 8,410 Jul-25-2017, 07:42 AM
    Thread: Using a variable to replace an integer? (Except it isn't working!)
Post: RE: Using a variable to replace an integer? (Excep...

I'm not sure what you mean by "full attempt". Just like, all of the code I used? Because it's literally the same - that one change. And as for the traceback, I don't get any! It's kind of part of the ...
s1monsays General Coding Help 15 8,410 Jul-25-2017, 07:16 AM
    Thread: Using a variable to replace an integer? (Except it isn't working!)
Post: RE: Using a variable to replace an integer? (Excep...

(Jul-25-2017, 06:55 AM)buran Wrote: I think this loc_weather = client.fetch_weather('wid')should be loc_weather = client.fetch_weather(wid)the docs: https://yweather.readthedocs.io/en/v0.1/...-s-...
s1monsays General Coding Help 15 8,410 Jul-25-2017, 07:00 AM
    Thread: Using a variable to replace an integer? (Except it isn't working!)
Post: RE: Using a variable to replace an integer? (Excep...

I'm basically putting two pieces of code together. The first one (step 1) gets your location based on your ip address. I have it turn the location it gets into variables that I can put into other thin...
s1monsays General Coding Help 15 8,410 Jul-25-2017, 05:42 AM
    Thread: Using a variable to replace an integer? (Except it isn't working!)
Post: RE: Using a variable to replace an integer? (Excep...

I appreciate the response! But unless I'm misunderstanding what you're saying, I don't think that's the problem. Like I said in that note at the top of the code, there is a complete url in the actual ...
s1monsays General Coding Help 15 8,410 Jul-25-2017, 04:34 AM
    Thread: Using a variable to replace an integer? (Except it isn't working!)
Post: Using a variable to replace an integer? (Except it...

So I'm trying to use the yweather module, but replacing the way it goes about getting the woeid with a system of variables so that I can A. use it wherever and not have to input a new woeid, and B. au...
s1monsays General Coding Help 15 8,410 Jul-25-2017, 03:01 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020