« first day (2313 days earlier)      last day (1028 days later) » 

user15071349
5:27 PM
yeah, I didnt knew about that earlier so I asked very basics question and some people downvoted it can you guys please upvote my -2 post to 0 ? just 2 vote please ?
 
1 message moved from Python
 
it happened to me then my account got deleted
 
user15071349
Can you ask questions now ?
 
yes
this is my second account
other one got deleted
 
user15071349
ok moderators are telling me to edit my previous questions which are so stupid that I cant edit anything in them
 
user15071349
5:39 PM
what should i do now ?
 
then try to edit it
enven tho
 
user15071349
ok i will try it otherwise i have to creat new account too
 
ok
mine was answer ban
 
6:21 PM
You're both aware that it's against the site rules to create new accounts to get around bans, I assume
 
6:49 PM
13 messages moved from Python
 
 
2 hours later…
8:21 PM
If you build an app - where would any procedural code generally be placed in the overall structure?
 
I don't think I understand the question
 
Same. Unless I'm misunderstanding what "procedural code" is, I would say "everywhere". Functions are good. Using functions is good. Use them all the time.
 
Given the tags you're on from your profile, are you asking about psycopg2 queries?
 
No. Where would code go that isnt an object. Code that does things with objects. Scripting stuff
 
But everything is an object...
 
8:26 PM
Not everything
 
Crystall ball says "code outside functions, in the global scope of a module"
 
Things outside a def statement
 
@bigsusan can you explain your use case? What this code is doing? Current situation is way too vague for us to help.
You might be looking for __main__, or you might not.
 
A script
 
Ah.
 
8:27 PM
Say you have a script that makes use of modules
but it is in an App
 
This is getting frustrating fast.
 
@bigsusan one last try. How/when would that script be executed?
 
Any number of reasons. Automation being one
So Azure, AWS Lambda, whatever
So say...
You have an app. It has packages inside. You wanna have code that utilizies objects in the modules of those packages to achieve some task
 
You normally expose that code as functions in a package, right?
 
So the question is "When should you write code outside of a function"? In that case, my answer is "Almost never"
 
8:31 PM
No
Not when
Where would it go in an App. App meaning a Python App.
Like the most literal definition of Python App
 
Depends. What does that code do?
 
I'm out
 
Leverages functions or classes.
 
The only things I would write outside of a function are imports, class definitions, function definitions, and a if __name__ == '__main__': main()
Oh, and definitions of constants, or loggers
 
So how are you actually making use of the functions? Where are you saying - do something with this function? You're just writing cli things?
 
8:34 PM
No, absolutely not. I don't think you have a grasp of how the language works
 
I'm making use of them in other functions. And at the root of all those functions is the main function, which I call from a if __name__ == '__main__': main() guard
 
So you're wrtiing ufnctions you never call or use?
 
You can make a script that can call any arbitrary function, whether you defined it or imported it from another package
 
So what is your main ding then?
doing
 
Whatever you want your program to do
 
8:35 PM
Im asking you
What is your main doing. How is it instantiating
@roganjosh - yes you very much can - I stated so above. But I am asking about an App that has everything in one thing
Like you need to write a couple of lines to do something -- wheres it go typically?
 
Instantiating? Instantiating what? And why is that even a question? You always instantiate classes by calling them. You know, like app = App().
 
You keep saying "App" as though this is a well-defined concept. It isn't.
 
Python App is a defined concept
App, Package, Module. All defined
 
No it isn't. A package might be
 
I dont want to argue semantics.
Say you had an executable
where would it typically go?
a bin folder?
 
8:38 PM
And I don't want to unpick your question that comes with rapid-fire, unclear statements
So, we're done here
 
entrypoint foklder
 
That's a completely different question now. This has nothing to do with python anymore
 
It does
I am changing my terms to make you happy
 
"Where does procedural code go" is not the same thing as "Where do executable files go". Not even close
 
That's enough @bigsusan. Communicate in clear, structured sentences or go do the research.
 
8:40 PM
Nah
Heres an example
 
*rubs eyes* D-did they really just respond "nah"?
 
we'll never know
 
You don't get to say "nah" to an Room Owner, btw.
 
it could've been a response to Aran-Fey but that doesn't really matter
we're going nowhere with this
68 messages moved from Python
 
peace
 
8:54 PM
Bye
 
Yup, that's unclear. Bye.
 
2 messages moved from Python
2 messages moved from Python
 

« first day (2313 days earlier)      last day (1028 days later) »