[Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
Hello everyone, I have a question regarding PySide 1.2.2 and Python 3.4.1 I have this code that I made following a Python tutorial , mine is a bit different because the tutorial is a bit old, and I'm trying to use Python n

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
ther one... And NOT related to PySide, it's pure Python. The problem is in the 'get_date()' func ( http://pastebin.com/mPhJcXmF) - I get all the text from bankofcanada site but when I reach 'line.strip()' I get an error, "'int' object has no attribute 'st

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
I analyzed the code and found two mistakes: 1. I wrote 'startsWith', and not 'startswith' 2. I forgot to encode, I needed to use '.read().decode("utf-8")' rather than '.read()' only. This way I get the text correctly (http://pastebin.com/qy4SVdzK). I'm still analyzing the code and fixing things,

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
astebin.com/SgVdeKGm 2014-08-30 19:18 GMT-03:00 Juan Christian : > I analyzed the code and found two mistakes: > > 1. I wrote 'startsWith', and not 'startswith' > 2. I forgot to encode, I needed to use '.read().decode("utf-8")' rather > tha

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-31 Thread Juan Christian
I'm changing so much the code that I got lost now. Code so far: http://pastebin.com/u4xwZuyJ I'm getting this error. 'value = float(row[-1])' is getting the values OK, but when I do 'rates[row[0]] = value' it screws things up. === Traceback (most recent call last): File

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-31 Thread Juan Christian
Let's see, the print is just "debug", it's not necessary in the program. 'row[0]' is the first element of the current row. Ex.: row = ['a', 'b', 'c', 'd'] - row[0] would be 'a' 'rates' is a dictionary, 'rates[row[0]]' would update the key row[0] in the dict with the 'value' I think that's it, ri

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-31 Thread Juan Christian
es) to get the values from the dict. I'm reading the doc trying to figure this out. 2014-08-30 23:58 GMT-03:00 Danny Yoo : > On Sat, Aug 30, 2014 at 7:49 PM, Juan Christian > wrote: > > Let's see, the print is just "debug", it's not necessary in the progra

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-31 Thread Juan Christian
Thank you my friend! It was line 48. The 'sorted()' method transformed my dict in a list. I do need this approach to put the keys in a sorted way, but know I do it directly, like 'fromComboBox.addItems(sorted(rates.keys()))' and 'toComboBox.addItems(sorted(rates.keys()))', so that I don't overwrit

[Tutor] Good Text Editor/IDE for Python

2014-08-31 Thread Juan Christian
I've been using PyCharm to code in Python but it seems a bit "overpowered" for this task, and there are some annoying bugs. I used Sublime Text 2 in the past, but it seems to be dead now (last update was JUN/2013), so I don't really know any good options. What do you guys use to code?

Re: [Tutor] Good Text Editor/IDE for Python

2014-08-31 Thread Juan Christian
I'm using Windows, but I do use Linux on a daily basis. On Sunday, August 31, 2014, Steven D'Aprano wrote: > On Sun, Aug 31, 2014 at 09:12:24PM -0300, Juan Christian wrote: > > I've been using PyCharm to code in Python but it seems a bit > "overpowered"

Re: [Tutor] Good Text Editor/IDE for Python

2014-09-01 Thread Juan Christian
Sorry Peter, but you message is blank here. I (and presumedly the others) can't read a thing. On Monday, September 1, 2014, Peter Romfeld wrote: > On Monday, September 01, 2014 08:12 AM, Juan Christian wrote: > > I've been using PyCharm to code in Python but it seems a bit

Re: [Tutor] Good Text Editor/IDE for Python

2014-09-01 Thread Juan Christian
order to code. I'll keep using Sublime Text 3 (maybe ST3 isn't dead as I thought) + cmd.exe for coding, and maybe IDLE if I like and feel comfortable about it. On Mon, Sep 1, 2014 at 1:40 PM, Danny Yoo wrote: > On Sun, Aug 31, 2014 at 5:12 PM, Juan Christian > wrote: > > I&

Re: [Tutor] Good Text Editor/IDE for Python

2014-09-01 Thread Juan Christian
1, 2014 at 3:45 PM, Alan Gauld wrote: > On 01/09/14 19:34, Juan Christian wrote: > > + cmd.exe for coding, >> > > If you are not a cmd.exe regular make sure you read the help page > and enable all the extra features that are turned off by default... > Things like file

Re: [Tutor] Good Text Editor/IDE for Python

2014-09-01 Thread Juan Christian
So guys, I'll be using this one ( https://sublime.wbond.net/packages/SublimeLinter-flake8), why? Because acording to Python Package Index ( https://pypi.python.org/pypi/flake8), this linter uses: 1. PyFlakes 2. pep8 3. Ned Batchelder's McCabe script I don't have a clue what the n3 does, but the

Re: [Tutor] Good Text Editor/IDE for Python

2014-09-01 Thread Juan Christian
Text 3 using Jedi, PyFlakes, pep8, PyLint, pep257 and McCabe that will never freeze your Sublime Text 3. All I want in one place, better than that only if it codes for me. =p On Mon, Sep 1, 2014 at 9:25 PM, Juan Christian wrote: > So guys, I'll be using this one ( > https://sublim

[Tutor] Good approach regarding classes attributes

2014-09-06 Thread Juan Christian
I'm writing a program that have a 'User' class. This class will have the following attributes: 1. id 2. personaname 3. lastlogoff 4. profileurl 5. avatar 6. realname 7. timecreated 8. loccountrycode I'm thinking about writing something like that: http://pastebin.com/7KHB2qQ8 Is it a good approac

Re: [Tutor] Good approach regarding classes attributes

2014-09-06 Thread Juan Christian
Ops, sorry. Pastebin @ line 9: It's [JSON response lastlogoff] On Sun, Sep 7, 2014 at 12:00 AM, Juan Christian wrote: > I'm writing a program that have a 'User' class. This class will have the > following attributes: > > 1. id > 2. personaname > 3. last

Re: [Tutor] Good approach regarding classes attributes

2014-09-07 Thread Juan Christian
On Sun, Sep 7, 2014 at 5:04 AM, Peter Otten <__pete...@web.de> wrote: > > It's not a good approach and it's not pythonic. > > In Python you should avoid accessor functions and (pseudo-)private > __attributes ("Python is not Java"). So > > class User: > def __init__(self, id): > self.id

Re: [Tutor] Good approach regarding classes attributes

2014-09-07 Thread Juan Christian
> > > On Sun, Sep 7, 2014 at 5:04 AM, Peter Otten <__pete...@web.de> wrote: > > > I would call it with ID only and them the API server would return me > > all the info, and then I would set them. I didn't learn '@classmethod' > > decoration yet, but I presume it would work as a 'get()', right? The

Re: [Tutor] Good approach regarding classes attributes

2014-09-07 Thread Juan Christian
So... I tried to follow all what you guys said: user.py module: import urllib.request import json class User(): def __init__(self, steamid, personaname, lastlogoff, profileurl, avatar, timecreated, loccountrycode): self._steamid = steamid self._personaname = personaname self._lastlogoff = lastl

Re: [Tutor] Good approach regarding classes attributes

2014-09-08 Thread Juan Christian
On Mon, Sep 8, 2014 at 5:58 AM, Peter Otten <__pete...@web.de> wrote: > > > Personally I'd use normal attributes, though. > Why normal attributes? Isn't it better to make these read-only as I won't ever need to modify them? And even if I modify them, it won't change in the Steam servers, only in m

Re: [Tutor] Good approach regarding classes attributes

2014-09-08 Thread Juan Christian
> > > On Mon, Sep 8, 2014 at 5:58 AM, Peter Otten <__pete...@web.de> wrote: > > In that spirit here's an alternative implementation of the User class: > > from collections import namedtuple > User = namedtuple( > "User", > "steamid personaname lastlogoff profileurl " > "avatar timecreat

Re: [Tutor] Good approach regarding classes attributes

2014-09-09 Thread Juan Christian
On Mon, Sep 8, 2014 at 5:58 AM, Peter Otten <__pete...@web.de > wrote: > > PS: This is not about being pythonic, but it might be more convenient for > client code if you use datetime objects instead of timestamps: > > >>> import datetime > >>> last_logoff = datetime.datetime.utcfromtimestamp(14100

[Tutor] Convert a list to a group of separated strings

2014-09-11 Thread Juan Christian
Let's say I have the following list: my_list = ['76561198048214059', '76561198065852182', '76561198067017670', '76561198077080978', '76561198077257977', '7656119807971 7745', '76561198088368223', '76561198144945778'] and I have a function with the following signature: def fetch_users(*steamids) U

Re: [Tutor] Convert a list to a group of separated strings

2014-09-11 Thread Juan Christian
On Thu, Sep 11, 2014 at 2:07 PM, Danny Yoo wrote: > > > Hi Juan, > > You have a "var-arity" function called fetch_users(), and you'd like > to apply it with an explicit list of arguments "my_list". > > In this case, you want to use the application operator: > > > https://docs.python.org/2/tutorial

Re: [Tutor] Convert a list to a group of separated strings

2014-09-11 Thread Juan Christian
Done. thanks guys. On Thu, Sep 11, 2014 at 2:43 PM, Danny Yoo wrote: > > On Thu, Sep 11, 2014 at 2:09 PM, Peter Otten <__pete...@web.de> wrote: > >> > >> > >> You can explode the list by invoking the function with > >> > >> fetch_users(*my_list) # prepend the list with a star > >> > >> but I rec

[Tutor] UnicodeEncodeError in python

2014-09-11 Thread Juan Christian
I'm iterating through Steam users and friend lists. So, my program was working good, but then I got some UnicodeEncodeError randomly, I didn't know where was the problem, then I was checking the names that I got from the API by hand, and then I saw users with ™, ︻デ═一, ︻芫, º³® and tons of other

Re: [Tutor] UnicodeEncodeError in python

2014-09-11 Thread Juan Christian
gt; unicode type, and then decode the string into unicode. > > something like this: > > name = unicode(original_name) > name = name.decode("utf-8") > > This is assuming your data source is in fact utf-8 encoded (which is the > most likely, imhe). > > Hope it

Re: [Tutor] UnicodeEncodeError in python

2014-09-11 Thread Juan Christian
On Thu, Sep 11, 2014 at 4:39 PM, Juan Christian wrote: > > Using 3.4.1 > > I did try: > > self.persona_name = unicode(personaname) > self.persona_name = personaname.decode("utf-8") > > But didn't work! > Some of the chars that brakes the program:

Re: [Tutor] UnicodeEncodeError in python

2014-09-11 Thread Juan Christian
On Thu, Sep 11, 2014 at 5:23 PM, Peter Otten <__pete...@web.de> wrote: > > > You are getting an *encoding* error, so this may be triggered when you are > trying to print. Can you post the traceback? > > Also, what is your OS and what does > > $ python3 -c'import locale; print(locale.getpreferredenc

[Tutor] GUI development with Python 3.4.1

2014-09-17 Thread Juan Christian
I need to develop a GUI for my Python pogram, I already read the GuiProgramming page (https://wiki.python.org/moin/GuiProgramming). For me, the best so far was 'gui2py'. The problem is that I need a simple "C#/Java-ish" GUI builder, that is easy and simple, coding all the GUI by hand is boring, I

Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Juan Christian
On Wed, Sep 17, 2014 at 2:01 PM, Juan Christian wrote: > I need to develop a GUI for my Python pogram, I already read the > GuiProgramming page (https://wiki.python.org/moin/GuiProgramming). For > me, the best so far was 'gui2py'. > > The problem is that I need a simple

Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Juan Christian
On Thu, Sep 18, 2014 at 10:12 AM, Joel Goldstick wrote: > > I've not used it but Tkinter seems to be well used. > > I'm not sure what a C#/Java-ish thing is, but python isn't that. > "C#/Java-ish" in terms of GUI Builder, drag and drop, like Glade and gui2py. _

[Tutor] Problem getting data using beautifulsoup4 + python 3.4.1

2014-09-18 Thread Juan Christian
My code: import requests import bs4 FORUM_ID = "440" response = requests.get(' http://steamcommunity.com/app/{id}/tradingforum'.format(id = FORUM_ID)) soup = bs4.BeautifulSoup(response.text) topics = [a.attrs.get('href') for a in soup.select('a.forum_topic_overlay')] for topic in topics: r = r

Re: [Tutor] Problem getting data using beautifulsoup4 + python 3.4.1

2014-09-18 Thread Juan Christian
On Thu, Sep 18, 2014 at 6:10 PM, Peter Otten <__pete...@web.de> wrote: > > The doesn't have an href attribute, its child has. Try > > [a.attrs["href"] for a in s.select("div.authorline a")] OMG, I completely forgot about the 'a'... http://goo.gl/A8sRLT Thanks! 100% Working. ___

[Tutor] Is there any XML lib like the default json lib in terms of usability?

2014-09-18 Thread Juan Christian
Using the default json lib is easy and straightforward: import json info = json.loads('file.json') # Use dict and list to navigate through 'info' Sadly, I'm working in a script and the only format the server gives is XML, I searched for a good alternative and didn't find anything as easy as the

[Tutor] Using 'requests' + 'with statement' in Python 3.4.1

2014-09-19 Thread Juan Christian
This part of my code isn't working: def check_backpacktf(steamID64): with requests.get(''.join([BACKPACKTF, steamID64])) as response: status = {'profile': ''.join([BACKPACKTF, steamID64]),'backpack_value': 'Private or invalid', 'steamrep_scammer': False} with response.json()['response']['players'

Re: [Tutor] Using 'requests' + 'with statement' in Python 3.4.1

2014-09-19 Thread Juan Christian
On Fri, Sep 19, 2014 at 2:50 PM, Danny Yoo wrote: > > So Python's "with" appears to require a bit more out the thing being > managed than the similar try-with-resources in Java. > ( > http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html > ) > Is there anything simila

Re: [Tutor] Using 'requests' + 'with statement' in Python 3.4.1

2014-09-19 Thread Juan Christian
On Fri, Sep 19, 2014 at 3:15 PM, Peter Otten <__pete...@web.de> wrote: > > Let's take a step back: if you were to write > > > with requests.get(''.join([BACKPACKTF, steamID64])) as response: > > status = {'profile': ''.join([BACKPACKTF, steamID64]),'backpack_value': > > 'Private or invalid', 'steam

Re: [Tutor] Using 'requests' + 'with statement' in Python 3.4.1

2014-09-19 Thread Juan Christian
This is the code using the contextlib (more than 105 lines): http://pastebin.com/jVhz7Ta6 But I'm getting another (super confusing) error now: [#] [Tf2 inventory [W]CS GO Skins Author: Pnoy Paragon << UNTIL HERE, OK! Traceback (most recent call last): File "C:\User

Re: [Tutor] Using 'requests' + 'with statement' in Python 3.4.1

2014-09-19 Thread Juan Christian
On Fri, Sep 19, 2014 at 3:53 PM, Peter Otten <__pete...@web.de> wrote: > > If I understand you correctly you can test for the presence of a value. > Example: > > api = response.json()['response']['players'][steamID64] > status["steamrep_scammer"] = "steamrep_scammer" in api Thanks, this way I can

Re: [Tutor] Using 'requests' + 'with statement' in Python 3.4.1

2014-09-19 Thread Juan Christian
On Fri, Sep 19, 2014 at 4:30 PM, Peter Otten <__pete...@web.de> wrote: > > Well, you import closing from the stdlib with > > from contextlib import closing > > and then proceed to write your own closing > > @contextmanager > def closing(thing): > try: > yield thing > finally: >

[Tutor] Converting timestamp read as str to "full date and time"

2014-09-19 Thread Juan Christian
Let's say I have ' 1411167038 ' string that I got from an API and I need to convert it to something like ' Fri, 19 Sep 2014 22:50:38 GMT ' or maybe even the localtime of the PC. I'm trying this way: my_date = datetime.datetime.fromtimestamp(api['backpack_update'][GAME_ID]).strftime("%D %H:%M") T

Re: [Tutor] Converting timestamp read as str to "full date and time"

2014-09-19 Thread Juan Christian
On Fri, Sep 19, 2014 at 8:22 PM, Danny Yoo wrote: > Huh. I should have read your message more closely. Sorry; it's been > one of those days for me, it seems... > > Anyway, can you use ctime()? It looks like that might be almost right: > > >>> t = 1411167038 > >>> datetime.datetime.utcf

Re: [Tutor] Converting timestamp read as str to "full date and time"

2014-09-19 Thread Juan Christian
So.. It seems all my problem was in the .strftime("%D %H:%M") I don't exactly know why, but I removed and it's working. It's not giving me the localtime, but I'll search how to do that. ___ Tutor maillist - Tutor@python.org To unsubscribe or change sub

Re: [Tutor] Converting timestamp read as str to "full date and time"

2014-09-19 Thread Juan Christian
On Fri, Sep 19, 2014 at 9:24 PM, Juan Christian wrote: > So.. It seems all my problem was in the .strftime("%D %H:%M") > > I don't exactly know why, but I removed and it's working. It's not giving > me the localtime, but I'll search how to do that

Re: [Tutor] Converting timestamp read as str to "full date and time"

2014-09-19 Thread Juan Christian
On Fri, Sep 19, 2014 at 10:50 PM, Cameron Simpson wrote: > On 19Sep2014 20:46, Juan Christian wrote: > >> On Fri, Sep 19, 2014 at 8:22 PM, Danny Yoo >> wrote: >>Anyway, can you use ctime()? It looks like that might be almost right: >

[Tutor] Python 3: List Comprehensions + range

2014-09-21 Thread Juan Christian
I have a ' self.size = json['number_of_seasons'] ' that equals 5 (already checked), the problem is that the API have some series with special seasons, aka, season_number = 0, and I don't want to get those. I have the following list comp: self.season = [Season(ID, season, self) for season in range(

Re: [Tutor] Python 3: List Comprehensions + range

2014-09-21 Thread Juan Christian
Anyone?​ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python 3: List Comprehensions + range

2014-09-21 Thread Juan Christian
On Sun, Sep 21, 2014 at 3:28 PM, Joel Goldstick wrote: > > You are calling Season with different parameters than it was defined to > accept. No, I'm not. Season > def __init__(self, ID, season, serie) and I'm calling it with Season(ID, season, self), I'm giving everything needed, don't I?

Re: [Tutor] Python 3: List Comprehensions + range

2014-09-21 Thread Juan Christian
On Sun, Sep 21, 2014 at 4:21 PM, Joel Goldstick wrote: > > Shouldn't it be: Season(ID, season, serie)? No, we always have to have 'self' in the first arg. On Sun, Sep 21, 2014 at 4:25 PM, Danny Yoo wrote: > > Please treat email as asynchronous: sometimes you'll get a response > within minute

Re: [Tutor] Python 3: List Comprehensions + range

2014-09-21 Thread Juan Christian
Thanks Danny, indeed, the problem was in these confusing names. The problem was here: Class Episode > s = season The fix: s = season.number ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mai

Re: [Tutor] Python 3: List Comprehensions + range

2014-09-21 Thread Juan Christian
On Sun, Sep 21, 2014 at 10:13 PM, Steven D'Aprano wrote: > > Have patience, we're not on 24/7 duty and you don't have a SLA (Service > Level Agreement) with us. > > Normally it is considered polite to wait at least one day before sending > a reminder, not six hours. Although we have list members a

[Tutor] Python advice about API, JSON

2014-09-22 Thread Juan Christian
I'm trying to make my script the more pythonic possible. How would a good approach regarding external API and json be? I'm calling this API (http://docs.themoviedb.apiary.io/) using 'requests'. The thing is that I need to do a bunch of different calls to the API: - http://api.themoviedb.org/3/per

Re: [Tutor] Python advice about API, JSON

2014-09-22 Thread Juan Christian
On Mon, Sep 22, 2014 at 5:10 PM, Patrick Thunstrom wrote: > On Mon, Sep 22, 2014 at 4:01 PM, Juan Christian > wrote: > > I'm trying to make my script the more pythonic possible. How would a good > > approach regarding external API and json be? > > I don't th

[Tutor] Ubuntu 14.04 + Python 3.4.1 (pyvenv) + sqlite3

2014-09-25 Thread Juan Christian
So, I'm coding a software using Flask and sqlite3 on Ubuntu 14.04, I read that on Python 3.4.1, sqlite3 is default, but when I try to 'import sqlite3' I get: Traceback (most recent call last): File "flaskr.py", line 5, in import sqlite3 File "/usr/local/lib/python3.4/sqlite3/__init__.py",

[Tutor] Beautifulsoup4 question

2014-10-01 Thread Juan Christian
I have this part of the code - full_item_list = self._soup.find_all('li', {'data-app': '440'}) - that gives me this: Very long output (~ 211 lines): http://pastebin.com/WLTtgVZz Now I need to filter this RAW data, what I need is to convert this data to something like a list of dicts in Python, so

Re: [Tutor] Beautifulsoup4 question

2014-10-01 Thread Juan Christian
On Wed, Oct 1, 2014 at 8:02 PM, Danny Yoo wrote: > Hi Juan, > > What you should be getting back from the call to find_all() should > already be dictionary-like. Although they *print* like HTML, they're > really soups. > > So you should already be able to do: > > #

Re: [Tutor] Beautifulsoup4 question

2014-10-01 Thread Juan Christian
On Wed, Oct 1, 2014 at 9:37 PM, Juan Christian wrote: > OH MY GOD! Super fail, hahaha. > > Thanks, bs4 is incredible. I thought they were RAW html data. Thank you! > Not everything is that easy, hahaha. So, I can get everything I want, but this part: http://media.steampowered.

[Tutor] Using xml.etree ElementTree

2014-10-07 Thread Juan Christian
I have this XML scheme: http://steamcommunity.com/profiles/76561198084537782?xml=1 My code: self._xml = ElementTree.fromstring(requests.get(url + '?xml=1').content) print(self._xml.tag) > returns > profile It's working, the thing is that I don't know how to "navigate" inside the XML, I read the

Re: [Tutor] Using xml.etree ElementTree

2014-10-07 Thread Juan Christian
On Tue, Oct 7, 2014 at 4:08 PM, Juan Christian wrote: > I have this XML scheme: > http://steamcommunity.com/profiles/76561198084537782?xml=1 > > My code: > > self._xml = ElementTree.fromstring(requests.get(url + '?xml=1').content) > print(self._xml.tag) > retur

Re: [Tutor] Using xml.etree ElementTree

2014-10-07 Thread Juan Christian
On Tue, Oct 7, 2014 at 7:50 PM, Danny Yoo wrote: > Hi Juan, > > I think you're looking for: > > http://effbot.org/zone/element.htm#searching-for-subelements > > where you should be able to do something like: > > sml._xml.findtext('steamID64') > > to get the text "76561198084537782". > > >

[Tutor] How to use custom protocol with requests?

2014-10-11 Thread Juan Christian
I need to call this URL: steam://friends/add/ If I put it in my browser and press enter it works as expected, now I need to do this on my code, I don't need to retrieve anything, I just need it to be "executed", is there a way to do that in Python with requests or any other lib? Python 3.4.1

Re: [Tutor] How to use custom protocol with requests?

2014-10-11 Thread Juan Christian
On Sat, Oct 11, 2014 at 11:53 PM, Danny Yoo wrote: > >> I need to call this URL: steam://friends/add/ > >> > >> If I put it in my browser and press enter it works as expected, now I > need > >> to do this on my code, I don't need to retrieve anything, I just need > it to > >> be "executed", is th

Re: [Tutor] How to use custom protocol with requests?

2014-10-11 Thread Juan Christian
On Sat, Oct 11, 2014 at 11:47 PM, Danny Yoo wrote: > This may be more difficult to do; it's unclear whether or not this is > exposed in the web API that Valve provides. > > Unlike the other methods described in: > > https://developer.valvesoftware.com/wiki/Steam_Web_API > > which are all quer

Re: [Tutor] How to use custom protocol with requests?

2014-10-11 Thread Juan Christian
Sorry for triple post, but yes, webbrowser worked 100%. Exactly what I needed! Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to use custom protocol with requests?

2014-10-12 Thread Juan Christian
On Sun, Oct 12, 2014 at 12:17 AM, Danny Yoo wrote: > Huh. Wow. That actually worked? > > :P > > --- > > Frankly speaking though, this sounds like a horrible XSRF-style attack > in waiting, if I understand what has just happened. > (http://en.wikipedia.org/wiki/Cross-site_request_forgery) > > Us

[Tutor] Python sqlite3 issue

2014-10-20 Thread Juan Christian
I have this code (http://pastebin.com/Q21vQdHZ): import sqlite3 db = sqlite3.connect('db.sqlite') def create_db(): db.execute(''' CREATE TABLE TOPICS( ID INT PRIMARY KEY NOT NULL, URL VARCHAR NOT NULL, AUTHOR VARCHAR NOT NULL, MESSAGE VARCHAR NOT NULL ); ''') d

Re: [Tutor] Python sqlite3 issue

2014-10-20 Thread Juan Christian
Ok, new code using ?: import sqlite3 db = sqlite3.connect('db.sqlite') def create_db(): db.execute(''' CREATE TABLE TOPICS( ID INT PRIMARY KEY NOT NULL, URL VARCHAR NOT NULL, AUTHOR VARCHAR NOT NULL, MESSAGE VARCHAR NOT NULL ); ''') def insert_db(_id, ur

Re: [Tutor] Python sqlite3 issue

2014-10-22 Thread Juan Christian
So guys, now I have this code that is fully working: import sqlite3 db = sqlite3.connect('db.sqlite') def ini_db(): db.execute(''' CREATE TABLE IF NOT EXISTS TOPICS( ID INTEGER NOT NULL, URL VARCHAR NOT NULL, AUTHOR VAR

Re: [Tutor] Python sqlite3 issue

2014-10-22 Thread Juan Christian
On Wed, Oct 22, 2014 at 4:37 PM, Alan Gauld wrote: > > Incidentally you don't need the semi-colon inside the execute. It can only > execute the entire string so if there's only one command you > don't need the terminator. Ok, thanks! Note that this makes no checks for unique ID so you put the

[Tutor] Python 3.4.1 ImportError Linux

2014-12-16 Thread Juan Christian
Python 3.4.1 Fedora 21 Server My paths: ~/lorem ~/lorem/app ~/lorem/core I want to execute: ~/lorem/app/main.py Terminal (~/lorem/app): python3 main.py Traceback (most recent call last): File "app/main.py", line 5, in from core.backpack import BackpackThread ImportError: No module named 'core'

[Tutor] How to change default path output of 'logging'?

2014-12-22 Thread Juan Christian
I have a 'logging' on my code using: import logging < ... > logging.basicConfig(filename="bumpr.log", level=logging.INFO) < ... > The thing is that the default location of this output when running via Windows Task Scheduler is 'C:/Windows/System32'. Is there a way to change the location of the o

Re: [Tutor] How to change default path output of 'logging'?

2014-12-22 Thread Juan Christian
On Mon Dec 22 2014 at 1:35:44 PM Dave Angel wrote: > > No idea what part main.py plays to your code. If it's imported, then > you could use main.__file__ to get the full pathname to it. Then use > os.path.dirname() to get the directory. Then use os.path.join() to > combine that with "bumpr.log